[REQz] Turn in direction widget

[REQz] Turn in direction widget

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

Moderator: Moderators

Post Reply
SpikedHelmet
MC: Legacy & Spring 1944 Developer
Posts: 1948
Joined: 21 Sep 2004, 08:25

[REQz] Turn in direction widget

Post by SpikedHelmet »

Hi,

Would be cool for a widget that tells units which way to face. This may be important in some mods (especially ours).

I thought about execution, and I figured the simplest way to do this would be: Select unit; Right-click on unit and drag in direction you want it to face, creating a small UI line in that direction; unit faces that direction (turning on spot) without moving! This can either be directional or based on where your mouse actually is. The latter is probably better when trying to set directions on multiple units -- they will face your mouse rather than the direction?
SpikedHelmet
MC: Legacy & Spring 1944 Developer
Posts: 1948
Joined: 21 Sep 2004, 08:25

Re: [REQz] Turn in direction widget

Post by SpikedHelmet »

yes.
User avatar
Adonai_Jr
Posts: 11
Joined: 26 Nov 2008, 14:04

Re: [REQz] Turn in direction widget

Post by Adonai_Jr »

I support this ideia. But im too noob on Lua coding to do it. :)
User avatar
TheFatController
Balanced Annihilation Developer
Posts: 1177
Joined: 10 Dec 2006, 18:46

Re: [REQz] Turn in direction widget

Post by TheFatController »

Hmm, is there a way to turn a unit without issuing an order such as move/attack?

I'm not aware of one and it would be useful if there was one.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: [REQz] Turn in direction widget

Post by Pxtl »

Should there be? I mean, at the Lua UI level, not the gadget level.

I could see including various fine-grain movement controls for synched code. Then the modder could write a gadget that exposes the API if you choose to. Otherwise, it would be unfair to have a bunch of "hidden" Lua actions that players cannot utilize without a Widget.

But yes, fine-grain controls of rotation, acceleration/deceleration etc. would be nice.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: [REQz] Turn in direction widget

Post by lurker »

Make the command, and bind it to dragging out a movement arrow.
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Re: [REQz] Turn in direction widget

Post by yuritch »

Turning units is possible from COB side (set HEADING, etc). The cob just has no way of user specifying the direction (except 'fake weapon' hacks), that should be lua's job. Then a simple lua->cob call that tells the unit to turn to specified heading, and it's done (of course if the unit in question has cob support for that). Since 'turn here' function seems to be mod-specific (not much use for it in *A for ex., and most any mod that doesn't have directional armor and lots of restricted-arc weapons), the code should also be included in mods that need it.
Post Reply

Return to “Lua Scripts”