Rotate buildings script?

Rotate buildings script?

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

Moderator: Moderators

Post Reply
udm
Posts: 47
Joined: 24 Jan 2007, 01:38

Rotate buildings script?

Post by udm »

Hi, I wonder if it's possible to rotate buildings using LUA? Or is anyone currently making it possible? Thanks
User avatar
Blah64
Posts: 31
Joined: 09 Jul 2006, 04:02

Post by Blah64 »

it is possible to rotate buildings, press '[' or ']' buttons
User avatar
anterak
Posts: 67
Joined: 22 Jul 2007, 12:07

Post by anterak »

do you know the bind command to do this ?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

I rotate factories with COB. But the yardmap doesn't follow :?



As for the bind commands:

From default uikeys.txt

Code: Select all

bind                  [  buildfacing inc
bind            Shift+[  buildfacing inc
bind                  ]  buildfacing dec
bind            Shift+]  buildfacing dec
From some mysterious hidden secret:

Code: Select all

bind            numpad2  buildfacing  south
bind            numpad4  buildfacing  west
bind            numpad6  buildfacing  east
bind            numpad8  buildfacing  north
Uhm, none of this is Lua, I'm irrelevant again.
User avatar
anterak
Posts: 67
Joined: 22 Jul 2007, 12:07

Post by anterak »

thanks
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

zwzsg wrote:I rotate factories with COB. But the yardmap doesn't follow :?
Even with set HEADING?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

Yes, even with set HEADING, in 75b2.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Can't Lua do something? If you could just tell Lineage mode to reparent the lineage to a new unit you could replace the com with one that faces wherever you want...
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Post by REVENGE »

Just curious, why can't rotated yardmaps be autogen from the default one facing south?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

They are if you turn the thing before placing it but Zw is talking about the Kernel Panic commanders which are placed automatically by the engine.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

Currently in Kernel Panic they do the "set HEADING", it doesn't turn the yardmap, but it turns the default exit waypoint (I prefer that to assigning a waypoint in a LUA widget). Strangely, the model turned, but not the buildpad. Had to make the script turn the buildpad piece again. Since the yardmap doesn't turn, the hole only turn 180°, while the kernel turns each 90°.

Last time we talked about turning building in Lua, Trepan seemed to say turning yardmaps in Lua wouldn't be that easy, so I didn't even try.

But, at least for Kernel Panic, turning the yardmap isn't as a priority as writing a better script to determine which cardinal point to turn, as currently it only takes into account the position relatively to other units, and it would be more helpful if it took into account the nearby slopes (which I can with just bos, I just need to decide which way do I do it and start typing it).
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Post by REVENGE »

Wasn't there a time when each directional yardmap had to be premade and placed in the map file?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Perhaps you could just lua a rotate button so when a user is unhappy with the rotation he ended up with he can change it?
Post Reply

Return to “Lua Scripts”