Units with multiple weapon types seem very broken

Discussion in 'Mod Discussions' started by YourLocalMadSci, July 11, 2014.

  1. YourLocalMadSci

    YourLocalMadSci Well-Known Member

    Messages:
    766
    Likes Received:
    762
    We are trying to do things with units that have multiple types of weapon and are continually running into crashes. Our two main problems go thusly:

    Units with very different types of weapon
    We have tried to give the battleship flak cannons as well as it's regular cannons. We took the old battleship model with the un-textured/unwrapped side cannons, and used them as the aim and muzzle bones for the new flak.

    The flak cannons work fine, although obviously, there is no visible turret. However, the main cannons cause a crash every time they fire. The crash normally occurs about 1-2 seconds after the main cannons fire. All .json files have been successfully validated. We have tried the following things to fix the problem:

    • Altered the record_index system such that both forward and both aft cannons each share an index, with the port and starboard flak guns each sharing an index. No luck.
    • Reverted to stock .jsons but with the old model to test it is not broken. Worked fine, demonstrating there is nothing incompatible with the model.
    • Tried different combinations of primary and secondary weapon flags added to the weapons. No luck.
    I'm stumped on this one. I wonder if the new multiple targeting system has trouble with weapons that cannot hit the same kind of target (eg one targets surface and one targets air). Any help would be much appreciated.

    Units with factory built weapons
    It seems that factory built weapons all share a common variable to check if they have ammo. For example, if I want to add an anti-sat missile to the anti-nuke launcher, I can make it build fine. However, the anti-nuke will launch the anti-sat missile at nukes, which will then circle it endlessly, and potentially cause a crash. Vice versa occurs with anti-nuke missiles. I can see no way to make sure that each weapon will only use it's own type of ammunition, rather than treating all ammunition as a common stockpile.

    I would really like to see these kind of multi-weapon units be viable. Any assistance or support would be gratefully received.
  2. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    Have you tried looking at the code for the narwhal?
  3. YourLocalMadSci

    YourLocalMadSci Well-Known Member

    Messages:
    766
    Likes Received:
    762
    That's not particularly useful if we want to make use of the multiple targeting system.

    Also, even removing the independent targeting system doesn't work.
    Last edited: July 12, 2014
  4. YourLocalMadSci

    YourLocalMadSci Well-Known Member

    Messages:
    766
    Likes Received:
    762
    So I've been doing a little more systemic de-bugging. Turns out it was the energy system of the leviathan. The energy/ammo system does not interact well with having multiple weapons. Perhaps it doesn't know how to display the below-unit bar for multiple weapons. Either way, this is going to have to come out for now in order to make the mod work.
  5. squishypon3

    squishypon3 Post Master General

    Messages:
    7,971
    Likes Received:
    4,357
    Aha, Statera had the same problem with a couple of buildings, such as the umbrella, and triple laser tower I believe, the game crashed whenever those buildings were destroyed for some reason.
  6. mgmetal13

    mgmetal13 Active Member

    Messages:
    203
    Likes Received:
    151
    The hailfire is currently set up like this @emraldis. I think this might be why our mod is crashing.
  7. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    Um yeahp that'd be it fix it ya durned durpz
  8. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    It could be, though we've had plenty of games & test runs with no issues, as well as instances not involving hailfires where a crash has occurred. Or at least no hailfires were reported...

Share This Page