[solved] Z axis issue.

O Ilusionista

Captain 100K
Hi guys, I am having an issue with the Z velocity.
I have an enemy which spawns another enemy when the first one dies, but it spawns the second enemy on a specific animation just to make it fall on the screen and, when it reaches 200 in z axis, it will spawn an effect and dies - this is to simulate a second enemy falling from a flying bike and diving on the water.

But in all my tests, the second enemy never flies towards the screen. Most of times, it just get stuck on the screen. I can make it flies upward (-z) but never downward (z+), toward the screen.

What I am doing wrong? I just want to make it move on the Z axis, the other ones are not required.

The spawn code:
@cmd spawnAni "afx" 0 0 0 "ANI_FOLLOW11" -2 0 4

The enemy code:

anim follow11
loop
0
delay
10
offset
90 116
@script
void self = getlocalvar("self");
int z = getentityproperty(self,"z");
if(z >= 200){
shooter2 ("splash",20,0,5,-6,0,0);
killentity(self);
}
@end_script
@cmd
minZ 0
@cmd
maxZ 0
@cmd
velo001 2 4 4
frame
data/chars/enemies/soldier/fall1.gif
delay
1000
movez
8
frame
data/chars/enemies/soldier/fall2.gif
frame
data/chars/enemies/soldier/fall3.gif
 
Not sure what you're after, but if all you want is an entity to fly into or away from the screen, you don't need to spawn a second one. Changing the subject_to_z properties and layer settings on the fly will do that just fine.

Are these what you are going for? Neither of them use custom sprites, spawns, or even attack types. It's all through calculation and OpenBOR's drawmethod capability - and that was ~6 years ago.

The Mister T.
Ff_chronicals_mister_t.gif


Have a drink.
ff_chronicals_water.gif
 
Oh I remember that effect, its pretty cool. You should release it someday :)

What I was after is this: the red thing on this image is an enemy riding a flying bike. When you destroy it, the rider eject and fall on the water
NDVxvRD.png


I solved this issue changing the spawn code for a shooter code (toss) and it works good.

Then, I discovered that some entities were not working the way they should, with issues in their Z or landframe. Finally, I've found that when I keep moving (editing files) from OSX to Windows, some files got corrupted (they got encoded for Machintosh and windows can't read them perfectly). It took me hours to find it. Luckly, I had copies from my Dropbox so I recovered an old backup and everything is fine now :)
 
Back
Top Bottom