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

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

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
Felix the Cat
Posts: 2383
Joined: 15 Jun 2005, 17:30

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

Post 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]
Last edited by Felix the Cat on 28 Sep 2007, 03:34, edited 1 time in total.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

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

Post 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
User avatar
Felix the Cat
Posts: 2383
Joined: 15 Jun 2005, 17:30

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

Post 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.
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

Post 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.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Post by jK »

User avatar
Felix the Cat
Posts: 2383
Joined: 15 Jun 2005, 17:30

Post by Felix the Cat »

Awesome! Thanks again for the assistance.

Do units still behave normally when under MoveCtrl (fire at enemies etc.)?
Archangel of Death
Posts: 854
Joined: 28 Jan 2005, 18:15

Post by Archangel of Death »

And what happens when you give a unit negative gravity? :twisted:
Post Reply

Return to “Lua Scripts”