Forged Alliance Forever Forged Alliance Forever Forums 2013-04-05T21:12:46+02:00 /feed.php?f=39&t=3555 2013-04-05T21:12:46+02:00 2013-04-05T21:12:46+02:00 /viewtopic.php?t=3555&p=37102#p37102 <![CDATA[Re: UI Modding question]]> Statistics: Posted by johnie102 — 05 Apr 2013, 21:12


]]>
2013-04-05T19:33:56+02:00 2013-04-05T19:33:56+02:00 /viewtopic.php?t=3555&p=37088#p37088 <![CDATA[Re: UI Modding question]]> Then just F1 -> Change Keybindings.

Statistics: Posted by Zock — 05 Apr 2013, 19:33


]]>
2013-04-05T19:31:07+02:00 2013-04-05T19:31:07+02:00 /viewtopic.php?t=3555&p=37087#p37087 <![CDATA[UI Modding question]]>
I'm trying to create a UI mod where I press a certain key and it selects all the idle engineers currently on screen. I have zero experience modding this game and nil experience with LUA, and this was what I could come up with:

Code:
UISelectionByCategory("ENGINEER", false, true, true, true) -- select the engineer on screen closest to the mouse
Ui_EXpandCurrentSelection() -- select all the engineers on screen
UI_MakeSelectionSet("temp") -- name this selection

local unitlist = {}
for index, unit in selectionSets["temp"] do -- for every engineer...
   if unit:IsIdle() then -- if it is idle....
      table.insert(unitlist,unit) -- save it in a new list
   end
end

AddSelectionSet("temp", unitlist) -- Renew the selection with this new unit list
ApplySelectionSet("temp") -- Make this the active selection

-- SelectUnits(unitlist) Or should I use this function?


Now, my question is: Would this work? And in which function would I have to put it to make it activate by a hotkey? Is there also an easy way to make this hotkey configurable in the controls menu?

Lastly: My first idea was that I could drag a selection box while holding a certain key and that it would then only select the idle engineers, but this seems way harder to do. Any help with this maybe?

Thanks for the help!
-John

BTW: Is this the appropriate forum for this?

Statistics: Posted by johnie102 — 05 Apr 2013, 19:31


]]>