Hey there, I just recently got into Balanced Annihilation and the Spring Engine in general, and I'm wondering if it's possible to add units to BA. Right now I'm trying to create a super builder plane which is just a copy of the Arm tech 1 Air Constructor.
I copied the armca.lua file and made a duplicate called armcacheat.lua, and changed any references to armca to armcacheat in the file. I then added armcacheat to the build options of the Arm tech 1 Air Factory but it's not showing up in game. What else do I have to do to make a new unit appear in game?
Thanks in advance!
Adding Units
Moderator: Content Developer
- MasterBel2
- Posts: 347
- Joined: 11 Apr 2016, 12:03
Re: Adding Units
So I'm assuming:
You have copied the source code for the latest balanced annihilation version
The code has been placed in the spring/games directory in the correct structure (aka as downloaded) and the folder enclosing everything is named <gamename>.sdd
You're sure that you're running your game and not BA proper
I haven't done too much dev'ment myself, but it's fun and rewarding. So keep on. I've given you all I've got, apart from one reccomendation:
Join the #badev and #moddev channels on the spring server. For Spring Lobby it should be as easy as typing /join <channame> to the official server. There will be devs there that can help you out.
Welcome to the Spring community! Have fun!
You have copied the source code for the latest balanced annihilation version
The code has been placed in the spring/games directory in the correct structure (aka as downloaded) and the folder enclosing everything is named <gamename>.sdd
You're sure that you're running your game and not BA proper
I haven't done too much dev'ment myself, but it's fun and rewarding. So keep on. I've given you all I've got, apart from one reccomendation:
Join the #badev and #moddev channels on the spring server. For Spring Lobby it should be as easy as typing /join <channame> to the official server. There will be devs there that can help you out.
Welcome to the Spring community! Have fun!
Re: Adding Units
Hey thanks for the welcome and the pointers! I appreciate it. I have been modifying the files within the SDZ file, rather than have the whole thing extracted in the game folder, will that affect how it works? The changes I made definitely had impact, as at times neither the original constructor or the modded one showed up in the build menu or the game.
Thanks again!
Thanks again!
- MasterBel2
- Posts: 347
- Joined: 11 Apr 2016, 12:03
Re: Adding Units
Devs use the SDD format beccause it's a lot easier to browse the source, and to edit etc. All I can think of is that you might have not put a reference into the file for the airlab - as in the buildlist. Did you change the numbers etc? Probably have if it sometimes shows up. I'm not sure how else to help.
Re: Adding Units
I did add the cheat unit to the build menu as well, looks something like this;
buildoptions = {
[1] = "armca",
[2] = "armpeep",
[3] = "armfig",
[4] = "armthund",
[5] = "armatlas",
[6] = "armkam",
[7] = "armcacheat",
},
All other units still show up fine, just not this one. the lua file is definitely named "armcacheat" and all references inside the file are named the same.
buildoptions = {
[1] = "armca",
[2] = "armpeep",
[3] = "armfig",
[4] = "armthund",
[5] = "armatlas",
[6] = "armkam",
[7] = "armcacheat",
},
All other units still show up fine, just not this one. the lua file is definitely named "armcacheat" and all references inside the file are named the same.
Re: Adding Units
Check infolog.txt for any related error.
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: Adding Units
You'll also need to tell your lua unitdef file where to find a model and a script for the unit (it typically doesn't appear as a tag in the unitdef file because BA relies on common filenames within different dirs to associate them - this link breaks silently when you copy/paste/rename a unitdef file).What else do I have to do to make a new unit appear in game?
https://springrts.com/wiki/Gamedev:UnitDefs#General, objectName and script.
There may be other errors too - attaching an infolog is basically a must have if you want others to help you debug. https://springrts.com/wiki/Infolog.txt
If all you want to do is cheat and make it quick/easy to build stuff, just type '/cheat' and then '/nocost'.