The Daily Click ::. Forums ::. Klik Coding Help ::. random death sound or death animations
 

Post Reply  Post Oekaki 
 

Posted By Message

Trooper_959

The Stupid Rebel

Registered
  02/11/2007
Points
  213
28th April, 2009 at 01:19:32 -

I am trying to perfect my random death animation or death sound and i cant seem to get it to work right. I like have tried times to set alterable values, i have set it to always set alterable value I random (2) and it doesnt work. I got three different deaths i need to get fixed. they either all play the same death when i kill them close together in time and they wont play a certain animation now. You guys know the best way to set this up to make it pretty random like in metal slug games where they got multiple death sounds and animations. Thanks!

 
Is it really worth it to go onto the battlefield? I GOT A CUSTOM RATING SEE???

http://www.freewebs.com/tiredfreakedoutproductions/

http://www.weirdogamez.com



0ko



Registered
  11/01/2009
Points
  318
28th April, 2009 at 01:37:38 -

I aswell am useing random deaths for my game.
okay random(2) means either 1 or 0,so try random(3)+1 which could be 1 2 or 3
for your 3 dieing animations,lets say their number are 12,13,and 14,so If alterable value A <=0
change animation sequence to(use a calculation) random(4)+11.

so if one of those dieing animations finish,destroy character

lemme know if it don't work.

Edited by 0ko

 
n/a

JetpackLover



Registered
  01/03/2007
Points
  212
28th April, 2009 at 01:46:06 -

What I would do in this situation is set up an alterable value called "Deaths" and then I would set up code that says

"Deaths" equals 1 then set death animation 1

"Deaths" equals 2 then set death animation 2

"Deaths" equals 3 then set death animation 3

Now the way to get the randomness of it would be to say something like

Player health is lower or equal to 0 + only one action when event loops then set "Deaths" random(3)+ 1(since random starts with 0)

What this will do is when the players health is lower or equal to 0 it will randomly select deaths 1-3 one time.

Which will give you a random death animation. You can also set up what sounds play during those deaths along with the animation. Or you can make them random even to the animation by setting up a new Alterable value called "Death sound effects" or something like that and do the same thing as the death animation.

Hope that makes sense and if not I'm more than happy to help out some more.

 
http://www.invincibletime.com/

Devlog for HD MMF Game Omulus. Check it out because it's gonna be awesome. http://omulus.tumblr.com/

Follow me on the twitters https://twitter.com/JetpackLover


0ko



Registered
  11/01/2009
Points
  318
28th April, 2009 at 01:47:43 -

oops I meant 12+4,anyway,my way does the animations in one event

 
n/a

Trooper_959

The Stupid Rebel

Registered
  02/11/2007
Points
  213
28th April, 2009 at 01:47:56 -

uh the numbers are 0 1 and 2 for mine so would i just get rid of the +1?

 
Is it really worth it to go onto the battlefield? I GOT A CUSTOM RATING SEE???

http://www.freewebs.com/tiredfreakedoutproductions/

http://www.weirdogamez.com



0ko



Registered
  11/01/2009
Points
  318
28th April, 2009 at 01:49:21 -

well,that's your choice really,I just find 1 2 3 simpler

if it's Random(3) then you add on 13,if it's random(4)+1 you add on 12.

random(3) being 0 1 2 and random(4)+1 being 1 2 3

Edited by 0ko

 
n/a

JetpackLover



Registered
  01/03/2007
Points
  212
28th April, 2009 at 01:53:19 -


Originally Posted by oko
I aswell am useing random deaths for my game.
okay random(2) means either 1 or 0,so try random(3)+1 which could be 1 2 or 3
for your 3 dieing animations,lets say their number are 12,13,and 14,so If alterable value A <=0
change animation sequence to(use a calculation) random(4)+11.

so if one of those dieing animations finish,destroy character

lemme know if it don't work.



Oh nice I see how that works, one event too sweet.

 
http://www.invincibletime.com/

Devlog for HD MMF Game Omulus. Check it out because it's gonna be awesome. http://omulus.tumblr.com/

Follow me on the twitters https://twitter.com/JetpackLover


0ko



Registered
  11/01/2009
Points
  318
28th April, 2009 at 01:55:38 -

yeah,I just wish there was some sort of use a calculation for sounds

 
n/a

Trooper_959

The Stupid Rebel

Registered
  02/11/2007
Points
  213
28th April, 2009 at 01:56:34 -

lol yea but the sound and animations all go on the same value and stuff. youll see what i mean once i give out a beta of my game

 
Is it really worth it to go onto the battlefield? I GOT A CUSTOM RATING SEE???

http://www.freewebs.com/tiredfreakedoutproductions/

http://www.weirdogamez.com



0ko



Registered
  11/01/2009
Points
  318
28th April, 2009 at 01:58:26 -

why not just use my method for animations then apply the sounds for specific animations?
w/e both ways are good

Mine might just be 25% quicker,that's all.

Edited by 0ko

 
n/a

Trooper_959

The Stupid Rebel

Registered
  02/11/2007
Points
  213
28th April, 2009 at 02:06:36 -

it works perfectly its a little to late to change but i think ours are about the same lol but then again this has to work for a metal slug game

 
Is it really worth it to go onto the battlefield? I GOT A CUSTOM RATING SEE???

http://www.freewebs.com/tiredfreakedoutproductions/

http://www.weirdogamez.com


   

Post Reply



 



Advertisement

Worth A Click