playMaker

Author Topic: Random sound and playlist  (Read 2236 times)

Tomasz

  • Playmaker Newbie
  • *
  • Posts: 34
Random sound and playlist
« on: August 10, 2016, 10:07:28 AM »
Hi!
I'm a complete amateur in Unity and I'm looking for solutions for audio.
I bought Playmaker and I started to build my game.
But my sounds are highly complicated, and I wonder if I can do it with PlayMaker.

Is it possible to do:

On my map in the game I have point A.
The player can come to this point from three other precisely located points on the map.
Depending on from which point enter to point A take place, such a list of sound will be played.
The list of sounds are sentences of the narrator, who leads the player.
My game is mainly based on the sounds.
However, part of sentences is random.

To give an example - this is sample list for the entry to point A from point B:

- Good day! / Hello! / How are you! (this are three posibbilities).
- You've come from the east. / You come from far away (this are also sounds to random playing).
- Our village is small but you will not be bored.
- If you want to get a the task, go to the sheriff.

As you can see above, the first two sentences may be different. I would like to be played randomly during playback of the entire playlist.

So I have two problem to solve:
1. Different playlist dependent on the direction of entry.
2. Some of sound on playlists must be random.

For every answer I would be very grateful. This may be a tutorial that shows among the various issues this one what I need.

kavery

  • Full Member
  • ***
  • Posts: 149
Re: Random sound and playlist
« Reply #1 on: August 10, 2016, 11:34:52 AM »
Probably a lot of ways to do this, but if it were me I'd do something like this. When entering the varying start locations, activate a unique game object that contains a custom FSM programmed to wait and play a random sound.

Make a unique GO with FSM for each starting location ie location B. Have these turned off at start time. When you are in B you would activate 'location B'. The FSM on location B would wait in the start state until it knows that you entered 'A' - either by a triggered collision box or an event sent from A.

Inside each custom FSM, you can create a state for each sound you want for that location set. When a trigger or event defines that you arrived to A, jump to a new state that has multiple events pointed to each one of your unique sound states. This new state should contain the action 'random event'. This will randomly pick a state to go to and play that sound. Make a final state to turn the GO back off.
 
« Last Edit: August 10, 2016, 11:37:12 AM by kavery »

Tomasz

  • Playmaker Newbie
  • *
  • Posts: 34
Re: Random sound and playlist
« Reply #2 on: August 11, 2016, 03:04:47 AM »
uhhh, it looks pretty complicated
and that means I will have a lot of wild work ;-)

kavery

  • Full Member
  • ***
  • Posts: 149
Re: Random sound and playlist
« Reply #3 on: August 11, 2016, 08:15:39 AM »
hehe .. it's actually not too bad once you set it up and get familiar with it. It might help with other solutions down the road as well. I use this for a lot of things. Good luck!