Broken unit scripts [more issues]

Broken unit scripts [more issues]

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
zmaster587
Posts: 6
Joined: 13 Feb 2012, 23:09

Broken unit scripts [more issues]

Post 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.
Attachments
smGravGun.lua
the unit lua script from
/units
(2.67 KiB) Downloaded 118 times
Last edited by zmaster587 on 03 Mar 2012, 03:41, edited 2 times in total.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Broken unit scripts

Post 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.)
zmaster587
Posts: 6
Joined: 13 Feb 2012, 23:09

Re: Broken unit scripts

Post by zmaster587 »

*facepalm* it is .s3o :oops:

thanks

i can now load it :-)

I've just got to fix the UV and allow the weapon to fire
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Broken unit scripts [Solved for now]

Post 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.
zmaster587
Posts: 6
Joined: 13 Feb 2012, 23:09

Re: Broken unit scripts [more issues]

Post 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?).
Attachments
simpleGrav.lua
.Lua
(1014 Bytes) Downloaded 63 times
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Broken unit scripts [more issues]

Post 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.
zmaster587
Posts: 6
Joined: 13 Feb 2012, 23:09

Re: Broken unit scripts [more issues]

Post by zmaster587 »

Ok, i'l look into it
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Broken unit scripts [more issues]

Post by Forboding Angel »

Use PNG or DDS. Do NOT under any circumstances use tga for unit textures!!!
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Broken unit scripts [more issues]

Post by Beherith »

You can freely use tga as long as you remember to flip the UV's in upspring.
Post Reply

Return to “Game Development”