Planetary Annihilation: TITANS

Planetary Annihilation: TITANS

View Stats:
[Resolved] Putting a custom unit onto the buildbar
I've tried to search around for help on how to add a custom unit onto the buildbar, but everywhere I've searched seems to run into a dead end. I've tried using hodgepodge, but the system it uses to organize units on the buildbar is confusing to me. If anyone has advice on how to use this framework or knows a better framework out there, please let me know, as I've been struggling for days on how to get this unit onto the buildbar. Thanks in advance.
Last edited by immortal man; Dec 5, 2017 @ 11:54pm
< >
Showing 1-3 of 3 comments
Lula Mae Dec 4, 2017 @ 6:14pm 
Talk to the OP of this thread. He's done a lot of that for his 'Planetary Obliteration' mod

https://forums.uberent.com/threads/wip-server-planetary-obliteration.71781/
| Stuart98 || Dec 5, 2017 @ 11:50am 
Hodgepodge is unnecessary, it was meant to allow for compatibility between unit adding mods but it never achieved that goal because one unit mod has to overwrite unit_list.json, which means that running multiple unit mods simultaneously is impossible without manual editing of the unit_list.json.

To add a unit to a build bar, package /ui/main/shared/js/build.js with your mod. Then add the unit to the file. The specific line to add should look like this:

"/pa/units/land/titan_structure/titan_structure.json": ["utility", 0],

The first part is the path to the unit.json file. It should be the exact same path you used for it in the unit_list.json. The second part, "utility", refers to a build bar tab. The game will accept anything, but hotkeys will break if you don't use "utility", "factory", "combat", "vehicle", "bot", "air", "sea", "orbital_structure", "orbital", or "ammo". The last number refers to build bar position. They are arranged left to right, top to bottom, so that 0 is used for the top-left most position, 5 for the top-right most position, 6 for the middle-left position, 11 for the middle-right position, 12 for the bottom-left most position, and 17 for the bottom-right most position. Be sure that you don't put the same number for your unit as a pre-existing unit in the tab, otherwise you will have rendered one unit or the other unbuildable. Also note that numbers 5, 11, and 17 are disabled for structures; assigning structures to these build bar numbers will render them unbuildable without further modifications to game files.
immortal man Dec 5, 2017 @ 11:51pm 
Originally posted by | Stuart98 ||:
Hodgepodge is unnecessary, it was meant to allow for compatibility between unit adding mods but it never achieved that goal because one unit mod has to overwrite unit_list.json, which means that running multiple unit mods simultaneously is impossible without manual editing of the unit_list.json.

To add a unit to a build bar, package /ui/main/shared/js/build.js with your mod. Then add the unit to the file. The specific line to add should look like this:

"/pa/units/land/titan_structure/titan_structure.json": ["utility", 0],

The first part is the path to the unit.json file. It should be the exact same path you used for it in the unit_list.json. The second part, "utility", refers to a build bar tab. The game will accept anything, but hotkeys will break if you don't use "utility", "factory", "combat", "vehicle", "bot", "air", "sea", "orbital_structure", "orbital", or "ammo". The last number refers to build bar position. They are arranged left to right, top to bottom, so that 0 is used for the top-left most position, 5 for the top-right most position, 6 for the middle-left position, 11 for the middle-right position, 12 for the bottom-left most position, and 17 for the bottom-right most position. Be sure that you don't put the same number for your unit as a pre-existing unit in the tab, otherwise you will have rendered one unit or the other unbuildable. Also note that numbers 5, 11, and 17 are disabled for structures; assigning structures to these build bar numbers will render them unbuildable without further modifications to game files.

Thanks man, I vastly appreciate your help.
Last edited by immortal man; Dec 5, 2017 @ 11:53pm
< >
Showing 1-3 of 3 comments
Per page: 1530 50

Date Posted: Dec 4, 2017 @ 2:54pm
Posts: 3