Post by DungeonM on May 10, 2004 13:22:18 GMT -5
This is a tutorial for making gates that can be opened through chat messages by the player that owns it AND allow allied players to open it if that player leaves.
Some things you need to know:
Basic Triggering
Variables
Okay, for my example were going to pretend were making Gondor's gate.
For our variables were going to need 1 boolean variable and 1 real variable. If you don't know what these mean don't panick, a boolean variable basicly means either True or False. A real variable is a number with 2 decimal places, such as 1.00. We'll name the boolean variable MinasGateAlive and the Real variable MinasHealth.
Now we start the trigger.
Minas Tirith Gate Open
Events
Player - Player 1 (Red) types a chat message containing -Open Minas as An exact match
Conditions
MinasGateAlive Equal to True
Actions
Wait 5.00 seconds
Set MinasHealth = (Current life of Gate of Minas Tirith (Diagonal 1) 0434 <gen>)
Wait 0.20 seconds
Destructible - Open Gate of Minas Tirith (Diagonal 1) 0434 <gen>
Set MinasGateAlive = True
Basicly that trigger detects when a player types "-open minas" and checks to make sure the variable MinasGateAlive is true. The 5 second wait at the actions is to prevent players from constantly opening and closing like in ring wars, we set the MinasHealth variable to the number that is the gate's health. We then have a quick pause and open the gate, we set MinasGateAlive to true because when a gate is opened it is considered destroyed.
Now for the close trigger.
Minas Tirith Close
Events
Player - Player 1 (Red) types a chat message containing -Close Minas as An exact match
Conditions
MinasGateAlive Equal to True
Actions
Wait 5.00 seconds
Destructible - Close Gate of Minas Tirith (Diagonal 1) 0434 <gen>
Wait 0.01 seconds
Destructible - Set life of Gate of Minas Tirith (Diagonal 1) 0434 <gen> to MinasHealth
This is almost as same as the open trigger except for the fact that we are closing it instead. After the gate is closed we set its health to the real variable MinasHealth so that its health is set to the health it had when it was last opened.
Finally we must make a trigger to set MinasGateAlive to False if it is destroyed.
Minas Tirith Dies
Events
Destructible - Gate of Minas Tirith (Diagonal 1) 0434 <gen> dies
Conditions
Actions
Set MinasGateAlive = False
Now, we've completed the trigger, player 1 can now open and close their gate, but what if player 1 leaves and the allies of player 1 need to open it?
Adding these events...
Events
Player - Player 2 (Blue) types a chat message containing -Open Minas as An exact match
Player - Player 3 (Teal) types a chat message containing -Open Minas as An exact match
Player - Player 4 (Purple) types a chat message containing -Open Minas as An exact match
Player - Player 5 (Yellow) types a chat message containing -Open Minas as An exact match
Player - Player 6 (Orange) types a chat message containing -Open Minas as An exact match
And these two conditions will make the trigger work for allies if player 1 has left...
Conditions
((Triggering player) is an ally of Player 1 (Red)) Equal to True
((Player 1 (Red) slot status) Equal to Is unused) or ((Player 1 (Red) slot status) Equal to Has left the game)
Hope that helps! If you have any questions or problems just reply and I should be able to figure out what is wrong.
#nosmileys
Some things you need to know:
Basic Triggering
Variables
Okay, for my example were going to pretend were making Gondor's gate.
For our variables were going to need 1 boolean variable and 1 real variable. If you don't know what these mean don't panick, a boolean variable basicly means either True or False. A real variable is a number with 2 decimal places, such as 1.00. We'll name the boolean variable MinasGateAlive and the Real variable MinasHealth.
Now we start the trigger.
Minas Tirith Gate Open
Events
Player - Player 1 (Red) types a chat message containing -Open Minas as An exact match
Conditions
MinasGateAlive Equal to True
Actions
Wait 5.00 seconds
Set MinasHealth = (Current life of Gate of Minas Tirith (Diagonal 1) 0434 <gen>)
Wait 0.20 seconds
Destructible - Open Gate of Minas Tirith (Diagonal 1) 0434 <gen>
Set MinasGateAlive = True
Basicly that trigger detects when a player types "-open minas" and checks to make sure the variable MinasGateAlive is true. The 5 second wait at the actions is to prevent players from constantly opening and closing like in ring wars, we set the MinasHealth variable to the number that is the gate's health. We then have a quick pause and open the gate, we set MinasGateAlive to true because when a gate is opened it is considered destroyed.
Now for the close trigger.
Minas Tirith Close
Events
Player - Player 1 (Red) types a chat message containing -Close Minas as An exact match
Conditions
MinasGateAlive Equal to True
Actions
Wait 5.00 seconds
Destructible - Close Gate of Minas Tirith (Diagonal 1) 0434 <gen>
Wait 0.01 seconds
Destructible - Set life of Gate of Minas Tirith (Diagonal 1) 0434 <gen> to MinasHealth
This is almost as same as the open trigger except for the fact that we are closing it instead. After the gate is closed we set its health to the real variable MinasHealth so that its health is set to the health it had when it was last opened.
Finally we must make a trigger to set MinasGateAlive to False if it is destroyed.
Minas Tirith Dies
Events
Destructible - Gate of Minas Tirith (Diagonal 1) 0434 <gen> dies
Conditions
Actions
Set MinasGateAlive = False
Now, we've completed the trigger, player 1 can now open and close their gate, but what if player 1 leaves and the allies of player 1 need to open it?
Adding these events...
Events
Player - Player 2 (Blue) types a chat message containing -Open Minas as An exact match
Player - Player 3 (Teal) types a chat message containing -Open Minas as An exact match
Player - Player 4 (Purple) types a chat message containing -Open Minas as An exact match
Player - Player 5 (Yellow) types a chat message containing -Open Minas as An exact match
Player - Player 6 (Orange) types a chat message containing -Open Minas as An exact match
And these two conditions will make the trigger work for allies if player 1 has left...
Conditions
((Triggering player) is an ally of Player 1 (Red)) Equal to True
((Player 1 (Red) slot status) Equal to Is unused) or ((Player 1 (Red) slot status) Equal to Has left the game)
Hope that helps! If you have any questions or problems just reply and I should be able to figure out what is wrong.
#nosmileys