Page 1 of 1
Dual Movement System
Posted: 01 Jul 2014, 16:50
by Emyfour
Hi there. Happy holidays.
I'm wondering: is it possible to script a unit with a dual movement system?
I mean, something which can move in a way, with legs for example, while fighting, and in another way, with wheels maybe, while airily running around.
... Do you remember Star Wars' Droidekas?
While happily shooting enemies, they slowly walk on their legs, but if they need a quick sprint, they can fold and roll.
... It would be nice if the unit alone could understand when to shoot and when to move, but it will be okay even if it actually requires a manual switch.
Thanks in advance

Re: Dual Movement System
Posted: 01 Jul 2014, 17:31
by Silentwings
As far as I know, that would be possible.
Re: Dual Movement System
Posted: 01 Jul 2014, 17:32
by FLOZi
Imperial Winter has the droideka, so yes. It is possible.
(Ok, currently droideka is broked due to max wanted spede changes but if it were rewritten in lua it'd be fine)
Re: Dual Movement System
Posted: 01 Jul 2014, 17:59
by smoth
It has nothing to do with movement systems this example is a matter of changing the animation and speed of a unit. That is all.
Re: Dual Movement System
Posted: 01 Jul 2014, 18:19
by PicassoCT
whats not really possible is pulsating movement.. meaning the units speed actually beeing of a non-linear type
Re: Dual Movement System
Posted: 01 Jul 2014, 19:00
by Anarchid
Visually, you can get that with animation, too.
Re: Dual Movement System
Posted: 01 Jul 2014, 19:40
by KDR_11k
Or if you're crazy Lua it, take the pathing results for the unit and instead of letting it move normally teleport it along the path via Lua.
Re: Dual Movement System
Posted: 01 Jul 2014, 20:26
by dansan
Isn't that what pelikan in BA does (walks on land, swims in sea)?
Re: Dual Movement System
Posted: 01 Jul 2014, 22:37
by PicassoCT
Anarchid wrote:Visually, you can get that with animation, too.
Example? One that doesent have a "sliding and moonwalking" over the floor moment? Show me a mecha that walks a step and perfectly stands still for a split second.
Re: Dual Movement System
Posted: 02 Jul 2014, 06:51
by smoth
PicassoCT wrote:Anarchid wrote:Visually, you can get that with animation, too.
Example? One that doesent have a "sliding and moonwalking" over the floor moment? Show me a mecha that walks a step and perfectly stands still for a split second.
your animation would need to time it's self to the actual speed. Not many have done that. I mean I have but not everyone has.
you would need to write code to the speed adjustments. what game actually does this and doesn't do it via smoke and mirrors?
the sliding you speak of is part of the braking code for units, raise your break rate if you don't want units sliding while stoping.
Re: Dual Movement System
Posted: 02 Jul 2014, 11:01
by Emyfour
smoth wrote:It has nothing to do with movement systems this example is a matter of changing the animation and speed of a unit. That is all.
Uhm... you're right
But, can I explain to the unit that it can't Fight if its speed is higher than a value? That is, if it's "running" and not "walking"?

Re: Dual Movement System
Posted: 02 Jul 2014, 12:05
by Anarchid
Can't Fight (order, command type), or can't Shoot (action fully controllable by animation system)?
Former is possible and will require a gadget.
Latter is possible and requires you to implement BlockShot (or similar) callin in your animation script.
Re: Dual Movement System
Posted: 02 Jul 2014, 13:27
by PicassoCT
Emyfour wrote:smoth wrote:It has nothing to do with movement systems this example is a matter of changing the animation and speed of a unit. That is all.
Uhm... you're right
But, can I explain to the unit that it can't Fight if its speed is higher than a value? That is, if it's "running" and not "walking"?

oh that one is easy..
you basically set a value to one or zero in the aiming task and the unit will not be able to aim while beeing fast - thus not be able to fire...
Re: Dual Movement System
Posted: 02 Jul 2014, 13:51
by knorke
Possible and similiar stuff was done. Example would be the "sprint gadget" that used to be in Complete Annihilation (and then some other mods) that allowed units to get a temporary speed-boost, similiar to the stim-packs of Starcraft.These spiders walk when their next waypoint is near but if the next waypoint is far away then they prefer to dig under the ground:
https://www.youtube.com/watch?v=3ujUFqw398Y Sorry, do not have links to either handy atm.
But
http://springrts.com/wiki/SetMoveTypeDataExample is an example that shows both how to alter a unit's movement as well as how to add "manual switch" buttons.
PicassoCT wrote:whats not really possible is pulsating movement.. meaning the units speed actually beeing of a non-linear type
not sure what excactly you mean but something like this works for Ba-Bop-Ba-Dop-Bop:
Code: Select all
while (true) do
Spring.MoveCtrl.SetGroundMoveTypeData(unitID, "maxSpeed", 0)
Sleep (1000)
Spring.MoveCtrl.SetGroundMoveTypeData(unitID, "maxSpeed", 50)
Sleep (1000)
end
This way it is possible to make movement like
https://www.youtube.com/watch?v=_I_MaU9H5sI ,without having to re-do the whole movement-physics via movectrl.
Re: Dual Movement System
Posted: 02 Jul 2014, 17:02
by smoth
Emyfour wrote:smoth wrote:It has nothing to do with movement systems this example is a matter of changing the animation and speed of a unit. That is all.
Uhm... you're right
But, can I explain to the unit that it can't Fight if its speed is higher than a value? That is, if it's "running" and not "walking"?

Yes you can. :)