How to choose a random sound or message text?
Quote from whupper on January 16, 2008, 10:08 pmSuppose I want to display a message or play a sound when the user destroys the cube in a cleanser. I know how to create the output to react to the box being dissoved and play a sound or display some text. But if I have a pool of sounds or a pool of text messages, how can I randomly select one?
The Portal game does this, for example, when a turret dies and picks one of several sounds to play.
(I suppose I could decompile a map and look, but I'm at work and can't wait until I get home to find out.
Suppose I want to display a message or play a sound when the user destroys the cube in a cleanser. I know how to create the output to react to the box being dissoved and play a sound or display some text. But if I have a pool of sounds or a pool of text messages, how can I randomly select one?
The Portal game does this, for example, when a turret dies and picks one of several sounds to play.
(I suppose I could decompile a map and look, but I'm at work and can't wait until I get home to find out.
Quote from NocturnalGhost on January 16, 2008, 10:17 pmhttp://developer.valvesoftware.com/wiki/Logic_case
Use the "pickrandom" input.
http://developer.valvesoftware.com/wiki/Logic_case
Use the "pickrandom" input.
Quote from Nacimota on January 16, 2008, 11:16 pmwhupper wrote:...The Portal game does this, for example, when a turret dies and picks one of several sounds to play...That's just the way the turret NPC is written, it has little to do with hammer.
That's just the way the turret NPC is written, it has little to do with hammer.
Quote from NocturnalGhost on January 18, 2008, 7:43 pmI'd post a link to the image that gave me the idea, but it didn't go down too well last time i did
Google "chell portal lawl" if you are really curious. (and over 18, hehe)
I'd post a link to the image that gave me the idea, but it didn't go down too well last time i did
Google "chell portal lawl" if you are really curious. (and over 18, hehe)
Quote from Hober on January 21, 2008, 11:32 pmNocturnalGhost wrote:I'd post a link to the image that gave me the idea, but it didn't go down too well last time i didGoogle "chell portal lawl" if you are really curious. (and over 18, hehe)
Missed opportunity to rick-roll #12.
Google "chell portal lawl" if you are really curious. (and over 18, hehe)
Missed opportunity to rick-roll #12.