The Daily Click ::. Forums ::. Klik Coding Help ::. sound in mmf2
 

Post Reply  Post Oekaki 
 

Posted By Message

Xio



Registered
  21/01/2008
Points
  218
5th February, 2008 at 17:33:48 -

i know how to use the samples(except music)...i came up with this problem along my game...i record my voice doing an effect like "oof" "agh!" and "nooo!"...i put them in when a monster(active) gets destroyed...but some sound echo-e...and then i said eh its ok because the monster(active) is a ghost so im like "thats cool" but i made up a goomba looking thing from Super Mario and i wanted to put "aww" as the sample it plays when it gets destroyed...but when it gets destroyed it completely stops all samples and plays it with a echo-e voice and i don't know what to do <help>

 
Squigy my blob

maker of music
8-bit music though

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
5th February, 2008 at 17:38:52 -

The monster destroyed event triggers every loop while the destroying animation is playing. The echo is likely your sound being played like 9 times in less than a second.

 
Craps, I'm an old man!

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
5th February, 2008 at 17:41:41 -

Continuing along, the best way to handle it would likely be to play the sound when you tell the monster to be destroyed. I usually use a flag or something like that.
Enemy.Health <= 0 AND Enemy.Flag0 = Off THEN

Destroy Enemy, Set flag 0 = ON, Play sound


This way it only happens once.

 
Craps, I'm an old man!

»xerus



Registered
  28/06/2002
Points
  675

You've Been Circy'd!Game of the Week Winner
5th February, 2008 at 18:38:46 -

I dont think you need the flag there, since the object is being destroyed on that event.

 
n/a

Xio



Registered
  21/01/2008
Points
  218
5th February, 2008 at 18:39:35 -


Originally Posted by Knudde (Shab)
Continuing along, the best way to handle it would likely be to play the sound when you tell the monster to be destroyed. I usually use a flag or something like that.
Enemy.Health <= 0 AND Enemy.Flag0 = Off THEN

Destroy Enemy, Set flag 0 = ON, Play sound


This way it only happens once.





can u explain it better :/

 
Squigy my blob

maker of music
8-bit music though

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
5th February, 2008 at 19:56:40 -

Hold over from TGF, besides if it's shot again while the destroy animation is playing, it'll trigger the even again because the value changed and is still lower than 0. (Again in TGF, maybe that's been fixed in fusion)

@Eric - Uh, that's the code you need to make it work. What do you need explained? It's a straight forward event.



 
Craps, I'm an old man!

Xio



Registered
  21/01/2008
Points
  218
6th February, 2008 at 08:43:48 -

im using fusion

can you send me an example

that's how some guy helped me put checkpointz

 
Squigy my blob

maker of music
8-bit music though

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
6th February, 2008 at 10:00:58 -

You could just add an 'Only once when even loops' to that event.

 
.

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
6th February, 2008 at 16:12:13 -

Umm, I could code you an example, but seriously, it's one event. Exactly how I typed it.

Enemy.Health means whatever value you're using of your enemy active object for the health. When it drops to or below Zero (When you'd destroy the enemy I'm assuming).

 
Craps, I'm an old man!

The Chris Street

Administrator
Unspeakably Lazy Admin

Registered
  14/05/2002
Points
  48487

Game of the Week WinnerClickzine StaffAcoders MemberKlikCast StarVIP MemberPicture Me This Round 35 Winner!Second GOTW AwardYou've Been Circy'd!Picture Me This Round 38 Winner!GOTM December Third Place!!
I am an April FoolKliktober Special Award Tag
6th February, 2008 at 16:59:39 -

Only One Action While Event Loops! Use that, as Andy said, it's built into the event editor. Shabs will work too

 
n/a

Xio



Registered
  21/01/2008
Points
  218
6th February, 2008 at 17:31:25 -

it works but doesnt work on my paticular game :/ ima start over ty

 
Squigy my blob

maker of music
8-bit music though

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
6th February, 2008 at 19:41:03 -

Beware of bugs if you use the only one action when event loops, if two bullets collide at the same time, only one will be destroyed. Unless you use the Overlapping command.

 
Craps, I'm an old man!
   

Post Reply



 



Advertisement

Worth A Click