Page 1 of 1
Broken unit scripts [more issues]
Posted: 03 Mar 2012, 00:14
by zmaster587
Ok, I've looked at a lot of the BA unit scripts and looked at the mod creation tutorial and i cannot figure out why my unit weapon table is broken. As far as I know beam weapons don't have an object name.
spring log extract:
Code: Select all
[f=0000000] WARNING: removed weapons unitDef, missing objectname param
[f=0000000] WARNING: removed weapondefs unitDef, missing objectname param
The script is attached.
Re: Broken unit scripts
Posted: 03 Mar 2012, 01:47
by knorke
The beamlaser weapon should work without objectname, but the unit needs one. Does the unit itself load?
If your 3d files are in s3o then add .s3o like this:
objectName = "simplegravturret.s3o",
(BA does not need it because its models are 3do and that is assumed default.)
Re: Broken unit scripts
Posted: 03 Mar 2012, 02:32
by zmaster587
*facepalm* it is .s3o
thanks
i can now load it
I've just got to fix the UV and allow the weapon to fire
Re: Broken unit scripts [Solved for now]
Posted: 03 Mar 2012, 02:46
by Beherith
Fixing the UV can be as simple as flipping the UV coords in upspring OR in photoshop (vertical flip) if you intend to use .tga (not .dds) textures.
Re: Broken unit scripts [more issues]
Posted: 03 Mar 2012, 03:48
by zmaster587
Thanks for that, but I did figure that bit out.
Now if you're using TGA textures rather than DDS, you'll need one extra step. Click Texture Mapping > Show UV Mapping. It'll show your texture; click Edit > Flip UVs.
Anyway, the unit is loaded with no errors in the console (is there a verbose mode?). However the unit will not fire and the turret will not turn. While I have the constructor selected that builds my unit I get
"[f=0001689] Warning: GetLuaCmdDescList() non "actions" table: pos
[f=0001689] Warning: GetLuaCmdDescList() non "actions" table: params"
printed every frame.
Is there somthing wrong with the animation file (lua, attached) or does spring not support lua animations?
As a side note when the units is selected from the builder menu and when building is complete there is a small hang in spring(parse/file not found error?).
Re: Broken unit scripts [more issues]
Posted: 03 Mar 2012, 04:37
by knorke
if you used BA as a base then unit_script.lua will be missing, is needed for lua unit scripts.
imo get this:
http://springrts.com/wiki/SpringTutorialGame
It should be a better base to start creating something, also has script examples.
While I have the constructor ...
could be some BA widget getting confused by your unit.
As a side note when the units is selected from the builder menu and when building is complete there is a small hang in spring
probally it is loading the texture, try resizing it to smaller.
Re: Broken unit scripts [more issues]
Posted: 03 Mar 2012, 05:16
by zmaster587
Ok, i'l look into it
Re: Broken unit scripts [more issues]
Posted: 05 Mar 2012, 01:34
by Forboding Angel
Use PNG or DDS. Do NOT under any circumstances use tga for unit textures!!!
Re: Broken unit scripts [more issues]
Posted: 05 Mar 2012, 01:37
by Beherith
You can freely use tga as long as you remember to flip the UV's in upspring.