changing movement of units

changing movement of units

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
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

changing movement of units

Post 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
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: changing movement of units

Post 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
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: changing movement of units

Post 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.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: changing movement of units

Post by knorke »

transports it is!
will probally turn out pretty meh but lets see.
Post Reply

Return to “Game Development”