How to play a random event?
How can I activate sound to play randomly in kismet?
i.e. how do I trigger the "play sound event" - I see I can create a "random int" variable but not sure exactly how to connect the random variable to the play sound box, etc. (want thunder sound to play randomly throughout game)
ALSO... it would also be nice to know how to do this in udk script too?
Which extended class would I put a "if random(100)=1 then play thunder.wav"?
would it go into my MYHUD.uc class (where the game automatically cycles through)?
Also... what is the exact code syntax for "play a sound" from script with random() function. just guessing its something like random_var=random(100)
Last edited by billy7777; 05-27-2010 at 02:53 PM.
The SoundCue editor has a 'Random' node that you can connect different Sounds to. For all the sounds you want to have randomized, just create a new Cue
Thanks Wraiyth for posting...
I am not familiar with soundcue... havent played around with it - but thanks for the info
but I kinda wanted know a little more hands on about creating a random events... and how to script or use kismet to randomly open a door, etc. (is there a random trigger event that I can attached to anything?)
is there a random() command in unreal script?
I may want to add a lightning flash (turn on very bright point light) with the sound too - can i do that with soundcue?
Last edited by billy7777; 05-27-2010 at 03:10 PM.
Read the documentation on SoundCues. Sounds aren't Wavs, they're imported into the editor as Sounds, and then you create a SoundCue from it, which tells the engine what settings to play the sound with (you can add filters and things like that to it).
As for the other question, its an extremely broad topic and theres plenty of tutorials around on Kismet. I recommend you either grab the video tutorials that are on UDN or get yourself the Mastering Unreal books.
Thanks again for posting... but I must be missing something... I figured this would be a real simple question.
I have search the internet for "random" and "udk" and come up with very little
I even went to "wiki.beyondunreal.com" - I cannot find a random() command - I am sure there is someway to create a random event, right?
I just kind of figured there's got to be a "random trigger" in kismet that you can attach to...
- a play sound event
- a matinee event
The UnrealScript code is 'Rand()' I believe.
The way to create Randomness in Kismet would be to use the Random Int node (if it exists), then do 'Compare Int' for each possible result, and if it matches then fire the event you want.
In Kismet under Switch is a Random Switch, you might give that a try for anyone on this thread.