View topic - Can a units type be changed vie Lua?



All times are UTC + 1 hour


Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 16 Aug 2011, 21:06 
User avatar

Joined: 20 Aug 2009, 19:49
For example i have two slightly different units and want to toggle the movement class or change the weapons.
So i want to transit from "unitxyz_a" to "unitxyz_b".
Hitpoints etc, should not be changed.

Is something like this already done somewhere?


Top
 Offline Profile  
 
PostPosted: 16 Aug 2011, 21:30 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
change weapons:
give the unit both weapons, allow only one weapon to fire depending on which weapon is chosen. (via unit script)
easiest way to get some toggle button is onoffable=true

change movement:
max speed, turn, acceleration can be changed via simply calling a function:
http://springrts.com/wiki/SetMoveTypeDataExample

toggling the movedef of a unit is not possible though. (cant make a ship into an airplane)
Basically you can only change how a unit moves but not where it can go. See also meh :?

There is a "morph gadget" which basically turns one unit into another unit. In conflict terra and S44 it is used to "deploy" units, maybe that is what you want.


Top
 Offline Profile  
 
PostPosted: 16 Aug 2011, 21:45 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
You will run into issues with unit targeting/behavior if the alt weapon has a shorter rang..


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: Google [Bot] and 0 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.