killbuzz
Member
- Reaction score
- 9
Hi all, just wondering if its possible to call local integers/locations in gui triggers? Im making a creep respawn system that only respawns if there are no nearby players and can't seem to get it to work. Here's what I have so far:
Then this revives them
I'd like to use local integer ii instead of Custom value of Triggering unit for the Wait Until function, is this possible? (It works until the triggering units corpse decays, then it revives instantly.)
EDIT: Fixed by causing Triggering unit to suspend corpse decay and then hiding it.
Code:
Respawn Init
Events
Map initialization
Conditions
Actions
Set Respawn_Time = 20.00
Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
Loop - Actions
Set Temp_Integer = (Temp_Integer + 1)
Unit - Set the custom value of (Picked unit) to Temp_Integer
Set Creep_Point[Temp_Integer] = (Position of (Picked unit))
Set Creep_Angle[Temp_Integer] = (Facing of (Picked unit))
Then this revives them
Code:
Respawn
Events
Unit - A unit owned by Neutral Hostile Dies
Conditions
And - All (Conditions) are true
Conditions
(Custom value of (Triggering unit)) Greater than 0
Actions
Custom script: local integer i = GetUnitTypeId(GetTriggerUnit())
Custom script: local integer ii = GetUnitUserData(GetTriggerUnit())
Wait until (((Units within 800.00 of Creep_Point[(Custom value of (Triggering unit))] matching (((Matching unit) belongs to an enemy of Neutral Hostile) Equal to True)) is empty) Equal to True), checking every Respawn_Time seconds
Custom script: call SetUnitUserData(CreateUnit(Player(12),i,GetLocationX(udg_Creep_Point[ii]),GetLocationY(udg_Creep_Point[ii]),udg_Creep_Angle[ii]),ii)
Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
I'd like to use local integer ii instead of Custom value of Triggering unit for the Wait Until function, is this possible? (It works until the triggering units corpse decays, then it revives instantly.)
EDIT: Fixed by causing Triggering unit to suspend corpse decay and then hiding it.