[WIP] Orbital (and bot) balance mod

Discussion in 'Work-In-Progress Mods' started by emraldis, July 5, 2014.

  1. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    It's not a tactical missile, it's just a re-purposed fighter missile. It doesn't seem to have a spawn layer.
  2. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    The fighter missile inherits from base_missile_aa_seeking.
    base_missile_aa_seeking inherits from base_missile_seeking
    base_missile_seeking inherits from base_missile
    Base missile:

    {
    "base_spec": "/pa/ammo/base_ammo/base_ammo.json",
    "damage": 0,
    "events": {
    "died": {
    "audio_cue": "/SE/Impacts/missile_tactical",
    "effect_specs": "/pa/effects/specs/default_proj_explosion.pfx"
    }
    },
    "fx_trail": {
    "filename": "/pa/effects/specs/rocket_proj_trail.pfx",
    "offset": [
    0.0,
    0.8,
    0.0
    ]
    },
    "initial_velocity": 70.0,
    "lifetime": 30,
    "max_velocity": 70.0,
    "model": {
    "arrows": 3,
    "filename": "/pa/units/air/missile/missile.papa"
    },
    "physics": {
    "add_to_spatial_db": false,
    "gravity_scalar": 5,
    "ignore_gravity": true,
    "push_class": 1,
    "radius": 1
    },
    "spawn_layers": "WL_Air",
    "splash_damage": 0,
    "splash_radius": 1,
    "turn_rate": 150
    }
  3. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    oh, ok thanks.
  4. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
  5. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    ok, it still doesn't work. The unit just does not have a weapon ingame.
  6. nanolathe

    nanolathe Post Master General

    Messages:
    3,839
    Likes Received:
    1,887
    without being able to see your code I wouldn't know what's wrong then.
    :(
  7. thetrophysystem

    thetrophysystem Post Master General

    Messages:
    7,050
    Likes Received:
    2,874
    I know what's wrong.

    Your weapon uses a decimal range, AND you didn't start it with a zero. Tell me I am right?

    fyi: I mean "range": .4 instead of "range": 0.4

    This is usually the most common result of this in my short modding experience. We all learned a lot of troubleshooting this kind of stuff in a short time sadly. The same crap always causes the same crap, its like a crap signature showing crap was here.

    If my pot shot was right, you are welcome.
  8. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    nope. Weapon range is 300. I'm probably missing a colon or something, somewhere, but I cannot find it.

    Here is the code:

    orbital_bomber.json:
    Code:
    {
      "base_spec":"/pa/units/orbital/base_orbital/base_orbital.json",
      "display_name":"Excalibur",
      "description":"Analysis: Orbital Bomber - Slow moving, for use against orbital defenses.",
      "build_metal_cost":950,
      "max_health":175,
      "gravwell_velocity_multiplier":6.0,
      "wreckage_health_frac":0.0,
      "spawn_layers":"WL_Orbital",
      "attachable":{
          "offsets":{
            "root":[
                0,
                0,
                0
            ]
          }
      },
      "unit_types":[
          "UNITTYPE_Mobile",
          "UNITTYPE_Orbital",
          "UNITTYPE_Bomber",
          "UNITTYPE_FactoryBuild"
      ],
      "command_caps":[
          "ORDER_Move",
          "ORDER_Patrol",
          "ORDER_Attack",
          "ORDER_Assist"
      ],
      "guard_layer":"WL_Orbital",
      "guard_radius":200,
      "navigation":{
          "type":"orbital",
          "acceleration":40,
          "brake":50,
          "move_speed":30,
          "turn_speed":90,
          "circle_min_time":2,
          "circle_max_time":4,
          "hover_time":-1.0,
          "aggressive_behavior":"circle",
          "aggressive_distance":150,
          "bank_factor":1
      },
      "physics":{
          "radius":5,
          "push_class":15,
          "gravity_scalar":0.001
      },
      "recon":{
          "observer":{
            "items":[
                {
                  "layer":"orbital",
                  "channel":"sight",
                  "shape":"sphere",
                  "radius":350
                }
            ]
          }
      },
      "model":{
          "filename":"/pa/units/air/bomber_adv/bomber_adv.papa",
          "arrows":5     
          },
          "animtree":"/pa/anim/anim_trees/orbital_fighter_anim_tree.json"
      },
      "tools":[
          {
            "spec_id":"/pa/units/orbital/orbital_bomber/orbital_bomber_weapon.json",
            "aim_bone":"bone_root",
            "muzzle_bone":"bone_root"
          }
      ],
      "fx_offsets":[
          {
            "type":"moving_forward",
            "filename":"/pa/units/air/bomber_adv/bomber_adv_jets.pfx",
            "offset":[
                0,
                0,
                0
            ]
          }
      ],
      "events":{
          "build_complete":{
            "audio_cue":"/SE/Build_Complete/orbital"
          },
          "fired":{
            "audio_cue":"/SE/Weapons/orb/orb_fighter_fire",
            "effect_spec":"/pa/effects/specs/default_muzzle_flash.pfx socket_muzzle"
          },
          "died":{
            "audio_cue":"/SE/Death/orbital",
            "effect_spec":"/pa/effects/specs/default_explosion.pfx"
          }
      },
      "mesh_bounds":[
          23,
          9.5,
          4.8
      ],
      "TEMP_texelinfo":17.7177
    }
    orbital_bomber_ammo.json:
    Code:
    {
      "base_spec":"/pa/ammo/base_missiles/base_missile_orbital.json",
      "damage":1000,
      "splash_damage":0,
      "splash_radius":0,
      "initial_velocity":150.0,
      "max_velocity":150.0,
      "turn_rate":360,
      "lifetime":4
    }
    orbial_bomber_weapon.json:
    Code:
    {
      "base_spec":"/pa/tools/base_fighter_turret/base_fighter_turret.json",
      "ammo_id":"/pa/units/orbital/orbital_bomber/orbital_bomber_ammo.json",
      "rate_of_fire":0.25,
      "max_range":300,
      "firing_arc_yaw":45,
      "firing_arc_pitch":45,
      "auto_attack":true,
      "target_layers":[
          "WL_Orbital"
      ]
    }
    I probably made some really obvious mistake :/
  9. nanolathe

    nanolathe Post Master General

    Messages:
    3,839
    Likes Received:
    1,887
    Invalid json on your main bomber file.
    run it through a json validator (I suggest jsonlint)

    Your animtree isn't correctly housed in the "model" array... which means it can't aim, and therefore means it can't shoot.

    Code:
    "model": {
            "filename": "/pa/units/air/bomber_adv/bomber_adv.papa",
            "arrows": 5,
            "animtree": "/pa/anim/anim_trees/orbital_fighter_anim_tree.json"
        },
    Last edited: July 24, 2014
  10. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    oh, huh. The validator I was using wasn't finding that. Odd.
  11. nanolathe

    nanolathe Post Master General

    Messages:
    3,839
    Likes Received:
    1,887
    Sublime text 2 is free and has an inbuilt (and very reliable) josn format checker.

    Edit: there's nothing "wrong" with your json per-say other than, because of that superfluous end-bracket, your json was ending after the model and not loading anything from "tools" onward.

    Maybe I was wrong then, and that was why it wasn't firing, rather than not having an animtree...

    ...

    Probably a mix of both tbh.
  12. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    That's odd. The dox model code has the same strucutre as the "incorrect" orbital bomber code, but works fine...

    Code:
      "model":{
          "filename":"/pa/units/land/assault_bot/assault_bot.papa",
          "animations":{
            "death01":"/pa/units/land/assault_bot/assault_bot_anim_death01.papa",
            "walk":"/pa/units/land/assault_bot/assault_bot_anim_run.papa",
            "idle":"/pa/units/land/assault_bot/assault_bot_anim_idle.papa",
            "aim_up":"/pa/units/land/assault_bot/assault_bot_anim_aim_up.papa",
            "aim_down":"/pa/units/land/assault_bot/assault_bot_anim_aim_dwn.papa"
          },
          "animtree":"/pa/anim/anim_trees/bipedal_mech_anim_tree.json",
          "walk_speed":20
      },
      "tools":[
          {
            "spec_id":"/pa/units/land/assault_bot/assault_bot_tool_weapon.json",
            "aim_bone":"socket_aim",
            "muzzle_bone":"socket_rightMuzzle"
          },
  13. nanolathe

    nanolathe Post Master General

    Messages:
    3,839
    Likes Received:
    1,887
    No, it doesn't. It has an "animations" array contained within the "model" array.
  14. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    looks the same to a newb at coding like me.
  15. nanolathe

    nanolathe Post Master General

    Messages:
    3,839
    Likes Received:
    1,887
    Note the number of brackets that open and close an array:

    "model":{
    "filename":"/pa/units/land/assault_bot/assault_bot.papa",
    "animations":{
    "death01":"/pa/units/land/assault_bot/assault_bot_anim_death01.papa",
    "walk":"/pa/units/land/assault_bot/assault_bot_anim_run.papa",
    "idle":"/pa/units/land/assault_bot/assault_bot_anim_idle.papa",
    "aim_up":"/pa/units/land/assault_bot/assault_bot_anim_aim_up.papa",
    "aim_down":"/pa/units/land/assault_bot/assault_bot_anim_aim_dwn.papa"
    },
    "animtree":"/pa/anim/anim_trees/bipedal_mech_anim_tree.json",
    "walk_speed":20
    },


    Now look at your previous version:

    "model":{
    "filename":"/pa/units/air/bomber_adv/bomber_adv.papa",
    "arrows":5
    },
    "animtree":"/pa/anim/anim_trees/orbital_fighter_anim_tree.json"
    },

    ^
    |
    Notice this one doesn't have a partner.
  16. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    Ah, yes. I see it now. I didn't see the bracket after "animations":

    Thanks for the help!
  17. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    Odd. As soon as I fix it, I am no longer able to build the unit at all.
  18. nanolathe

    nanolathe Post Master General

    Messages:
    3,839
    Likes Received:
    1,887
    Doesn't the orbital fighter animtree have lots of animations referenced in it that you have now removed?
    ;)
  19. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    Not that i'm aware of, unless they were referenced somewhere else. I just copied the fighter files and replaced the model and weapons.
  20. nanolathe

    nanolathe Post Master General

    Messages:
    3,839
    Likes Received:
    1,887
    But deleted the animations...

Share This Page