Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
You are using an out of date browser. It may not display this or other websites correctly. You should upgrade or use an alternative browser.
Triggers
CreepReviveSystem.w3x
Variables
CreepSetup
---Creep Set---
Encouter Event
UnknownEncounter
UnitRevive
Enter map-specific custom script code below. This text will be included in the map script after variables are declared and before any trigger code.
Name
Type
is_array
initial_value
CreepFaceAngle
real
Yes
CreepNum
integer
No
CreepRevivePoint
location
Yes
Creeps
unit
Yes
NeutralizedUnits
group
No
Temp_Group_1
group
No
GhostThruster's Creep Setup and Revival System.
1.Info:
This system is in full GUI so masters and amatuers alike can use it. It is very simple and requires basic knowledge. The system just saves the point of origin and facing angle of a unit into variables, so later if that unit dies, it will be resurrected exactly as it was, with same facing angle and at the point where it was placed in the editor(note that this is not where the unit dies, so even if it ends up half way across the map, it will be revived in its camp).
2.Help:
If you are having troubles, just find me, GhostThruster on the Hive Workshop. This system is relatively easy anyway. I recommend this to be used in RPGs and melee maps as they are the maps that use respawing creeps.
3.Instructions:
a-Copy and paste this trigger category into your map.
b-CreepNum is a variable that stores the custom value of a creep encoutered by your unit. It increases by 1 for every new unit encountered.
c-CreepFaceAngle is a real that stores the creep units' facing angle.
d-Creeps is a unit array variable that uses CreepNum as its index. This is to determine the unit that dies and its type. Creeps is based on the custom value of that unit.
e-CreepRevivePoint is the initial place of where the creep is encountered. This is an array based on CreeepNum too, so the right unit is revived at the right place. This point is established when the hero moves within 1000 of the creep's position (further than casting, aquisition and attack range)
f-NeutralizedUnits is a unit group that adds already stored units so that they are not stored again as a variable.
g-Temp_Group_1 is a unit group that is for one time use to find all the units on the map that are creeps and can be stored.
Encouter Event
Events
Time - Elapsed game time is 0.00 seconds
Conditions
Actions
-------- - --------
-------- Just a temporary group --------
Set Variable Set Temp_Group_1 = (Units in (Playable map area) owned by Player 12 (Brown))
-------- - --------
-------- Because the normal event can only use specific units, we'll have to add our event with Picked Unit via trigger --------
Unit Group - Pick every unit in Temp_Group_1 and do (Actions)
Loop - Actions
Trigger - Add to UnknownEncounter <gen> the event (A unit comes within 1000.00 of (Picked unit))
-------- - --------
-------- Destroys the group to minimize leaks --------
((Triggering unit) is in NeutralizedUnits.) Equal to False
(Owner of (Triggering unit)) Equal to Player 12 (Brown)
Actions
-------- - --------
-------- Sets CreepNum to a different integer --------
Set Variable Set CreepNum = (CreepNum + 1)
-------- - --------
-------- Stores the facing angle of the unit --------
Set Variable Set CreepFaceAngle[CreepNum] = (Facing of (Triggering unit))
-------- - --------
-------- Sets the unit as Creeps, and the index as the always changing CreepNum --------
Set Variable Set Creeps[CreepNum] = (Triggering unit)
-------- - --------
-------- Sets the custom value of that unit to CreepNum, for future revival --------
Unit - Set the custom value of Creeps[CreepNum] to CreepNum
-------- - --------
-------- Stores the point of origin of the creep --------
Set Variable Set CreepRevivePoint[CreepNum] = (Position of Creeps[CreepNum])
-------- - --------
-------- Adds the newly stored unit into that group to stop it from getting stored as a variable again --------
Unit Group - Add Creeps[CreepNum] to NeutralizedUnits
UnitRevive
Events
Unit - A unit Dies
Conditions
(Owner of (Dying unit)) Equal to Player 12 (Brown)
Actions
-------- - --------
-------- Period before the unit is revived --------
Wait 1.00 seconds
-------- - --------
-------- FX for the resurrection --------
Special Effect - Create a special effect at CreepRevivePoint[(Custom value of (Dying unit))] using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
-------- - --------
-------- Re-creates the unit perfectly, at the same spot and angle --------
Unit - Create 1 . (Unit-type of (Dying unit)) for (Owner of (Dying unit)) at CreepRevivePoint[(Custom value of (Dying unit))] facing CreepFaceAngle[(Custom value of (Dying unit))] degrees
-------- - --------
-------- Replaces all the values of the dead unit with the new one --------
Set Variable Set Creeps[(Custom value of (Dying unit))] = (Last created unit)
-------- - --------
Unit - Set the custom value of (Last created unit) to (Custom value of (Dying unit))
-------- - --------
Unit Group - Add Creeps[(Custom value of (Dying unit))] to NeutralizedUnits
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.