- Joined
- Jan 15, 2009
- Messages
- 80
This tutorial is fairly easy to do, so it should only be useful to people who are "new" to triggering. In this tutorial I will explain how to make some "Tips" appear in your game giving the players some advice as well as how to turn them off and back on using in-game commands. This tutorial is very basic and well explained.
Difficulty - 4/10
Step 1 - Making Variables
When you are on your "Trigger Editor" press Ctrl+B, this will open up the variable window. When you are in that window press Ctrl+N (To create the new variable), name the variable "RandomNumber", and change the variable type to "Integer". After you are finished with the first variable make a new one (Ctrl+N) and name it "Tips", after naming it, change the variable type to "String", click the check box below called "Array" and change the Default Number to however many tips you want to be in your game.
Step 2 - Making the Triggers
A - Set up tips
To make your Trigger Editor look neat, make a Category (Ctrl+G) first where you can put all your triggers related to this tutorial into, call it "Tips". After you have made the Category right click on the category and click "New Trigger" and name the trigger "Start Tips". After the trigger is made make a Event (Ctrl+E), choose the event "Map Initialization". Next you need to make a action (Ctrl+R), after you have made the action open up the actions by clicking on the second box to the top and scroll down until you see "Set Variable", click on this. Next what you have to do is click on the red "Variable" text and change it to "Tips", next to where it now says "Tips" it should say "Index", now click on this and change it to 1(This is going to be the first Tip, this is the Array you changed earlier). After you have changed the number to "1" click on the text "Value", and change it to what you want your tip to say. After you have finished this make another event repeating everything i have just explained except when you get to the array change it +1 number from what the last number was(This tip was 1, so the next one would be 2), and then change the Value again to a different tip.
~~This trigger is now done~~
B - Display Tips
Make a new trigger (Ctrl+N) and call it Display Tips. After you have made the trigger, make a event (Ctrl+E) and choose the event "Time Periodic Event" when chosen change the number where it says Every 2.00 seconds of game time to 30.00 seconds. After this make a action (Ctrl+R) and choose the action Set variable again, when chosen change the Variable to the variable "RandomNumber" and then change the "Value", this time instead of putting text you need to click on the box next to "Function:" and open up a menu, click on "Math - Random Number" and change the number "10" to the amount of tips you wrote down on the other variable (I did 3). Now you have to make another action (Ctrl+R), for this action scroll down and choose "Game - Text Message (Explicitly Timed). Click on the red text "Text" and click the check box at the top next to "Variable" and click the box next to it, change it to "Tips", now where it says [ Index ] click on it, then click the check box at the top next to variable again, click the box next to it and change it to "RandomNumber".
~~This trigger is now done~~
C - Turn Off
Make a new trigger (Ctrl+N) and call it Turn Off. After you have made the trigger, make a event (Ctrl+E) and choose the event "Player - Chat Message" when chosen change the text "Text" to "-tipsoff". After this make a action (Ctrl+R) and choose the action Trigger - Turn Off, when chosen click on the text "(This Trigger)" and then click the check box at the top next to Variable. Next click the box next to it and choose the trigger "Display Tips".
~~This trigger is now done~~
D - Turn On
Make a new trigger (Ctrl+N) and call it Turn On. After you have made the trigger, make a event (Ctrl+E) and choose the event "Player - Chat Message" when chosen change the text "Text" to "-tipson". After this make a action (Ctrl+R) and choose the action Trigger - Turn On, when chosen click on the text "(This Trigger)" and then click the check box at the top next to Variable. Next click the box next to it and choose the trigger "Display Tips". This trigger is the exact same as the other one except you are using a different action and string to activate the trigger.
~~This trigger is now done~~
If you have followed my steps closely and correctly, hopefully you were able to achieve this goal, if so great, if not leave a comment explaining what you don't get or won't work. I am going to attatch a map to this tutorial so you can look over the Triggers.
Difficulty - 4/10
Step 1 - Making Variables
When you are on your "Trigger Editor" press Ctrl+B, this will open up the variable window. When you are in that window press Ctrl+N (To create the new variable), name the variable "RandomNumber", and change the variable type to "Integer". After you are finished with the first variable make a new one (Ctrl+N) and name it "Tips", after naming it, change the variable type to "String", click the check box below called "Array" and change the Default Number to however many tips you want to be in your game.
Step 2 - Making the Triggers
A - Set up tips
To make your Trigger Editor look neat, make a Category (Ctrl+G) first where you can put all your triggers related to this tutorial into, call it "Tips". After you have made the Category right click on the category and click "New Trigger" and name the trigger "Start Tips". After the trigger is made make a Event (Ctrl+E), choose the event "Map Initialization". Next you need to make a action (Ctrl+R), after you have made the action open up the actions by clicking on the second box to the top and scroll down until you see "Set Variable", click on this. Next what you have to do is click on the red "Variable" text and change it to "Tips", next to where it now says "Tips" it should say "Index", now click on this and change it to 1(This is going to be the first Tip, this is the Array you changed earlier). After you have changed the number to "1" click on the text "Value", and change it to what you want your tip to say. After you have finished this make another event repeating everything i have just explained except when you get to the array change it +1 number from what the last number was(This tip was 1, so the next one would be 2), and then change the Value again to a different tip.
-
Start Tips
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
Set Tips[1] = Being friendly to players, will make you friends!
-
Set Tips[2] = Helping people out when needed will ear you respect!
-
Set Tips[3] = When you treat others badly, don't expect to be treated any nicer!
-
-
B - Display Tips
Make a new trigger (Ctrl+N) and call it Display Tips. After you have made the trigger, make a event (Ctrl+E) and choose the event "Time Periodic Event" when chosen change the number where it says Every 2.00 seconds of game time to 30.00 seconds. After this make a action (Ctrl+R) and choose the action Set variable again, when chosen change the Variable to the variable "RandomNumber" and then change the "Value", this time instead of putting text you need to click on the box next to "Function:" and open up a menu, click on "Math - Random Number" and change the number "10" to the amount of tips you wrote down on the other variable (I did 3). Now you have to make another action (Ctrl+R), for this action scroll down and choose "Game - Text Message (Explicitly Timed). Click on the red text "Text" and click the check box at the top next to "Variable" and click the box next to it, change it to "Tips", now where it says [ Index ] click on it, then click the check box at the top next to variable again, click the box next to it and change it to "RandomNumber".
-
Display Tips
-
Events
-
Time - Every 30.00 seconds of game time
-
-
Conditions
-
Actions
-
Set RandomNumber = (Random integer number between 1 and 3)
-
Game - Display to (All players) for 30.00 seconds the text: Tips[RandomNumber]
-
-
C - Turn Off
Make a new trigger (Ctrl+N) and call it Turn Off. After you have made the trigger, make a event (Ctrl+E) and choose the event "Player - Chat Message" when chosen change the text "Text" to "-tipsoff". After this make a action (Ctrl+R) and choose the action Trigger - Turn Off, when chosen click on the text "(This Trigger)" and then click the check box at the top next to Variable. Next click the box next to it and choose the trigger "Display Tips".
-
Turn Off
-
Events
-
Player - Player 1 (Red) types a chat message containing -tipsoff as An exact match
-
-
Conditions
-
Actions
-
Trigger - Turn off Display Tips <gen>
-
Game - Display to (All players) for 30.00 seconds the text: Tips have been turned off!
-
-
D - Turn On
Make a new trigger (Ctrl+N) and call it Turn On. After you have made the trigger, make a event (Ctrl+E) and choose the event "Player - Chat Message" when chosen change the text "Text" to "-tipson". After this make a action (Ctrl+R) and choose the action Trigger - Turn On, when chosen click on the text "(This Trigger)" and then click the check box at the top next to Variable. Next click the box next to it and choose the trigger "Display Tips". This trigger is the exact same as the other one except you are using a different action and string to activate the trigger.
-
Turn On
-
Events
-
Player - Player 1 (Red) types a chat message containing -tipson as An exact match
-
-
Conditions
-
Actions
-
Trigger - Turn on Display Tips <gen>
-
Game - Display to (All players) for 30.00 seconds the text: Tips have been turned on!
-
-
If you have followed my steps closely and correctly, hopefully you were able to achieve this goal, if so great, if not leave a comment explaining what you don't get or won't work. I am going to attatch a map to this tutorial so you can look over the Triggers.
Attachments
Last edited: