collapse

Author Topic: problem with playsnd  (Read 1565 times)

0 Members and 1 Guest are viewing this topic.

Offline Demongorne

  • Initiate
  • **
  • Posts: 81
  • Last Login:March 19, 2022, 06:22:07 AM
    • Email
problem with playsnd
« on: March 12, 2015, 01:26:35 PM »
I would like have two sound effect for the same animation in such a way that the sounds effects are played randomly

I put this in statedef 3700  -   
[State 5300,PlaySnd]
type = PlaySnd
trigger1 = time= 0
value = 5300,1



Offline Cyanide

  • MUGEN Content Architect
  • *****
  • Posts: 813
  • Last Login:March 29, 2019, 06:52:34 AM
    • Mugen Obscurity
Re: problem with playsnd
« Reply #1 on: March 13, 2015, 12:48:16 AM »
That will, as is pretty obvious, only play one sound. Which is 5300,1. If you want 2, we'll make it simple

5300,1
5300,2

set the value to
value = 5300, 1+random%1

Alternatively
value = 5300,ifelse(random < 500, 1,2)

Offline Demongorne

  • Initiate
  • **
  • Posts: 81
  • Last Login:March 19, 2022, 06:22:07 AM
    • Email
Re: problem with playsnd
« Reply #2 on: March 13, 2015, 06:15:20 AM »
It works! Thanks a lot man just another thing: if I want have 3 sound effects for the same animation wich code I have use?

Offline Chimoru

  • Forum Member
  • ***
  • Posts: 275
  • Country: United States us
  • Last Login:November 03, 2023, 05:50:34 PM
    • Chimoru's MUGEN
    • Email
Re: problem with playsnd
« Reply #3 on: March 13, 2015, 09:59:50 AM »
If you used this code:

value = 5300, 1+random%1

This randomly plays sounds 5300, 1 and 5300, 2

Then you just add another to the random, so

value = 5300, 1+random%2

Now it will randomly play  sounds 5300, 1 , 5300, 2 and 5300, 3 because you told it to play 5300,1 and the next two sounds in the 5300 category randomly.  (however if you were missing the 5300,2 & 5300,3 sounds in your SND file, it would play nothing because it looks for them numerically regardless of what is actually there. It doesn't just skip to whatever comes after 5300, 1 in the SND file)

in this case 5300, 2 & 5300, 3 are represented by the "+random%2"

So if you want to add more sounds in that order, perhaps a 5300, 4, then the random has to be a +random%3 now.

Does that make sense?

You can also use the +random% code for animations and POS as well.
« Last Edit: March 13, 2015, 10:06:42 AM by Chimoru »
My MUGEN YouTube account where you can see edits I'm working on.
http://www.youtube.com/channel/UCMLJDPO5mPwseYXGv-ZE53w

Offline Demongorne

  • Initiate
  • **
  • Posts: 81
  • Last Login:March 19, 2022, 06:22:07 AM
    • Email
Re: problem with playsnd
« Reply #4 on: March 13, 2015, 12:18:15 PM »
I see yhank yu for your explanation also I would like that the sound is played for 120 ticks so I try this

[State 5300,PlaySnd]
type = PlaySnd
trigger1 = time= [0,120]
value = 5300,ifelse(random < 500, 1,2)

but the sound is not played correctly

Offline Chimoru

  • Forum Member
  • ***
  • Posts: 275
  • Country: United States us
  • Last Login:November 03, 2023, 05:50:34 PM
    • Chimoru's MUGEN
    • Email
Re: problem with playsnd
« Reply #5 on: March 13, 2015, 03:03:38 PM »
Hmm.. Lemme think.
Maybe something like this?

    [State 5300, PlaySnd]
    type = PlaySnd
    trigger1 = time= 0
    value = 5300,ifelse(random < 500, 1,2)
    loop = 1
     
    [State 5300, StopSnd]
    type = stopsnd
    trigger1 = time = 120

That way the sound starts right away and repeats on loop, but then after 120 ticks, the StopSnd activates and turns it off. Though with a randomer in there, it might repeat random noises...

I'm not SURE on that, but worth a shot.
My MUGEN YouTube account where you can see edits I'm working on.
http://www.youtube.com/channel/UCMLJDPO5mPwseYXGv-ZE53w

Offline Demongorne

  • Initiate
  • **
  • Posts: 81
  • Last Login:March 19, 2022, 06:22:07 AM
    • Email
Re: problem with playsnd
« Reply #6 on: March 13, 2015, 05:40:07 PM »
I typed this  but the sound is stopped a bit before the animation end

[State 6300, StopSnd]
type = StopSnd
trigger1 = time=120
value = 5300, 1
channel = 0

Offline Chimoru

  • Forum Member
  • ***
  • Posts: 275
  • Country: United States us
  • Last Login:November 03, 2023, 05:50:34 PM
    • Chimoru's MUGEN
    • Email
Re: problem with playsnd
« Reply #7 on: March 13, 2015, 05:57:17 PM »
Well I don't know how long your animation is. If it's longer than 120 ticks, then keep increasing the time until it's at the length you need it at.
My MUGEN YouTube account where you can see edits I'm working on.
http://www.youtube.com/channel/UCMLJDPO5mPwseYXGv-ZE53w

Tags:
 


* IMT Facebook

Help us by Donating!

IMT Discord

Join us at our Discord! Click the image below!

* IMT Shoutbox

Sorry, this shoutbox does not exist.

* Recent Posts

D2TD VS Showcase Thread by D2TD
[May 12, 2024, 10:20:11 AM]


Classic VS : Athena by ELECTRO
[May 10, 2024, 02:44:09 PM]


Ballroom Hallway (1.1 Only/AIGS) by Vegaz by LightFlare
[May 09, 2024, 11:53:48 AM]


Neon Light Force Demo by kyoman
[May 08, 2024, 12:50:05 PM]


Lasombra's IKEMEN Go Interactive Stages' WIP Topic and Releases by Lasombra Demon
[April 21, 2024, 12:09:20 PM]


Ultimate E. Honda + stage by ELECTRO
[April 18, 2024, 09:47:24 PM]


Sunset Beach (1.1 Only/AIGS) by Vegaz by LightFlare
[April 16, 2024, 06:55:00 PM]


Wonder Twins 2.0 by brucewayne74, Shining and Skhsato123 by brucewayne74
[April 05, 2024, 06:07:48 PM]


X-Men Training Room (Bright & Dark) Stage 1.1 & 1.0 by MatreroG
[April 05, 2024, 10:55:29 AM]


[WIP] Pocket Dimensional Clash 2 by O Ilusionista
[April 01, 2024, 11:03:03 PM]

* IMT Calendar

May 2024
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4
5 6 7 8 9 10 11
12 13 [14] 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

SimplePortal 2.3.5 © 2008-2012, SimplePortal