- Joined
- Jun 20, 2017
- Messages
- 380
Basically, I'm trying to get my allied gold.
For example: I built a tower in a round, then when a round starts, it becomes a unit so that it can move and kill objects, but I gave the owner to my ally(I mean, it's actually my unit, and I don't want to control the unit when a level starts.), unless the round ends. The problem is that I want to get its gold when it kills things!
I know you can do this with Unit Indexer, as Uncle told me, but I have not worked with this system before. So I have no clue! but I guess it can be done this way!
Do I have to create another variable and set a gold reward for each creep?
For example: I built a tower in a round, then when a round starts, it becomes a unit so that it can move and kill objects, but I gave the owner to my ally(I mean, it's actually my unit, and I don't want to control the unit when a level starts.), unless the round ends. The problem is that I want to get its gold when it kills things!
I know you can do this with Unit Indexer, as Uncle told me, but I have not worked with this system before. So I have no clue! but I guess it can be done this way!
Do I have to create another variable and set a gold reward for each creep?
-
Setup Creep Types
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
Set VariableSet UnitType_BonusLevel = Pit Lord [Level 31]
-
-------- --------
-
-------- Level 1 --------
-
Set VariableSet UnitTypes_Creep[1] = Crab [Level 1]
-
Set VariableSet Strings_CreepName[1] = Crab
-
Set VariableSet Integers_CreepCount[1] = 36
-
Set VariableSet Strings_CreepValueRecommend[1] = 250
-
Set VariableSet Integers_LevelCompletedGold[1] = 11
-
-------- --------
-
-------- Level 2 --------
-
Set VariableSet UnitTypes_Creep[2] = Murloc [Level 2]
-
Set VariableSet Strings_CreepName[2] = Murloc
-
Set VariableSet Integers_CreepCount[2] = 45
-
Set VariableSet Strings_CreepValueRecommend[2] = 350
-
Set VariableSet Integers_LevelCompletedGold[2] = 12
-
-------- --------
-
-------- Level 3 --------
-
Set VariableSet UnitTypes_Creep[3] = Scorpion [Level 3]
-
Set VariableSet Strings_CreepName[3] = Scorpion
-
Set VariableSet Integers_CreepCount[3] = 40
-
Set VariableSet Strings_CreepValueRecommend[3] = 500
-
Set VariableSet Integers_LevelCompletedGold[3] = 13
-
-
-
Level Begins
-
Events
-
Time - Timer_LevelStart expires
-
-
Conditions
-
Actions
-
Player Group - Pick every player in PlayerGroup_WestTeam and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked player) controller) Equal to User
-
((Picked player) slot status) Equal to Is playing
-
-
Then - Actions
-
Unit - Create Integers_CreepCount[(Integer_CurrentLevel + 1)] UnitTypes_Creep[(Integer_CurrentLevel + 1)] for Player 22 (Snow) at Points_CreepSpawn[(Player number of (Picked player))] facing Default building facing degrees
-
Unit Group - Add (Last created unit) to UnitGroup_Creep
-
Set VariableSet UDexUnits[(Player number of (Owner of (Last created unit)))] = (Last created unit)
-
-
Else - Actions
-
-
-
-
Player Group - Pick every player in PlayerGroup_EastTeam and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked player) controller) Equal to User
-
((Picked player) slot status) Equal to Is playing
-
-
Then - Actions
-
Unit - Create Integers_CreepCount[(Integer_CurrentLevel + 1)] UnitTypes_Creep[(Integer_CurrentLevel + 1)] for Player 21 (Coal) at Points_CreepSpawn[(Player number of (Picked player))] facing Default building facing degrees
-
Unit Group - Add (Last created unit) to UnitGroup_Creep
-
Set VariableSet UDexUnits[(Player number of (Owner of (Last created unit)))] = (Last created unit)
-
-
Else - Actions
-
-
-
-
-
-
Tower to Fighter
-
Events
-
Conditions
-
Actions
-
Trigger - Run Fighters Value <gen> (ignoring conditions)
-
-------- --------
-
Unit Group - Pick every unit in UnitGroup_Towers and do (Actions)
-
Loop - Actions
-
Unit - Set (Picked unit) construction progress to 100%
-
Unit - Set (Picked unit) upgrade progress to 100%
-
-------- --------
-
Unit - Hide (Picked unit)
-
-------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Owner of (Picked unit)) is an ally of Player 19 (Mint).) Equal to True
-
-
Then - Actions
-
Set VariableSet Player_Temp = Player 19 (Mint)
-
-
Else - Actions
-
Set VariableSet Player_Temp = Player 20 (Lavender)
-
-
-
-------- --------
-
For each (Integer A) from 1 to Integer_Towers, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Unit-type of (Picked unit)) Equal to UnitTypes_Towers[(Integer A)]
-
-
Then - Actions
-
Set VariableSet Point_Temp = (Position of (Picked unit))
-
Unit - Create 1 UnitTypes_TowersUnit[(Integer A)] for Player_Temp at Point_Temp facing Default building facing degrees
-
Unit - Change color of (Last created unit) to (Color of (Owner of (Picked unit)))
-
Unit - Reset ability cooldowns for (Last created unit).
-
Unit Group - Add (Last created unit) to UnitGroup_Fighter
-
Custom script: call RemoveLocation(udg_Point_Temp)
-
-
Else - Actions
-
-
-
-
-
-
Custom script: call DestroyGroup(udg_UnitGroup_Towers)
-
-
-
Creep Dies
-
Events
-
Unit - A unit Dies
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
((Dying unit) is in UnitGroup_Creep.) Equal to True
-
((Dying unit) is in UnitGroup_Summon.) Equal to True
-
-
-
-
Then - Actions
-
Player - Add (Custom value of UDexUnits[(Player number of (Owner of (Dying unit)))]) to (Owner of UDexUnits[(Player number of (Owner of (Killing unit)))]).Current gold
-
-------- --------
-
Floating Text - Create floating text that reads (String((Custom value of (Dying unit)))) above (Dying unit) with Z offset 0.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
-
Floating Text - Change (Last created floating text): Disable permanence
-
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
-
Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
-
Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
-
-
Else - Actions
-
-
-