So after looking into it, GUI Unit Event comes with a Unit Indexer built into it, so you really only need this "one system".
All you have to do is copy and paste the
Unit Event folder into your map.
View attachment 473379
After that, the system will automatically run in the background when your game starts.
Two important rules:
1) This system won't become fully active until AFTER Map Initialization, but there's a good chance that you don't have to worry about that.
2) You must never use this Action yourself:
-
Unit - Set the custom value of (Triggering unit) to 0
^ The Unit Indexer assigns custom values to units automatically, if you adjust it yourself you will break the system.
The next step is to learn how to use the Unit Indexer and GUI Unit Event system. Fortunately, both of these systems have demo maps, extensive documentation, and a million examples on Hive. But I'll give you a demonstration pertaining to the triggers I posted earlier:
-
Track Tome Bonus Damage NEW
-

Events
-


Unit - A unit Acquires an item
-

Conditions
-


(Item-type of (Item being manipulated)) Equal to Tome of Prowess
-

Actions
-


Set Variable CV = (Custom value of (Triggering unit))
-


Set Variable Hero_Prowess_Count[CV] = (Hero_Prowess_Count[CV] + 1)
-
Bear Form Is Used NEW
-

Events
-


Unit - A unit Is issued an order with no target
-

Conditions
-


(Issued order) Equal to (Order(bearform))
-

Actions
-


Wait 0.20 seconds of game-time
-


Trigger - Turn off Track Tome Bonus Damage <gen>
-


Set Variable CV = (Custom value of (Triggering unit))
-


For each integer (Integer A) from 1 to Hero_Prowess_Count[CV] do (Actions)
-



Loop - Actions
-




Item - Create Tome of Prowess and give it to (Triggering unit)
-


Trigger - Turn on Track Tome Bonus Damage <gen>
These two triggers have been modified to use the Unit Indexer instead of relying on the Player Number. This allows us to save data directly to our Unit whenever it uses a tome as well as load that saved data whenever it morphs. Notice how this method relies on the unit's Custom Value as the [index] in our Array. This is a unique Integer value that the Unit Indexer assigns to each Unit upon creation. The system is basically giving each of our Units their own unique ID number.
This is similar to how each Player has their own unique Player Number (Red = 1, Blue = 2, Teal = 3). This system simply expands that concept to Units by giving each of them their own unique number in the form of a Custom Value. So by taking advantage of this you can use Array variables to attach data to a specific
Unit or
Player by using their
(custom value) or
(player number) as the [
index] in your Array.
Then by using the
GUI Unit Event system we can
replace the above
Bear Form Is Used trigger with this:
-
On Transform
-

Events
-


Game - UnitTypeEvent becomes Equal to 1.00
-

Conditions
-

Actions
-


Trigger - Turn off Track Tome Bonus Damage <gen>
-


For each integer (Integer A) from 1 to Hero_Prowess_Count[UDex] do (Actions)
-



Loop - Actions
-




Item - Create Tome of Prowess and give it to UDexUnits[UDex]
-


Trigger - Turn on Track Tome Bonus Damage <gen>
This is a custom Event that runs whenever a unit is finished morphing/transforming. This removes the need for the inconsistent Wait action and the Condition from before. The
UDex variables are a way for you to reference the Unit and it's Custom Value, think of them like a custom version of
(Triggering unit).
Note that I never actually tested any of these triggers but I believe they will work, and if not, I believe they can be made to work with some slight tweaks.