View topic - Broken unit scripts [more issues]



All times are UTC + 1 hour


Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: 03 Mar 2012, 00:14 

Joined: 13 Feb 2012, 23:09
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:
[f=0000000] WARNING: removed weapons unitDef, missing objectname param
[f=0000000] WARNING: removed weapondefs unitDef, missing objectname param


The script is attached.


Attachments:
File comment: the unit lua script from
/units

smGravGun.lua [2.67 KiB]
Downloaded 97 times


Last edited by zmaster587 on 03 Mar 2012, 03:41, edited 2 times in total.
Top
 Offline Profile  
 
 Post subject: Re: Broken unit scripts
PostPosted: 03 Mar 2012, 01:47 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
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.)


Top
 Offline Profile  
 
 Post subject: Re: Broken unit scripts
PostPosted: 03 Mar 2012, 02:32 

Joined: 13 Feb 2012, 23:09
*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


Top
 Offline Profile  
 
PostPosted: 03 Mar 2012, 02:46 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
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.


Top
 Offline Profile  
 
PostPosted: 03 Mar 2012, 03:48 

Joined: 13 Feb 2012, 23:09
Thanks for that, but I did figure that bit out.

Quote:
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
Quote:
"[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:
File comment: .Lua
simpleGrav.lua [1014 Bytes]
Downloaded 58 times
Top
 Offline Profile  
 
PostPosted: 03 Mar 2012, 04:37 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
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.

Quote:
While I have the constructor ...
could be some BA widget getting confused by your unit.

Quote:
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.


Top
 Offline Profile  
 
PostPosted: 03 Mar 2012, 05:16 

Joined: 13 Feb 2012, 23:09
Ok, i'l look into it


Top
 Offline Profile  
 
PostPosted: 05 Mar 2012, 01:34 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring on 04/24/12
Use PNG or DDS. Do NOT under any circumstances use tga for unit textures!!!


Top
 Offline Profile  
 
PostPosted: 05 Mar 2012, 01:37 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
You can freely use tga as long as you remember to flip the UV's in upspring.


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.