[REL] Cruise Missile/Flying Bomb

Discussion in 'Released Mods' started by bsergent, January 27, 2015.

  1. bsergent

    bsergent Active Member

    Messages:
    236
    Likes Received:
    73
    No I'm crashing still, like I said same behavior. Once the unit begins to build before any model is displayed the server crashes.

    Thank you for the build image info.

    Can the unit be made to work despite the broken build image for now?
  2. lokiCML

    lokiCML Post Master General

    Messages:
    1,973
    Likes Received:
    953
    The standards around json do not allow comments.:( Which makes sense for its a original purpose but if you're using it as configuration files comments are very useful. Comments could be used in a json file but has to be removed before it can be parsed. This could be done by using JSON.minify which can be found here.

    Fun fact: Json originally had comments they were removed due to abuse.
    bsergent likes this.
  3. bsergent

    bsergent Active Member

    Messages:
    236
    Likes Received:
    73
    I still can't get it to work. This project is stalled till someone can look over my code and tell me what I did wrong :( I appreciate all your help.

    P.S. That's silly about json. The idea of a code file you can't comment in is just nuts. But at the same time, there has to be a way.

    I don't know much about coding but couldn't I like define the text for a window that will never get displayed? I may not be able to explicitly escape text but surely I can find some way to insert a line that does nothing?
  4. trialq

    trialq Post Master General

    Messages:
    1,295
    Likes Received:
    917
    @bsergent
    You can do as loki suggests, which is probably the best way although it adds a small step before release. Or you can add unused fields in the json and use them as comments, which is a massive bodge. Whatever works for you.
    bsergent likes this.
  5. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    missile_tactical.papa doesn't have a bone_root. The choices are

    missile_tactical_mesh
    solid
    DiffuseColor

    However I tried putting in one of them and it still crashed.
    bsergent likes this.
  6. bsergent

    bsergent Active Member

    Messages:
    236
    Likes Received:
    73
    Oh. Well, if I can't make it a missile shape I could just use the fighter body, after all a real cruise missile looks like a little jet anyway.

    Assuming I do that, how would I then make it explode on impact? (like a t1 arty shell)

    I'm happy to not have comments in the files, I can always keep notes separately. Though that'll suck for future modders. I consider commenting to be polite and supportive. But if my choice is ruin the code or be rude, I'll be rude hehe.
  7. lokiCML

    lokiCML Post Master General

    Messages:
    1,973
    Likes Received:
    953
    It can be done by adding something like minify to PA.:)
    Edit: if anybody is interested in the history of json I was just watching this video.

    Edit2: about 16 minutes in he discuss why json does not have comments.
    To clarify does not entail removing comments manually. By adding something like minify which strips comments out before the json is parsed the problem is nonexistent. It's just that Uber would have to do it in order to make it work correctly. Added minify.json.js to thirdparty directory and then replace all JSON.parse() with JSON.parse(JSON.minify(str)) for example.;)
    You can have your cake and eat it too if something like this was done.;)
    Last edited: February 2, 2015
    trialq and bsergent like this.
  8. bsergent

    bsergent Active Member

    Messages:
    236
    Likes Received:
    73
    _"You can have your cake and eat it too if something like this was done."_

    I'm content to use it as an excuse to be selfish :p Thanks though :)
  9. trialq

    trialq Post Master General

    Messages:
    1,295
    Likes Received:
    917
    @lokiCML
    I hadn't thought of modding minify into PA, I assumed you meant to add it to the end of the toolchain. Nice idea.
  10. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    They would need one release which supported the feature but didn't have comments, and many another on PTE with comments for all the mods and external tools to update.
  11. lokiCML

    lokiCML Post Master General

    Messages:
    1,973
    Likes Received:
    953
    Lets move this out of this thread to here. So the OP gots answers for his other questions.;)
    bsergent likes this.
  12. bsergent

    bsergent Active Member

    Messages:
    236
    Likes Received:
    73
    Your consideration is appreciated but considering the fact that some of the best modders on this forum have already commented here I don't see a solution arriving any time soon :) By all means, continue your discussion :)
    lokiCML likes this.
  13. Diaboy

    Diaboy Active Member

    Messages:
    110
    Likes Received:
    63
    I'm not at my home computer, so I can only speculate, but my first guess would be that the references to animations/stances/effects etc all rely on the fighter's bone structure, where as the cruise missile only has 1 bone

    I'd start with making the whole thing self-contained (no references to unedited files, in case they rely on bones that do not exist in the missiles model) and make sure that everything is linked correctly, and all references to bone_root are gone.

    If you're still crashing, might be an idea to export the missile's model and regenerate a .papa with a more conventional bone structure.

    I'm no expert but it's what I'd do, at least.
  14. lokiCML

    lokiCML Post Master General

    Messages:
    1,973
    Likes Received:
    953
    Don't worry about it.:) I've been meaning for a while to see if the ability to add comments in json file could be added to PA. They is always resistance to the idea of add comments json. I don't understand.:confused:
    bsergent likes this.
  15. bsergent

    bsergent Active Member

    Messages:
    236
    Likes Received:
    73
    I started over in a sense.

    I simply cloned the fighter. It still doesn't have a build icon (because I renamed it's json and folder "air_cruise") But the unit builds and behaves exactly like a fighter.

    So can I make it fly into things and explode by playing with the tool weapon and ammo files?

    Can a unit's weapon do damage to itself?
  16. trialq

    trialq Post Master General

    Messages:
    1,295
    Likes Received:
    917
    @bsergent
    I know little, except that the nuke does friendly damage and the boom bots self destruct, you may want to look there first.
    bsergent likes this.
  17. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    I believe splash damage can do friendly fire - look at the nukes and nuke-like things. May be more appropriate to use self_destruct as in the boom weapon though.
    bsergent likes this.
  18. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    Take a look at how boom bots are set up, and copy them.
    bsergent likes this.
  19. bsergent

    bsergent Active Member

    Messages:
    236
    Likes Received:
    73
    Excellent, thank you all.

    I replaced the content of the ammo and tool/weapon files with the content from the boom bot and added the called for bot_bomb_ammo_explosion_ent.json file to the air_cruise directory.

    The fighters will fly and attempt to attack when ordered, but nothing happens. They fly over the target in a figure 8 type pattern.

    What else do I need to change you think?
  20. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    More attack range I'd guess? Also check the target layers.

Share This Page