MysticalMist
Well-known member
It has been a while since I really focused on OpenBOR in a while so I'm super rusty.
I have a player character that throws a bouncing keg as a attack. I was able to add a dust effect for its FALL animation just fine, but I've yet to do the same for its idle.
Here is the script for it:
Addition: I guess while I'm here, I just realized I could ask something else. Is there a way to swap out the normal falling collision sound for the klunk.wav instead?
I have a player character that throws a bouncing keg as a attack. I was able to add a dust effect for its FALL animation just fine, but I've yet to do the same for its idle.
Here is the script for it:
Code:
name vkeg1
speed 9
health 1
remove 0
type none
subtype flydie
speed 9
gfxshadow 1
lifespan 5
offscreenkill 500
falldie 0
bounce 1
nodieblink 1
dust dust dust dust
candamage enemy obstacle
animationscript data/scripts/script.c
anim idle
bouncefactor 1
loop 1
@script
void self = getlocalvar("self");
int Dir = getentityproperty(self, "direction");
int x = getentityproperty(self, "x");
int y = getentityproperty(self, "y");
int z = getentityproperty(self, "z");
int C;
if(Dir == 1){
C = 6;
} else {
C = -6;
}
if(frame > 0 && y <= checkwall(x+C,z)){
changeentityproperty(self, "velocity", 0, 0, 0);
changeentityproperty(self, "subject_to_gravity", 1);
changeentityproperty(self, "animation", openborconstant("ANI_FALL"));
}
@end_script
delay 5
offset 31 35
attack.block.penetrate 0
attack.damage.force 40
attack.damage.type 1
attack.effect.hit.flash.disable 0
attack.position.x -2
attack.position.y 5
attack.reaction.fall.force 999
attack.reaction.fall.velocity.x 2.0
attack.reaction.fall.velocity.y 2.0
attack.reaction.pause.time 0
attack.size.x 68
attack.size.y 56
attack.size.z.background 0
frame data/chars/vortex/barrel/0.png
frame data/chars/vortex/barrel/1.png
frame data/chars/vortex/barrel/2.png
frame data/chars/vortex/barrel/3.png
frame data/chars/vortex/barrel/4.png
frame data/chars/vortex/barrel/5.png
frame data/chars/vortex/barrel/6.png
frame data/chars/vortex/barrel/7.png
anim fall
bouncefactor 2
loop 0
delay 99
offset 31 35
landframe 1 dust
sound data/sounds/klunk.wav
frame data/chars/vortex/barrel/5.png
delay 40
frame data/chars/vortex/barrel/4.png
delay 3
frame data/chars/vortex/barrel/4.png
frame data/chars/misc/empty.gif
frame data/chars/vortex/barrel/4.png
frame data/chars/misc/empty.gif
frame data/chars/vortex/barrel/4.png
frame data/chars/misc/empty.gif
frame data/chars/vortex/barrel/4.png
frame data/chars/misc/empty.gif
frame data/chars/vortex/barrel/4.png
frame data/chars/misc/empty.gif
Addition: I guess while I'm here, I just realized I could ask something else. Is there a way to swap out the normal falling collision sound for the klunk.wav instead?