Hello,
I have made a trigger like this. Simple enough, loads the correct units and their positions and prints their name and so on.
Easy enough? Yes easy!
Now the issue is that I have made a simple level up system for normal units which works as follows: Whenever a unit enters a region we get the unitID and increase its number by one and save it into a hashtable. When we reach 3 units for example we kill and remove all of the units and create one 2 star version of the unit. Trigger below.
The actual problem is that when I load the units from the unitgroup all the 2* and 3* units are ofcourse created back as a normal unit. I tried like this:
In the OE I made a 2 skills for 2* units and 3* units if that route would be easier, but I am unsure if the level of ability integer boolean works for dead units?
And yes we need to do this so we can recreate the stats for upgraded units like in the starup system. And on a site note this is still missing the wavemanagment triggers since it's currently a test trigger.
I have made a trigger like this. Simple enough, loads the correct units and their positions and prints their name and so on.
Easy enough? Yes easy!
-
Save Units on Wave
-
Events
-
Player - Player 1 (Red) types a chat message containing go as An exact match
-
-
Conditions
-
Actions
-
Set VariableSet SaveGroup[1] = (Units in Player1SpawnUnit <gen> owned by Player 1 (Red))
-
Unit Group - Pick every unit in SaveGroup[1] and do (Actions)
-
Loop - Actions
-
-------- Save --------
-
Set VariableSet SaveGroupUnit = (Picked unit)
-
Set VariableSet SaveGroup_CV = (Custom value of SaveGroupUnit)
-
Set VariableSet SaveGroupUnitPoint[SaveGroup_CV] = (Position of SaveGroupUnit)
-
Game - Display to Player Group - Player 1 (Red) for 15.00 seconds the text: (Name of SaveGroupUnit)
-
-
-
Unit Group - Pick every unit in (Units in Player1SpawnUnit <gen>) and do (Actions)
-
Loop - Actions
-
Unit - Change ownership of (Picked unit) to Player 5 (Yellow) and Retain color
-
-
-
Unit Group - Pick every unit in (Units in Player1EnemySpawn <gen>) and do (Actions)
-
Loop - Actions
-
Unit - Order (Picked unit) to Attack-Move To (Center of Player1SpawnUnit <gen>)
-
-
-
Wait 1.00 seconds
-
Set VariableSet KillGroup = (Units owned by Player 5 (Yellow).)
-
Unit Group - Pick every unit in KillGroup and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is alive) Equal to True
-
-
Then - Actions
-
Unit - Kill (Picked unit)
-
-
Else - Actions
-
-
-
-
Custom script: call DestroyGroup (udg_KillGroup)
-
Unit Group - Pick every unit in SaveGroup[1] and do (Actions)
-
Loop - Actions
-
-------- Load --------
-
Set VariableSet SaveGroupUnit = (Picked unit)
-
Set VariableSet SaveGroup_CV = (Custom value of SaveGroupUnit)
-
Game - Display to Player Group - Player 1 (Red) for 15.00 seconds the text: (Name of SaveGroupUnit)
-
Unit - Create 1 (Unit-type of SaveGroupUnit) for Player 1 (Red) at SaveGroupUnitPoint[SaveGroup_CV] facing Default building facing degrees
-
Custom script: call RemoveLocation(udg_SaveGroupUnitPoint[udg_SaveGroup_CV])
-
-
-
Custom script: call DestroyGroup (udg_SaveGroup[1])
-
-
Now the issue is that I have made a simple level up system for normal units which works as follows: Whenever a unit enters a region we get the unitID and increase its number by one and save it into a hashtable. When we reach 3 units for example we kill and remove all of the units and create one 2 star version of the unit. Trigger below.
-
Star Up System
-
Events
-
Unit - A unit enters UnitSpawnPoint <gen>
-
-
Conditions
-
Actions
-
-------- SET UP PLAYER AND UNIT ID --------
-
Set VariableSet TempPlayer = (Player number of (Owner of (Triggering unit)))
-
Set VariableSet TempUnitType = (Unit-type of (Triggering unit))
-
-------- CONVER UNIT ID TO INTEGER --------
-
Custom script: set udg_TempInteger = udg_TempUnitType
-
-------- SAVE HASHTABLE --------
-
Custom script: set udg_Count = LoadInteger(udg_StarUpHash, udg_TempPlayer, udg_TempUnitType) + 1
-
Custom script: call SaveInteger(udg_StarUpHash, udg_TempPlayer, udg_TempUnitType, udg_Count)
-
-------- DEBUG MESSAGE --------
-
Game - Display to (Player group((Owner of (Triggering unit)))) for 10.00 seconds the text: (Saved Unit Type + ((String(TempInteger)) + ( + (Name of (Player(TempPlayer))))))
-
Game - Display to (All players) the text: (String(Count))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Count Equal to 3
-
-
Then - Actions
-
Set VariableSet TempGroup = (Units owned by (Player(TempPlayer)) of type TempUnitType)
-
Unit Group - Pick every unit in TempGroup and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is alive) Equal to True
-
-
Then - Actions
-
Unit - Kill (Picked unit)
-
Unit - Remove (Picked unit) from the game
-
-
Else - Actions
-
-
-
-
Unit - Create 1 TempUnitType for (Player(TempPlayer)) at (Center of UnitSpawnPoint <gen>) facing Default building facing degrees
-
Set VariableSet TempUnit = (Last created unit)
-
-------- --------------------------------- --------
-
Unit - Add Two Starred (Check unit level) to TempUnit
-
Animation - Change TempUnit's vertex coloring to (75.00%, 75.00%, 100.00%) with 0.00% transparency
-
Animation - Change TempUnit's size to (115.00%, 115.00%, 115.00%) of its original size
-
-------- --------------------------------- --------
-
Unit - Set Name of TempUnit to ((Name of TempUnit) + **)
-
Unit - Set Max HP of TempUnit to ((Max HP of TempUnit) + ((Max HP of TempUnit) / 2))
-
Unit - Remove Sell Unit from TempUnit
-
-------- --------------------------------- --------
-
Unit - Set Armor of TempUnit to ((Armor of TempUnit) + 2.00)
-
Unit - Set life of TempUnit to 100.00%
-
Unit - Set Base Damage of TempUnit to ((Base Damage of TempUnit for weapon index (1 - 1)) + ((Base Damage of TempUnit for weapon index (1 - 1)) / 2)) for weapon index: (1 - 1)
-
Game - Display to (All players) the text: ((Name of (Player(TempPlayer))) + ( has gained a + (Name of TempUnit)))
-
Custom script: call DestroyGroup (udg_TempGroup)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Count Equal to 6
-
-
Then - Actions
-
Set VariableSet TempGroup = (Units owned by (Player(TempPlayer)) of type TempUnitType)
-
Unit Group - Pick every unit in TempGroup and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is alive) Equal to True
-
-
Then - Actions
-
Unit - Kill (Picked unit)
-
Unit - Remove (Picked unit) from the game
-
-
Else - Actions
-
-
-
-
Unit - Create 1 TempUnitType for (Player(TempPlayer)) at (Center of UnitSpawnPoint <gen>) facing Default building facing degrees
-
Set VariableSet TempUnit = (Last created unit)
-
Animation - Change TempUnit's vertex coloring to (75.00%, 75.00%, 100.00%) with 0.00% transparency
-
Animation - Change TempUnit's size to (115.00%, 115.00%, 115.00%) of its original size
-
Unit - Set Name of TempUnit to ((Name of TempUnit) + **)
-
Unit - Set Max HP of TempUnit to ((Max HP of TempUnit) + ((Max HP of TempUnit) / 2))
-
Unit - Remove Sell Unit from TempUnit
-
-------- --------------------------------- --------
-
Unit - Set Armor of TempUnit to ((Armor of TempUnit) + 2.00)
-
Unit - Set life of TempUnit to 100.00%
-
Unit - Set Base Damage of TempUnit to ((Base Damage of TempUnit for weapon index (1 - 1)) + ((Base Damage of TempUnit for weapon index (1 - 1)) / 2)) for weapon index: (1 - 1)
-
-------- ----------READABILITY------------ --------
-
Unit - Create 1 TempUnitType for (Player(TempPlayer)) at (Center of UnitSpawnPoint <gen>) facing Default building facing degrees
-
Set VariableSet TempUnit = (Last created unit)
-
Animation - Change TempUnit's vertex coloring to (75.00%, 75.00%, 100.00%) with 0.00% transparency
-
Animation - Change TempUnit's size to (115.00%, 115.00%, 115.00%) of its original size
-
Unit - Set Name of TempUnit to ((Name of TempUnit) + **)
-
Unit - Set Max HP of TempUnit to ((Max HP of TempUnit) + ((Max HP of TempUnit) / 2))
-
Unit - Remove Sell Unit from TempUnit
-
-------- --------------------------------- --------
-
Unit - Set Armor of TempUnit to ((Armor of TempUnit) + 2.00)
-
Unit - Set life of TempUnit to 100.00%
-
Unit - Set Base Damage of TempUnit to ((Base Damage of TempUnit for weapon index (1 - 1)) + ((Base Damage of TempUnit for weapon index (1 - 1)) / 2)) for weapon index: (1 - 1)
-
Game - Display to (All players) the text: ((Name of (Player(TempPlayer))) + ( has gained a + (Name of TempUnit)))
-
Game - Display to (All players) the text: (String(Count))
-
Custom script: call DestroyGroup (udg_TempGroup)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Count Equal to 9
-
-
Then - Actions
-
Set VariableSet TempGroup = (Units owned by (Player(TempPlayer)) of type TempUnitType)
-
Unit Group - Pick every unit in TempGroup and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is alive) Equal to True
-
-
Then - Actions
-
Unit - Kill (Picked unit)
-
Unit - Remove (Picked unit) from the game
-
-
Else - Actions
-
-
-
-
Unit - Create 1 TempUnitType for (Player(TempPlayer)) at (Center of UnitSpawnPoint <gen>) facing Default building facing degrees
-
Set VariableSet TempUnit = (Last created unit)
-
Animation - Change TempUnit's vertex coloring to (100.00%, 50.00%, 50.00%) with 0.00% transparency
-
Animation - Change TempUnit's size to (130.00%, 130.00%, 130.00%) of its original size
-
Unit - Set Name of TempUnit to ((Name of TempUnit) + ***)
-
Unit - Set Max HP of TempUnit to ((Max HP of TempUnit) + (Max HP of TempUnit))
-
Unit - Remove Sell Unit from TempUnit
-
-------- --------------------------------- --------
-
Unit - Set Armor of TempUnit to ((Armor of TempUnit) + 4.00)
-
Unit - Set life of TempUnit to 100.00%
-
Unit - Set Base Damage of TempUnit to ((Base Damage of TempUnit for weapon index (1 - 1)) + (Base Damage of TempUnit for weapon index (1 - 1))) for weapon index: (1 - 1)
-
Game - Display to (All players) the text: ((Name of (Player(TempPlayer))) + ( has gained a + (Name of TempUnit)))
-
Custom script: call DestroyGroup (udg_TempGroup)
-
-
Else - Actions
-
-
-
The actual problem is that when I load the units from the unitgroup all the 2* and 3* units are ofcourse created back as a normal unit. I tried like this:
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Name of SaveGroupUnit) Equal to ((Name of SaveGroupUnit) + **)
-
-
Then - Actions
-
Game - Display to (All players) the text: 2* unit found!
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Name of (Triggering unit)) Equal to Footman **
-
-
Then - Actions
-
Unit - Set level of Shield Bash (Footman) for (Triggering unit) to 2
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Name of (Triggering unit)) Equal to Footman ***
-
-
Then - Actions
-
Unit - Set level of Shield Bash (Footman) for (Triggering unit) to 3
-
-
Else - Actions
-
-
-
In the OE I made a 2 skills for 2* units and 3* units if that route would be easier, but I am unsure if the level of ability integer boolean works for dead units?
And yes we need to do this so we can recreate the stats for upgraded units like in the starup system. And on a site note this is still missing the wavemanagment triggers since it's currently a test trigger.