Welcome to the Terrian Kill Tutorial (GUI)
Trust me, this is one of the easyest triggers i've ever done.
Let's get started!
Variable RequirementsMake a Unit Variable type and array to how much players in your game,
example : 11 Players and 1 Computer, Unit Array (11).
Next, you need a Point Variable type and set the array to 5.--------------------------------------------------------------------------------
Terrian Kill Trigger (GUI)Make a New Trigger (Ctrl + T) and name it Terrian Kill Trigger (Names don't mattter)
New Event (Ctrl + E)
Event Type Time, Periodic Event
Every
0.12 seconds of the game.
Now, it should look like
Events Time - Every
0.12 seconds of game time
ConditionsNo
ConditionsNew Action (Ctrl + R)
Action Type General, For Each Integer A, Do Multiple Actions
For each (Integer A) from
1 to
How much Players in your game, do (Actions)
Loop - Actions
Now, it should look like
Events Time - Every 0.12 seconds of game time
ConditionsActionsFor each (Integer A) from 1 to 11, do (Actions)
Loop - Actions
Right Click on the Loop - Actions and click New Action
Action Type General, Set Variable
Set
Point Variable[
0] = (Position of
Unit Variable[(
Integer A)])
Now it should look like
Terrain Type Kill
Events Time - Every 0.12 seconds of game time
Conditions Actions For each (Integer A) from 1 to 11, do (Actions)
Loop - Actions
Set Point[0] = (Position of Unit Variable[(Integer A)])
Next, Right-Click on Set Point[0] = (Position of Unit Variable[(Integer A)]) and click New Action.
Action Type General, If / Then / Else, Multiple Functions
You will see a If - Conditions, Then - Actions and Else - Actions. Now Right-Click on the If - Conditions and find Terrian Type Comparison
(Terrain type at
Point Variable[
0]) Equal to (Your Tileset - The Terrian)
Now, it should look like
Terrain Type Kill
Events Time - Every 0.12 seconds of game time
Conditions Actions For each (Integer A) from 1 to 11, do (Actions)
Loop - Actions
Set Point Variable[0] = (Position of Unit Variable[(Integer A)])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain type at Point Variable[0]) Equal to (Your Tileset - Terrian)
Now, Right-Click on Then - Actions and click on New Actions
Action Type Unit, Unit - Kill
Unit - Kill
Unit Variable[(
Integer A)]
Now, Right-Click on Else - Actions and click on New Actions
Action Type General, Custom Script
Copy Paste
call RemoveLocation(udg_Point[0]) on the Custom Script Value (This is so the game wont crash or get bugged)
Your finally done with the Terrian Kill Trigger, now you need to make the Unit Variable read what units it's going to kill when it get's off the path.
Loading UnitsMake A New Trigger (Ctrl + T)
Event Type General, Map initialization
-
Events Map initialization
-
ConditionsNo
ConditionsNow, it's time for Actions the part your going to load your player units.
New Action (CTRL + R)
Action Type General, Set Variable
Set
Unit Variable[
1] =
Your unit on the map <gen>
Next, do the same thing but change the number and select the different unit on the map.
When your done it should look like
Events Map initialization
Conditions Actions Set Unit Variable[1] = Your Unit on the Map 0001 <gen>
Set Unit Variable[2] = Your Unit on the Map 0002 <gen>
Set Unit Variable[3] = Your Unit on the Map 0003 <gen>
Set Unit Variable[4] = Your Unit on the Map 0004 <gen>
Set Unit Variable[5] = Your Unit on the Map 0007 <gen>
Set Unit Variable[6] = Your Unit on the Map 0006 <gen>
Set Unit Variable[7] = Your Unit on the Map 0009 <gen>
Set Unit Variable[8] = Your Unit on the Map 0005 <gen>
Set Unit Variable[9] = Your Unit on the Map 0008 <gen>
Set Unit Variable[10] = Your Unit on the Map 0010 <gen>
Set Unit Variable[11] = Your Unit on the Map 0011 <gen>
Your finally finished!To clear things up this is what your Trigger Terrian Kill should look like
Events Time - Every 0.12 seconds of game time
Conditions Actions For each (Integer A) from 1 to 11, do (Actions)
Loop - Actions
Set Point Variable[0] = (Position of Unit Variable[(Integer A)])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain type at Point Variable[0]) Equal to (Your Tileset - Terrian)
Then - Actions
Unit - Kill Hero[(Integer A)]
Else - Actions
Custom script: call RemoveLocation(udg_Point[0])
Your Loading Unit TriggerEvents Map initialization
Conditions Actions Set Unit Variable[1] = Your Unit on the Map 0001 <gen>
Set Unit Variable[2] = Your Unit on the Map 0002 <gen>
Set Unit Variable[3] = Your Unit on the Map 0003 <gen>
Set Unit Variable[4] = Your Unit on the Map 0004 <gen>
Set Unit Variable[5] = Your Unit on the Map 0007 <gen>
Set Unit Variable[6] = Your Unit on the Map 0006 <gen>
Set Unit Variable[7] = Your Unit on the Map 0009 <gen>
Set Unit Variable[8] = Your Unit on the Map 0005 <gen>
Set Unit Variable[9] = Your Unit on the Map 0008 <gen>
Set Unit Variable[10] = Your Unit on the Map 0010 <gen>
Set Unit Variable[11] = Your Unit on the Map 0011 <gen>
Thanks for using ZeroX2)Fire's Terrian Kill Trigger/Loading Unit Tutorial