Page 1 of 1

changing movement of units

Posted: 07 Jul 2011, 23:53
by knorke
http://springrts.com/wiki/Lua_MoveCtrl# ... ontrolling
Basically this only allows to controll turning, acceleration and max speed.

I wanted to make a powerup that gives units the the ability to cross water.

So I did this:
Spring.MoveCtrl.SetGroundMoveTypeData (unitID, "floatOnWater", true)
But it does not work, the unit still can no enter deep water. It also still tilts with the sea ground. (yes, can be changed with upright=true or something)
The only thing that changes is that in shallow water the unit gets lifted up to the waterplane.
Not really what I expected from "floatOnWater" :?
Image
flower pot -> floatOnWater=true
notice the tank in front without flower is sunk into the water but that is the only difference it makes.


Is that possible at all to change where a unit can go? (also regarding climbing ability)
Beside workarounds like unit swapping/morphing or

Code: Select all

if (unitPosition.y < 0 and not hasWalkOnWaterUpgrade) then moveToPreviousPosition

Re: changing movement of units

Posted: 07 Jul 2011, 23:58
by smoth
I hate to make this statement but as it is now the change from one class to another has always been done by quick switching of units

Re: changing movement of units

Posted: 07 Jul 2011, 23:59
by FLOZi
It's the only way currently, unless you fancy using movectrl and writing your own pathfinder.

edit: Or do naughty things with transports.

Re: changing movement of units

Posted: 08 Jul 2011, 00:05
by knorke
transports it is!
will probally turn out pretty meh but lets see.