Jump to content
Message added by TopicLocker3000

This topic was automatically locked after 6 months of inactivity. If you are the topic owner, please contact a moderator to have it unlocked.

Recommended Posts

I was recently taking a look at the particle system.

Because of my monitor's small resolution screen, I couldn't even read all the options in the particles sidebar in the video. ;)

I thought of something which I assume would be relatively easy to implement, maybe two hours worth of GM work.

 

You should be able to export a particle preset. This would be pretty simple. Rather than creating a new format, one could simply use the JSON format (incidentally also used by Mojang for internal Minecraft storage).

Since I couldn't read any of the options (as stated above) I had to make some qualities up, but here's an example of what the JSON could look like.

 

{
    "name": "Pig Cannon",
    "type": "3d",
    "appearance": [
        {
            "type": "Character",
            "model": "Pig"
        }
    ],
    "direction": [
        {
            "use": true,
            "randomise": 0.1,
            "x": 0.8,
            "y": 0.06,
            "z": 0
        }
    ],
    "velocity": [
        {
            "use": true,
            "randomise": 0,
            "x": 1,
            "y": 0.8,
            "z": 0
        }
    ],
    "rotation": [
        {
            "use": true,
            "randomise": 0.2,
            "x": 0.8,
            "y": 0.06,
            "z": 0
        }
    ],
}
 

Also, there are existing GMS functions used for encoding and decoding JSON. However, although I do code, I don't really work with GM, so I'm unsure if this is relevant.

To simplify editing of the particle JSON format, you could use YAML instead, which is a less sytaxically strict version of the exact same thing. (The YAML format is used by Bukkit.) Unfortunately, I couldn't actually find any GMS functions for converting YAML to JSON.

Here is the above example converted to YAML. Notice the added readability ;)

 

name: Pig Cannon
type: 3d
appearance:
    type: Character
    model: Pig

direction:
    use: true
    randomise: 0.1
    x: 0.8
    y: 0.06
    z: 0

velocity:
    use: true
    randomise: 0
    x: 1
    y: 0.8
    z: 0

rotation:
    use: true
    randomise: 0.2
    x: 0.8
    y: 0.06
    z: 0
I used a 3D pig, because I'm too lazy to use a 2D particle. ^^;

A 2D particle would have far more properties in the "appearance" array, such as "type", "color1", "color2", and others (from what I saw in the video.)

Link to post
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...