Hello, I was planning on adding in a unit but couldn't get it to appear in the factory. I edited the unitlist.json and added the factorybuild term in the unit type segment but it still doesn't appear, any ideas?
Every factory and fabricator has more than one type that it checks for and setting one unit type will override any others that would've been inherited. That should cover all of it, as i'm sure you've gotten through all the other parts of making sure the unit is complete.
Oh, thanks! I'll give it a try. Edit: Hm.. Still doesn't seem to show up, I gave the .json directory to it but no dice. :/ Edit2: It may be because I put that in as a mod. I went to my server mod folder and then my mod's folder then created a separated area: ui/main/shared/build.js
Can you show the unit .json please? In order for a custom unit to be buildable it needs: A json file with "unit_types" properly set. An entry in the unit_list.json, pointing to the shadowed .json file An entry in the build.js, pointing to the shadowed .json file Optional: Thumbnail in ui/main/game/live_game/img/build_bar/units In the build.js, 15 is not a valid number. In inputmap.js, only hot keys 0-14 are defined per build group. Wrong path for the custom build.js btw, it's supposed to be ui/main/shared/js/build.js, not ui/main/shared/build.js.
Oh, alright, thank you very much! I had seen the numbers and assumed they were some sort of identifier (odd how it starts at five) and also, whoops on the .js part..
Here, you may be able to find out how to do it... If you've got the time I'd apreciate it, it's really late and I'm pretty tired... Also- I can't figure it, if you can, I'd love to hear what I did wrong.
At least one error: You have the hotkey "5" assigned twice now. It's therefor colliding with Adv. vehicle fabber. Oh, and you renamed the folder and unit to "tank_hover", but left the old "hover_tank" in the build.js Unfortunately I can't test it right now, graphics card is broken and had to be shipped in
So what do I change the binding to? Is it possible to make it four? I haven't seen any unit in the build.js with 4 as it's hotkey, they all start with 5.
All values from 0-14 are valid, non most be used twice in the same category. Decide for yourself what you are going to place where.
Still doesn't seem to show... I'm confused. Edit: Also, how do you give it an icon in the files? I can add a .png but how do I actually fit that to the unit?
What unit are you currently trying to add, tank_hover? Then you .json is broken. You forgot to put (") after UNITTYPE_Basic.
Aha! Thank you so much that must be it! Hopefully... It's great having more than one person helping to find bugs in the code.
How are we supposed to debug things like this? Is there a console log of some sort that we can use to easily step through the load process? What about during the game?
I use the instant sandbox mod to make a quick sandbox match, and then just swapped the base_commander.json with the avatar_commander.json by renaming it and placing it in the base_commander file. This means you can build everything, almost instantly. I'll mock up a quick version for you if you'd like.
are you using notepad+? It should notify you of quotes that are missing a close via color. if not, use it, lest you run into daylong problems just because code syntax.
I was using notepad++ and it doesn't seem to show me, though I hadn't actually set it to java script which may be why.
I find it suprising it doesn't warn you of quotes considering any code can be botched with unclosed quotes.
Aha, just as I thought, setting the language to java showed me errors. (Thank god as I was trying to add in another unit but couldn't figure out what was going on, similar problem- only... an extra quote. )