is there a way to change the default right click command?

is there a way to change the default right click command?

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

Moderator: Moderators

Post Reply
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

is there a way to change the default right click command?

Post by BigHead »

I want builders to use my custom UpgradeMex command as right click command for metal extractors. Right now I use a little hack which uses widget:MousePress and GiveOrderToUnit to do it. Is there a better way to do it?
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

The related call-in that's been added to SVN:

DefaultCommand(<type>, <data>) -> false | number cmdID

type = string 'unit', data = number unitID
type = string 'feature', data = number featureID
type = nil, data = nil

This call-in works in LuaUI, LuaCob, and LuaRules.
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

thank you very much trepan
Post Reply

Return to “Lua Scripts”