• 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.

Random Text

Status
Not open for further replies.
Level 3
Joined
Jul 2, 2004
Messages
32
Anyone know how to make random text appear? Like if you type something, theres a 1/3 chance one text will appear, a 1/3 chance another text will appear, and a 1/3 chance another text will appear? :?
 
Level 1
Joined
Nov 18, 2004
Messages
6
Randomize (trigger)

Event
Player (color) types a chat message containing (txt) as an exact match.

Action
Set Variable1 = Random iniger between 1 and 3
Run var1
Run var2
Run var3

Var1 (trigger)

Conditions
Variable1 = 1

Action
Game - Text message (text)

Var2 (trigger)

Conditions
Variable1 = 2

Action
Game - Text message (text)

Var3 (trigger)

Conditions
Variable1 = 3

Action
Game - Text message (text)
 
Level 6
Joined
Feb 4, 2005
Messages
302
Let me rewrite it then... but I guess it'd be better if it's one trigger, no?

Events
- Player types {chat message here} (This one is if they type)
- Periodic Event (This one is if you want it to appear at random times, remember, pick only one.)

Actions

- Set variable(this one has to be an integer) to {random integer between 1 and 3}
- If Variable = 1 (This is the if/then/else action)
Then Game - Text Message {message here}
Else If Variable = 2
Then Game - Text Message (message 2 here)

Etc etc... change the 3 to the max amount of help messages if you wish.
 
Level 7
Joined
Jul 30, 2004
Messages
451
Telefragged said:
Let me rewrite it then... but I guess it'd be better if it's one trigger, no?

Events
- Player types {chat message here} (This one is if they type)
- Periodic Event (This one is if you want it to appear at random times, remember, pick only one.) <---[add]Totally not true, you can have as many as you want, Raptor--[/add]

Actions

- Set variable(this one has to be an integer) to {random integer between 1 and 3}
- If Variable = 1 (This is the if/then/else action)
Then Game - Text Message {message here}
Else If Variable = 2
Then Game - Text Message (message 2 here)

Etc etc... change the 3 to the max amount of help messages if you wish.

let me rewrite that, i guess it would be better if it was 1 action (minus setup)

Code:
Setup:
  Event: Map init
  Condition:
  Actions:
    var_RandomString[0] = "Holy cow"
    var_RandomString[1] = "Push that rainbow"
    var_RandomString[2] = "Puppies and unicorns"

Trigger:
  Event: Whatever you want
  Condition:
  Actions:
    Game - Text Display Message (var_RandomString[(random integer between 0 and 2)] to all players
 
Status
Not open for further replies.
Top