Results 1 to 7 of 7
  1. #1
    The Sacrifice
    Join Date
    May 2010
    Posts
    302

    Default 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)

    Thanks
    Last edited by billy7777; 05-27-2010 at 01:53 PM.

  2. #2
    MSgt. Shooter Person
    Join Date
    Mar 2009
    Location
    Victoria, Australia
    Posts
    419

    Default

    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

  3. #3
    The Sacrifice
    Join Date
    May 2010
    Posts
    302

    Default

    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?

    Thanks
    Last edited by billy7777; 05-27-2010 at 02:10 PM.

  4. #4
    MSgt. Shooter Person
    Join Date
    Mar 2009
    Location
    Victoria, Australia
    Posts
    419

    Default

    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.

  5. #5
    The Sacrifice
    Join Date
    May 2010
    Posts
    302

    Default

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

    Thanks

  6. #6
    MSgt. Shooter Person
    Join Date
    Mar 2009
    Location
    Victoria, Australia
    Posts
    419

    Default

    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.

  7. #7
    MSgt. Shooter Person
    Join Date
    Jun 2011
    Posts
    46

    Default

    In Kismet under Switch is a Random Switch, you might give that a try for anyone on this thread.


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.