• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Making a simple hint system [Reviewed: Ralle]

Level 9
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:
  • 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
Explain what the trigger does, and what you can edit:
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)]
This trigger is the one which will display the hints, here i will explain you how it works:
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:
Level 40
Joined
Dec 14, 2005
Messages
10,532
This is definitely too short at the moment.

Suggestions for lengthening/improvement -

  • Show the reader how to enable/disable hints ingame (players can choose whether or not to see hints)
  • Show the reader how to make hints not be displayed twice
  • Explain what you are doing a bit more (especially with thes enew things)

Also, on an unrelated note, arrays start at [0], not [1].
 
Top