multiple effects limitation

Discussion in 'Mod Discussions' started by Engineer1234, June 19, 2017.

  1. Engineer1234

    Engineer1234 Well-Known Member

    Messages:
    325
    Likes Received:
    291
    I made an air unit with 2 engines and I thought I would just put a bone on each engine and hook an effect to each bone.

    Nope.

    I can't for the life of me get both to display, only one displays, I think the limitation is in that a unit can only have one "moving_forward" effect, that's the type I'm trying to use two of, can anyone confirm that is not allowed?
    I found in the hovering air units that an effect of the type "moving" can be on a unit multiple times, the air fabbers have two of those.

    What I threw in my json is this:

    "fx_offsets": [{
    "type": "moving_forward",
    "filename": "/pa/units/air/fighter/fighter_jets.pfx",
    "bone": "bone_left_engine",
    "offset": [0.0,
    0.0,
    0.0],
    "orientation": [0,
    0,
    0]
    }],
    "fx_offsets": [{
    "type": "moving_forward",
    "filename": "/pa/units/air/fighter/fighter_jets.pfx",
    "bone": "bone_right_engine",
    "offset": [0.0,
    0.0,
    0.0],
    "orientation": [0,
    0,
    0]
    }],

    Next I tried copying the effect file with a different name, and using that for the second bone, but then too only one of them displays.
    Could anyone please shed some light on the limitations of effects and hooking them up to bones? I thought this would be more straightforward :p
  2. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    Bomber_heavy uses multiple moving_forward effects.

    Taking a look at what you might be doing wrong.

    Okay, I see what you're doing wrong. Do this

    "fx_offsets": [{
    "type": "moving_forward",
    "filename": "/pa/units/air/fighter/fighter_jets.pfx",
    "bone": "bone_left_engine",
    "offset": [0.0,
    0.0,
    0.0],
    "orientation": [0,
    0,
    0]
    },
    {
    "type": "moving_forward",
    "filename": "/pa/units/air/fighter/fighter_jets.pfx",
    "bone": "bone_right_engine",
    "offset": [0.0,
    0.0,
    0.0],
    "orientation": [0,
    0,
    0]
    }],

    JsonLint is your friend. :)
    Engineer1234 likes this.
  3. dom314

    dom314 Post Master General

    Messages:
    896
    Likes Received:
    1,196
    The problem is just that you need to give a list to fx_offsets, and what you have done is define the same fx_offsets list, twice (with only a single item). So in this case merging the two items into a single list will work:
    Code:
    "fx_offsets":  [
       {
          "type": "moving_forward",
          "filename": "/pa/units/air/fighter/fighter_jets.pfx",
          "bone": "bone_left_engine",
          "offset": [0.0, 0.0, 0.0],
          "orientation": [0, 0, 0]
       },
       {
          "type": "moving_forward",
          "filename": "/pa/units/air/fighter/fighter_jets.pfx",
          "bone": "bone_right_engine",
          "offset": [0.0, 0.0, 0.0],
          "orientation": [0,0,0]
       }
    ],
    
    Engineer1234 likes this.
  4. Engineer1234

    Engineer1234 Well-Known Member

    Messages:
    325
    Likes Received:
    291
    Thanks @stuart98 @dom314 I'm gonna implement a proper list :D
    I didn't realize it was a formatting thing causing the problem.
    dom314 likes this.
  5. Engineer1234

    Engineer1234 Well-Known Member

    Messages:
    325
    Likes Received:
    291
    @stuart98 @dom314 Thanks again guys this makes placing effect a whole lot easier.
    Here's a sneak peek of what I'm working on.

    jets.PNG
    Nicb1, lulamae, dom314 and 2 others like this.
  6. cdrkf

    cdrkf Post Master General

    Messages:
    5,721
    Likes Received:
    4,793
    Looking good :D
    Nicb1 likes this.

Share This Page