[TUTORIAL] Creating a new unit from scratch

Discussion in 'Mod Discussions' started by killerkiwijuice, January 3, 2016.

  1. w33dkingca

    w33dkingca Active Member

    Messages:
    248
    Likes Received:
    80
    Ill give it a try, 3ds max's boning system seems to only create strings of bones and never a solo, I don't know how it use it fully yet so could be wrong. Ill update on the box bones when I get round to it,
  2. cascadian

    cascadian Member

    Messages:
    54
    Likes Received:
    93
    I'm following these and other guides among the forum, yet I still have this crazy scale issue when exporting from 3ds max and converting to .papa.
    [​IMG]
  3. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    sorry for the late reply, do you have a link to the papa file and/or fbx?
  4. cascadian

    cascadian Member

    Messages:
    54
    Likes Received:
    93
    i figured it out, it was an issue with editing size/rotation/position after a modifier was enabled
    Nicb1 and killerkiwijuice like this.
  5. cascadian

    cascadian Member

    Messages:
    54
    Likes Received:
    93
    I find it easiest to create two bones somewhere on the field, deleting one and then using shift to copy it indefinately and move the copies to where you want. It works pretty well for pa models at least.
  6. cascadian

    cascadian Member

    Messages:
    54
    Likes Received:
    93
    Kiwi? What is the general format for pa animations? I'm trying to get a walking animation for a custom commander but it just doesn't seem to implement. I've been making idle unit and structure animations by auto-keying rotations and such in max and then exporting the model with an animation time segment for papatran, but this doesn't seem to work with walking anim as I don't know what the time frame for a a step is.
  7. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    you pretty much need to eyeball it then change the walk speed in the unit json
  8. themax267

    themax267 New Member

    Messages:
    21
    Likes Received:
    15
    I've got all of my files for my new unit ready to go. Do I have to package my unit within a separate mod zip archive like a client or server to get it to work or can I just place the files for the unit within the respective folders already in the pa directory? I really just want to get my unit to work in my game I could care less about having to publish it for server use I just want to test my unit out.
  9. mikeyh

    mikeyh Post Master General

    Messages:
    1,869
    Likes Received:
    1,509
    https://wiki.palobby.com/wiki/Creating_Your_First_Planetary_Annihilation_Mod
  10. themax267

    themax267 New Member

    Messages:
    21
    Likes Received:
    15
    So if I have just one unit I want to add do I still have to include all of the original unit folders from the base game within my mod as well? I've been looking within the legion zip archive for reference on how to reverse engineer it, plus looking at the wiki link you sent me. Within the legion archive they've listed every unit from the base game's units.json file plus theirs in the modinfo.json. Is that necessary? Also my Planetary Directory has no filesystem folder or server_mods or client_mods folders.
    Last edited: February 13, 2017
  11. themax267

    themax267 New Member

    Messages:
    21
    Likes Received:
    15
    Also is there a tutorial for how to write a modinfo.json file specifically for a new unit mod that would be really helpful. I've basically been hopping from tutorial to tutorial over the past few days trying to figure out the whole create a new unit/modding process specific to this game. Thank you for replying.
    Last edited: February 13, 2017
  12. Nicb1

    Nicb1 Post Master General

    Messages:
    1,010
    Likes Received:
    1,286
    Honestly for a new mod I'd just take a modinfo file from another mod and just look through and change the appropriate fields like mod name, identifier, searchable and all that. Feel free to for example take legions modinfo and just take a look through it. Should be obvious which fields need to be altered.

    If any of the fields confuse you just post again and I'll do my best to clear it up.
  13. themax267

    themax267 New Member

    Messages:
    21
    Likes Received:
    15
    Thanks for the help I really appreciate it. Most of the fields make sense to me within the modinfo file but there are a few aspects about what's necessary for the content within the file plus whats needed to launch the mod that's not clear to me.

    • I understand that the new unit has to be listed under the unit.json file in order to get into the game but I don't see why all of that info has be in the modinfo file as well.
    • Plus I don't get why the units from the mod and the base game are listed throughout the modinfo file separately with a sorting number attached. Is that something that is unique to legion or is that for all new unit mods? Also why do I have to list stuff that's already in the game within my mod?
    • Finally I'm not sure what the new_game java script file is and whether that's something I need.
    Sorry that I have a lot of questions I'm just really new to this. If you'd like I can upload my mod zip archive for reference.
  14. cascadian

    cascadian Member

    Messages:
    54
    Likes Received:
    93
    Try looking at other mods which add new units, such as aurora artillery or war turtle. Those mods use a much simpler format for adding new units. Basically use a similar mod as a template and change it to suit your needs. Also make sure you use something like this https://jsonformatter.curiousconcept.com/ or the .json format script that is elsewhere on these forms in order to look at pa unit files without going insane.

    to answer your questions though
    - the new_game.js file is used to put units on the build bar
    - stuff just works the way it does, you don't need to understand chemistry to bake a cake. if you are really curious then i would suggest getting a hold of someone like stuart who understands the programing of it all.
    stuart98 and Nicb1 like this.
  15. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    Unit addition mods tend to use some infrastructure put in place by @wondible that was supposed to ultimately make it harder for mod conflicts to break the game. For the most part, that has fallen through, unless and until mikeyh does something with it in the next update he puts out. It's still used because wondible has some handling in there that's necessary for legion to not render all strategic icons as black boxes on old/weak graphics cards. If you're not adding in more than ~30 units, then you don't need to worry about using wondible's infrastructure; it's all in the build.js, unitlist.json, and icon_atlas.js (and the unit.json for the unit you're adding).
    cascadian likes this.
  16. cascadian

    cascadian Member

    Messages:
    54
    Likes Received:
    93
  17. cascadian

    cascadian Member

    Messages:
    54
    Likes Received:
    93
    [​IMG]
    looks like he has the same problem I had XD
  18. cascadian

    cascadian Member

    Messages:
    54
    Likes Received:
    93

    I should mention that to fix this, in 3dsMAX, you would scale the model down, then create a new object such as a cube, put that object at 0,0,0 position and rotation with 100% scale using the transform type in tool under the edit tab at the top. then right click on the object, convert it to an editable polly, and use the attach command to attach your newly rescaled model to the object; everything should now be the same colour. Then you can delete the cube object. The textures are already finished so you don't need to worry about that, but you may have to rig up the bones again. then export the model once more and do the .papa tran thing, and you should be good to go for a second test.
    Nicb1 and themax267 like this.
  19. mikeyh

    mikeyh Post Master General

    Messages:
    1,869
    Likes Received:
    1,509
    Nicb1 likes this.
  20. themax267

    themax267 New Member

    Messages:
    21
    Likes Received:
    15
    Appreciate all of the help, can't wait to get it all polished.
    killerkiwijuice likes this.

Share This Page