Guys, how do I create a random hitfx?

egeu

New member
I have often seen people using script for sounds in general, but I would like an example of a script that randomizes between "hitfx 1" and "hitfx 2".
 
egeu this method uses one hitflash entity with both effects one as "anim idle" and the other as "anim follow1" normally you would make a animationscript file but the method I provided your can use on any mod. If you want to see this is effect in action go to the scripting tutorial in my signature and download the example game then replace the flash.txt file with the example below. hope that helped.

Code:
# Hit flash

name	Flash
type	none
shadow	0

anim idle
	loop	0
	delay	3
	offset	36 51
	frame 	none
	@cmd	rand()%2==0?changeentityproperty(getlocalvar("self"),"animation",openborconstant("ANI_FOLLOW1")): "msmalik681"
	frame	none
	delay	6
	frame	data/chars/misc/flash000.gif
	frame	data/chars/misc/flash001.gif
	frame	data/chars/misc/flash002.gif
	frame	data/chars/misc/flash003.gif
	frame	data/chars/misc/flash004.gif
	frame	data/chars/misc/flash005.gif
	frame	data/chars/misc/flash006.gif
	frame	data/chars/misc/flash007.gif
	frame	data/chars/misc/flash008.gif
	frame	data/chars/misc/flash009.gif
	frame	data/chars/misc/flash010.gif

anim follow1
	loop	0
	delay	6
	offset	36 51
	drawmethod tintmode 1
	drawmethod tintcolor 0_0_255 #added a blue tint to see the difference.
	frame	data/chars/misc/flash000.gif
	frame	data/chars/misc/flash001.gif
	frame	data/chars/misc/flash002.gif
	frame	data/chars/misc/flash003.gif
	frame	data/chars/misc/flash004.gif
	frame	data/chars/misc/flash005.gif
	frame	data/chars/misc/flash006.gif
	frame	data/chars/misc/flash007.gif
	frame	data/chars/misc/flash008.gif
	frame	data/chars/misc/flash009.gif
	frame	data/chars/misc/flash010.gif
 
Back
Top Bottom