- Joined
- Jul 24, 2007
- Messages
- 308
Making a simple hint System
To do this simple system, you will need two triggers:
One in initialization, which must contain these actions:
This trigger basicly sets the hints which will be used, but it doesnt show the, because we didnt tell him to show them, we just told the trigger to make the texts ready before everything.
What you can edit:
"|cff32cd32Hint:|r" : This will be displayed like this Hint: you can edit the code to change the colour.
"Hint#X" : this is the content of each hint, X refers to the number of the hint.
note : the RandomHint[X] variable's array must be diffrent on each use.
You can continue to the number as much as you want, know that the variable "RandomHint" is an array string variable.
Now on another trigger, make this :
First the function, "Game - Display to (All players) the text:" , this is the action that is used to show text for all players.
Second : the "RandomHint[(Random integer number between 1 and 9)]" : this picks a random hint number from the variable's array, and it is to be the chosen to be displayed.
Now test the game, then you will see that every 10 seconds a random hint will display.
Congratulations, you just made a hint system
Note: if you want a sound with the hint, just change the "Game - Display to (All players) the text:" to "Quest - Display the hint message" and use same text.
If you want a custom sound, you should use the "Sound - Play Sound" and refer to the sound that you want.
To do this simple system, you will need two triggers:
One in initialization, which must contain these actions:
-
Actions
- Set RandomHint[1] = |cff32cd32Hint:|r Hint#1 text
- Set RandomHint[2] = |cff32cd32Hint:|r Hint#2 text
- Set RandomHint[3] = |cff32cd32Hint:|r Hint#3 text
- Set RandomHint[4] = |cff32cd32Hint:|r Hint#4 text
- Set RandomHint[5] = |cff32cd32Hint:|r Hint#5 text
- Set RandomHint[6] = |cff32cd32Hint:|r Hint#6 text
- Set RandomHint[7] = |cff32cd32Hint:|r Hint#7 text
- Set RandomHint[8] = |cff32cd32Hint:|r Hint#8 text
- Set RandomHint[9] = |cff32cd32Hint:|r Hint#9 text
This trigger basicly sets the hints which will be used, but it doesnt show the, because we didnt tell him to show them, we just told the trigger to make the texts ready before everything.
What you can edit:
"|cff32cd32Hint:|r" : This will be displayed like this Hint: you can edit the code to change the colour.
"Hint#X" : this is the content of each hint, X refers to the number of the hint.
note : the RandomHint[X] variable's array must be diffrent on each use.
You can continue to the number as much as you want, know that the variable "RandomHint" is an array string variable.
Now on another trigger, make this :
-
Hints
-
Events
- Time - Every 10 seconds of game time
- Conditions
-
Actions
- Game - Display to (All players) the text: RandomHint[(Random integer number between 1 and 9)]
-
Events
First the function, "Game - Display to (All players) the text:" , this is the action that is used to show text for all players.
Second : the "RandomHint[(Random integer number between 1 and 9)]" : this picks a random hint number from the variable's array, and it is to be the chosen to be displayed.
Now test the game, then you will see that every 10 seconds a random hint will display.
Congratulations, you just made a hint system
Note: if you want a sound with the hint, just change the "Game - Display to (All players) the text:" to "Quest - Display the hint message" and use same text.
If you want a custom sound, you should use the "Sound - Play Sound" and refer to the sound that you want.
Last edited: