Page 1 of 1

[call-out REQ] SetUnitPosition(y) & SetNoFall

Posted: 28 Sep 2007, 02:43
by Felix the Cat
Two related requests.

1) Allow us to specify the unit's y-position in addition to x and z.

2) Allow us to somehow instruct Spring not to make a unit in midair fall toward the ground. This may be more of an engine request than a Lua call-in one. If there's already a way to do this that's not simply setting a unit's y-physics to 0 every frame, let me know.

[edited for proper title]

Re: [call-in REQ] SetUnitPosition(y) & SetNoFall

Posted: 28 Sep 2007, 02:48
by jK
Spring.MoveCtrl fulfills all your requests.

Atm there is no wiki for it, so you have to look it up in the source

Re: [call-in REQ] SetUnitPosition(y) & SetNoFall

Posted: 28 Sep 2007, 03:38
by Felix the Cat
jK wrote:Spring.MoveCtrl fulfills all your requests.

Atm there is no wiki for it, so you have to look it up in the source
Thanks for the quick answer! I'll be looking that up.

Posted: 28 Sep 2007, 09:38
by Zpock
Example code:

Code: Select all

			Spring.MoveCtrl.Enable(unitID)
    		Spring.MoveCtrl.SetGravity(unitID, 0)
    		Spring.MoveCtrl.SetPosition(unitID,x,y,z)
There's tons of other MoveCtrl functions as well, tough their a bit hard to figure out sometimes.

Posted: 28 Sep 2007, 16:49
by jK

Posted: 29 Sep 2007, 02:32
by Felix the Cat
Awesome! Thanks again for the assistance.

Do units still behave normally when under MoveCtrl (fire at enemies etc.)?

Posted: 29 Sep 2007, 09:09
by Archangel of Death
And what happens when you give a unit negative gravity? :twisted: