(GUI/MUI) Hero Revival System

User avatar
Enalias
Site Admin
Site Admin
Posts: 200
Joined: Sat Sep 15, 2018 1:57 pm
Reputation: 9
Location: Florida, U.S.A.
Website: http://chaosrealm.co/memberlist.php?mod ... rofile&u=2
Discord: https://discord.gg/BUEZkef
Twitch: https://www.twitch.tv/enalias
Contact:
United States of America

(GUI/MUI) Hero Revival System

#1

Post by Enalias » Mon Nov 05, 2018 11:37 am

Credits: Robot-Dude
Difficulty: Easy

First you'll need to create the variables
Variables
Revival_Index1 Integer 0 (Default)
Revival_Index2 Integer 0 (Default)
Revival_MUI Integer 0 (Default)
Revival_TimeFactor Integer 0
Revival_Timer Real Array (1) 0 (Default)
Revival_Unit Unit Array (1) - None -
Revival_Point Point Array (1) - None -
You can either change the "Revival_TimeFactor" from 0 by either editing it in Variables or doing

Set Revival_TimeFactor = (Your Number) (In Map Initialization)

Now the next step is to create the Triggers

Create a new trigger called whatever, with me i've called mine "Revival System 1"
[gui]Revival System 1
Events
Unit - A unit Dies
Conditions
((Triggering unit) is A Hero) Equal to True
Actions
-------- Setup Indexing --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Revival_Index1 Equal to 0
Then - Actions
Trigger - Turn on Hero Revival <gen>
Else - Actions
-------- Setup Indexing Part2 --------
Set Revival_Index1 = (Revival_Index1 + 1)
Set Revival_Index2 = (Revival_Index2 + 1)
-------- Setup unit and revival --------
Set Revival_Unit[Revival_Index2] = (Triggering Unit)
Set Revival_Timer[Revival_Index2] = (((Real((Level of Revival_Unit[Revival_Index2]))) x (Real(Revival_TimeFactor))) + 5.00)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of Revival_Unit[Revival_Index2]) is in YourPlayerGroup1) Equal to True
Then - Actions
Set Revival_Pont[Revival_Index2] = (Center of (Playable map area))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of Revival_Unit[Revival_Index2]) is in YourPlayerGroup2) Equal to True
Then - Actions
Set Revival_Pont[Revival_Index2] = (Center of (Playable map area))
Else - Actions
[/gui]

Now to finish it off, create your last trigger. Whatever name you want mines called "Revival System 2" make sure to turn the Initially Off.
[gui]Revival System 2
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
For each (Integer Revival_MUI) from 1 to Revival_Index2, do (Actions)
Loop - Actions
Set Revival_Timer[Revival_MUI] = (Revival_Timer[Revival_MUI] - 0.03)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Revival_Timer[Revival_MUI] Less than or equal to 0.00
Then - Actions
Hero - Instantly revive Revival_Unit[Revival_MUI] at Revival_Pioint(Revival_MUI), Hide revival graphics
Camera - Pan camera for (Owner of Revival_Unit[Revival_MUI]) to (Position of Revival_Unit[Revival_MUI]) over 0.60 seconds
Selection - Select Revival_Unit[Revival_MUI] for (Owner of Revival_Unit[Revival_MUI])
Set Revival_Index2 = (Revival_Index2 - 1)
Custom script: call RemoveLocation (udg_Revival_Pont[udg_Revival_MUI])
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Revival_Index2 Equal to 0
Then - Actions
Set Revival_Index1 = 0
Trigger - Turn off (This trigger)
Else - Actions
[/gui]

Now you have a fully working Hero Revival system.

Return to “Systems”

×