DJGameFreakTheIguana
Active member
Working on new enemies for Sonic ZX and I'm running into some scripting issues. First here the scripts in question within escript.c.
Here's how they're implemented. Loop 1 is for testing the attack without waiting for the next time for them to pull it.
Here's my issues.
-Shooter for some reason, is making the shot jump in the air like a bomb, when not only is there nothing telling it to do so but it's copied from an attack that's long since used the same setting but correctly.
-Tosser is working as intended now but after I set the 3rd digit to 3, it was originally 0 because it's suppose to be dz but for some reason is controlling vx.
These script work fine any other time though, but I got to thinking, I'm using OpenBORv6412, maybe that has something to do with it? Anyway I could find workarounds but I'd like some consistency if it can be helped, these things are throwing me off, and I already struggle with scripting.
x)
void tosser(void Bomb, float dx, float dy, float dz, float Vx, float Vy, float Vz)
{ // Tossing bomb with desired speed
void self = getlocalvar("self");
int Direction = getentityproperty(self, "direction");
int x = getentityproperty(self, "x");
int y = getentityproperty(self, "a");
int z = getentityproperty(self, "z");
void Shot;
if (Direction == 0){ //Is entity facing left?
dx = -dx; //Reverse X direction to match facing
}
Shot = projectile(Bomb, x+dx, z+dz, y+dy, Direction, 0, 1, 0);
tossentity(Shot, Vy, Vx, Vz);
changeentityproperty(Shot, "speed", Vx);
}
void shooter(void Shot, float dx, float dy, float dz, float Vx, float Vy, float Vz)
{ // Shooting projectile with speed control
void self = getlocalvar("self");
int Direction = getentityproperty(self, "direction");
int x = getentityproperty(self, "x");
int y = getentityproperty(self, "a");
int z = getentityproperty(self, "z");
void vShot;
if (Direction == 0){ //Is entity facing left?
dx = -dx; //Reverse X direction to match facing
}
vShot = projectile(Shot, x+dx, z+dz, y+dy, Direction, 1, 0, 0);
changeentityproperty(vShot, "velocity", Vx, Vz, Vy);
changeentityproperty(vShot, "speed", Vx);
}
Here's how they're implemented. Loop 1 is for testing the attack without waiting for the next time for them to pull it.
anim attack1
range 50 100
delay 5
offset 94 87
bbox 87 54 18 26
frame data/chars/BombAngel/Walk0.gif
frame data/chars/BombAngel/Walk1.gif
frame data/chars/BombAngel/Walk0.gif
frame data/chars/BombAngel/Walk1.gif
frame data/chars/BombAngel/Walk0.gif
frame data/chars/BombAngel/Walk1.gif
frame data/chars/BombAngel/Walk0.gif
frame data/chars/BombAngel/Walk1.gif
frame data/chars/BombAngel/Walk0.gif
frame data/chars/BombAngel/Walk1.gif
@cmd dasher -1 0 0 1
@cmd shooter "BMBAA" 0 0 0 7 0 0
frame data/chars/BombAngel/A1-0.gif
frame data/chars/BombAngel/A1-1.gif
@cmd shooter "BMBAA" 0 0 0 7 0 0
frame data/chars/BombAngel/A1-0.gif
frame data/chars/BombAngel/A1-1.gif
@cmd shooter "BMBAA" 0 0 0 7 0 0
frame data/chars/BombAngel/A1-0.gif
frame data/chars/BombAngel/A1-1.gif
@cmd shooter "BMBAA" 0 0 0 7 0 0
frame data/chars/BombAngel/A1-0.gif
frame data/chars/BombAngel/A1-1.gif
delay 30
@cmd dasher 0 0 0 1
frame data/chars/BombAngel/Walk0.gif
anim attack2
loop 1
range 0 100
delay 6
offset 94 87
bbox 87 54 20 28
frame data/chars/BombAngel/A2-0.gif
frame data/chars/BombAngel/A2-1.gif
frame data/chars/BombAngel/A2-2.gif
delay 3
@cmd dasher -2 0 0 1
@cmd tosser "BMBAA2" 20 40 3 3 3 0
frame data/chars/BombAngel/A2-3.gif
frame data/chars/BombAngel/A2-4.gif
@cmd dasher -1 0 0 1
@cmd tosser "BMBAA2" 20 40 3 3 2 0
frame data/chars/BombAngel/A2-3.gif
frame data/chars/BombAngel/A2-4.gif
@cmd tosser "BMBAA2" 20 40 3 3 1 0
frame data/chars/BombAngel/A2-3.gif
frame data/chars/BombAngel/A2-4.gif
@cmd dasher 0 0 0 1
delay 8
frame data/chars/BombAngel/A2-1.gif
frame data/chars/BombAngel/A2-2.gif
frame data/chars/BombAngel/A2-1.gif
frame data/chars/BombAngel/A2-2.gif
frame data/chars/BombAngel/A2-1.gif
frame data/chars/BombAngel/A2-2.gif
Here's my issues.
-Shooter for some reason, is making the shot jump in the air like a bomb, when not only is there nothing telling it to do so but it's copied from an attack that's long since used the same setting but correctly.
-Tosser is working as intended now but after I set the 3rd digit to 3, it was originally 0 because it's suppose to be dz but for some reason is controlling vx.
These script work fine any other time though, but I got to thinking, I'm using OpenBORv6412, maybe that has something to do with it? Anyway I could find workarounds but I'd like some consistency if it can be helped, these things are throwing me off, and I already struggle with scripting.
x)