- Joined
- Sep 26, 2009
- Messages
- 9,534
An idea came to me yesterday, as I was in the process of bringing some of my vJass Spell System demo spells over to the Spell Event I'm making for Lua: create GUI functions using the GUI "Player Group" API (of course not actually using real player groups), instead of needing separate GUI triggers for different branches of functionality. This allows every component of a spell to exist within a single GUI trigger.
This requires Global Variable Remapper, as it is, after all, the future of GUI:
Then, in GUI, it would look like:
Edit 20.09.2022: This now exists as [Lua] - Action (The future of GUI actions)
This requires Global Variable Remapper, as it is, after all, the future of GUI:
Lua:
OnLibraryInit("GlobalRemap", function()
local inUse, oldFF
--udg_ExampleFunc is a Player Group in GUI:
GlobalRemap("udg_ExampleFunc", function() inUse=true end)
oldFF = AddHook("ForForce", function(whichForce, whichFunc)
if inUse then
inUse=false
--Do stuff with the user's function (e.g. start a new coroutine, cache it for an "onMissileImpact" type of event)
else
oldFF(whichForce, whichFunc)
end
end)
end)
Then, in GUI, it would look like:
-
ExampleTrigger
-
Events
-
Conditions
-
Actions
-
Player Group - Pick all players in ExampleFunc and do Actions
-
Loop - Actions
-
-------- Do stuff --------
-
-
-
-
Edit 20.09.2022: This now exists as [Lua] - Action (The future of GUI actions)
Last edited: