Help with reactfx script

esn23

Active member
Hey guys sorry to bug you again but im having issues using reactfx.. They work perfectly when im on normal ground but when i try to use it on a platform the effect loops over and over then falls though the platform.. It is when the player dies i think.. I'm not too sure what im doing wrong.. Any help would be greatly appreciated and thanks in advance.

This is the script :

name ReactFX1
type obstacle
subject_to_platform 1
subject_to_wall 1
subject_to_hole 1
no_adjust_base 0
palette none


anim bpain
@script
if(frame == 6){
void self = getlocalvar("self");
killentity(self);
}
@end_script
loop 1
delay 5
offset 68 109
frame data/chars/misc/reaction/flmmed1.png
frame data/chars/misc/reaction/flmmed2.png
frame data/chars/misc/reaction/flmmed1.png
frame data/chars/misc/reaction/flmmed2.png
frame data/chars/misc/reaction/flmmed1.png
frame data/chars/misc/reaction/flmmed2.png
frame data/chars/misc/reaction/flmmed1.png

anim burn
@script
if(frame > 0){
void self = getlocalvar("self");
int y = getentityproperty(self, "a");
int b = getentityproperty(self, "base");

if(y == b){
killentity(self);
}
}
@end_script
loop 1
delay 5
offset 68 109
frame data/chars/misc/reaction/flmmed1.png
frame data/chars/misc/reaction/flmmed2.png
frame data/chars/misc/reaction/flmmed1.png
frame data/chars/misc/reaction/flmmed2.png
frame data/chars/misc/reaction/flmmed1.png
frame data/chars/misc/reaction/flmmed2.png
frame data/chars/misc/reaction/flmmed1.png
frame data/chars/misc/reaction/flmmed2.png
frame data/chars/misc/reaction/flmmed1.png
frame data/chars/misc/reaction/flmmed2.png
frame data/chars/misc/reaction/flmmed1.png
frame data/chars/misc/reaction/flmmed2.png


anim spain
@script
if(frame == 6){
void self = getlocalvar("self");
killentity(self);
}
@end_script
loop 1
delay 5
offset 68 109
frame data/chars/misc/reaction/shoM1.png
frame data/chars/misc/reaction/shoM2.png
frame data/chars/misc/reaction/shoM1.png
frame data/chars/misc/reaction/shoM2.png
frame data/chars/misc/reaction/shoM1.png
frame data/chars/misc/reaction/shoM2.png
frame data/chars/misc/reaction/shoM1.png

anim shock
@script
if(frame > 0){
void self = getlocalvar("self");
int y = getentityproperty(self, "a");
int b = getentityproperty(self, "base");

if(y == b){
killentity(self);
}
}
@end_script
loop 1
delay 5
offset 68 109
frame data/chars/misc/reaction/shoM1.png
frame data/chars/misc/reaction/shoM2.png
frame data/chars/misc/reaction/shoM1.png
frame data/chars/misc/reaction/shoM2.png
frame data/chars/misc/reaction/shoM1.png
frame data/chars/misc/reaction/shoM2.png
frame data/chars/misc/reaction/shoM1.png
frame data/chars/misc/reaction/shoM2.png
frame data/chars/misc/reaction/shoM1.png
frame data/chars/misc/reaction/shoM2.png
frame data/chars/misc/reaction/shoM1.png
frame data/chars/misc/reaction/shoM2.png


This is the script I use in the characters and enemies :
anim bpain
@script
if(frame==0)
{
void self = getlocalvar("self");
void e;
clearspawnentry();
setspawnentry("name", "ReactFX");
e = spawn();
bindentity(e, self,0,1,0,1,1);
}
@end_script
delay 30
offset 66 114
bbox 51 53 28 61
frame data/chars/misc/empty.gif

anim spain
@script
if(frame==0)
{
void self = getlocalvar("self");
void e;
clearspawnentry();
setspawnentry("name", "ReactFX");
e = spawn();
bindentity(e, self,0,1,0,1,1);
}
@end_script
delay 30
offset 66 114
bbox 51 53 28 61
frame data/chars/misc/empty.gif


thanks again for any help.
 
anim bpain
@script
if(frame==0)
{
void self = getlocalvar("self");
void e;
clearspawnentry();
setspawnentry("name", "ReactFX");
e = spawn();
bindentity(e, self,0,1,0,1,5);
}
@end_script
delay 30
offset 66 114
bbox 51 53 28 61
frame data/chars/misc/empty.gif

anim spain
@script
if(frame==0)
{
void self = getlocalvar("self");
void e;
clearspawnentry();
setspawnentry("name", "ReactFX");
e = spawn();
bindentity(e, self,0,1,0,1,5);
}
@end_script
 
Use spawnBind to get that trick. Forget setspawnentry. The problem is not ReactFX itself, but the enemy character or whichever has it.

So, instead of this:

Code:
anim    shock
@script
    if(frame==0)
    {
        void self = getlocalvar("self");
        void e;
        clearspawnentry();
        setspawnentry("name", "ReactFX");
        e = spawn();
        bindentity(e, self,0,1,0,5,1);
    }
    @end_script   
    delay    30
    landframe    2
    offset    75 153
    frame    data/chars/misc/empty.gif
    delay    300
    frame    data/chars/misc/empty.gif
    delay    20
    frame    data/chars/misc/empty.gif
    frame    data/chars/MalePur1/fall3.png

You should go with this:

Code:
anim    shock
    delay    30
    landframe    2
    offset    75 153
    @cmd spawnBind "ReactFX" 0 0 0 1 1
    frame    data/chars/misc/empty.gif
    delay    300
    frame    data/chars/misc/empty.gif
    delay    20
    frame    data/chars/misc/empty.gif
    frame    data/chars/MalePur1/fall3.png

EDIT: This is spawnBind here. I'm sure you have it in spawn.h in the library folder, man.

Code:
void spawnBind(void Name, float dx, float dy, float dz, int Dir, int Flag)
{ // Spawn entity and bind it
   void self = getlocalvar("self");
   void Spawn;

   Spawn = spawn01(Name, dx, dy, dz);
   bindentity(Spawn, self, dx, dz, dy, Dir, Flag);
   return Spawn;
}
 
@esn23: I've checked the issue again and found a solution, however this might require extra work cause you'll have to do these in all characters text.

First step is what I've mentioned above which is changing bindentity setting.
Second step give characters DEATH animation. No need special frames, just lying down sprite is sufficient.
Third step set death 2 in their header text.

The idea is when character die from burning or shock, they'll perform DEATH animation. This change will trigger ReactFX to remove itself cause it doesn't have DEATH animation. Thus solving the issue :D
 
Back
Top Bottom