When i bind type NONE entity to ENEMY, then binded entity disapepars once enemy goes offscreen

ABK

Well-known member
How to prevent that ?
I tried offscreenkill over 9000 , i tried subject_to_screen 1
Anyone had this issue ?

THe info in logs was never trustworthy for me, also it has my own icon so its probably my own build from who knows when,

I was curious if this was known behaviour and maybe i am missing some flag in "none" entity so it will stop disappearing or parent entity so it will stop "dropping" bind entity, it just disappears without a trace.
I bind it in spawn and its fine until enemy goes offscren for a little bit and comes back without bind entity.

OpenBoR v3.0 Build , Compile Date: Jul 20 2018

------
Just tried in last 3v - OpenBOR v3.0 Build 6391
Still the same, it disappears.So the frankenfix is to reapply it on walk anim unless someone has better idea.
 
How to prevent that ?
I tried offscreenkill over 9000 , i tried subject_to_screen 1
Anyone had this issue ?

THe info in logs was never trustworthy for me, also it has my own icon so its probably my own build from who knows when,

I was curious if this was known behaviour and maybe i am missing some flag in "none" entity so it will stop disappearing or parent entity so it will stop "dropping" bind entity, it just disappears without a trace.
I bind it in spawn and its fine until enemy goes offscren for a little bit and comes back without bind entity.

OpenBoR v3.0 Build , Compile Date: Jul 20 2018

------
Just tried in last 3v - OpenBOR v3.0 Build 6391
Still the same, it disappears.So the frankenfix is to reapply it on walk anim unless someone has better idea.

That's the reason I needed version. I am pretty sure none types are hard coded to vanish off screen no matter what. I'll need to look through source to confirm.

DC
 
How to prevent that ?
I tried offscreenkill over 9000 , i tried subject_to_screen 1
Anyone had this issue ?

THe info in logs was never trustworthy for me, also it has my own icon so its probably my own build from who knows when,

I was curious if this was known behaviour and maybe i am missing some flag in "none" entity so it will stop disappearing or parent entity so it will stop "dropping" bind entity, it just disappears without a trace.
I bind it in spawn and its fine until enemy goes offscren for a little bit and comes back without bind entity.

OpenBoR v3.0 Build , Compile Date: Jul 20 2018

------
Just tried in last 3v - OpenBOR v3.0 Build 6391
Still the same, it disappears.So the frankenfix is to reapply it on walk anim unless someone has better idea.
@bWWd in what offscreen axis (X or Z) it disappears? Just tested it in a BOR mod using the 6391 and looks fine, at least in the X axis.

I had some problems when spawning enemies with weapons already equipped at a long offscreen value, once in the SORX every weapon is a type "none" entity binded to the characters. However, I solved it easily by using the line below.

Code:
changeentityproperty(vSpawn, "offscreenkill", openborconstant("MAX_INT"));
 
in x axis, i have rider on top of animal, rider is bind, when animal goes offscren - rider disappears and animal comes back to onscreen without rider so its a dealbreaker, so i kinda fixed it by rebinding in walk but i do not like it. cause its not always working on frame 0



changeentityproperty(rider , "offscreenkill", openborconstant("MAX_INT")); - This did not work

The problem is when animal attacks - he is stationary during attack , then i go far and scren leaves him behbind offscreen, so then rider disappears.




OK so, i changed TYPE to enemy in header, and then changed it to NONE in spawn and get anims... so far the problem is solved - he does not disapepar anymore.

So now i just wanted to ask - what is best method to bind a rider ? animation script is not ideal with frame 0 which isnt always updated with changes.
I mean not initial bind but adjustments on frame 0 is what im worried about, each animation need to shift bind entity on its 1st frame to different position.
 
Last edited:
but it triggers all the time. so theres nothing inbetween ?
I guess i would have to update frame 0 with updatescript ,and do the remaining frames with animationscript...
 
@bWWd How is your bindentity coded? What value are you using in the bindanimation flag (4 will remove the entity)?

1749510618070.png

In this video the Apple is type none and doesn't disappear, but I don't know if your panel size is bigger than the one I used and may affect the offscreenkill limits.


Here's how I coded the test.

Code:
anim spawn
@script
    void self = getlocalvar("self");
    void vSpawn;
    clearspawnentry();
    setspawnentry("name", "Apple");
    vSpawn = spawn();
    bindentity(vSpawn, self, 0, 1, 100, 0, 0);
@end_script
    loop    0
    offset    38 128
    bbox    25 21 33 110
    delay    10
    frame    data/chars/shermie/idle1.gif

Code:
name        Apple
type        none
health        30
shadow        0
icon        data/chars/items/applicon.gif

anim idle
    loop    0
    delay    4
    offset    8 14
    bbox    0 0 16 16
    frame    data/chars/items/apple.gif
 
im always using 6 , res is 1280x720 and panel size is 6000 wide


Code:
@script
    void self = getlocalvar("self");
    void rider;
    if(frame == 1 && getentityvar(self, "rideroff") != 1) {
       clearspawnentry();
        setspawnentry("name", "orcsit");
        rider = spawn();
        changeentityproperty(rider, "offscreenkill", openborconstant("MAX_INT"));
        bindentity(rider, self, 0, 0, 66, 1, 6, 1); // Bind rider to dino
    }
@end_script

I have more anims than just idle, so maybe thats the issue.


animal header:
Code:
name    dinoride
health    100
speed   35
type    enemy
nolife   1
shadow   0
candamage  npc obstacle player
hostile player obstacle
projectilehit enemy obstacle
dust   dust
throw 2 10
risetime  700
cantgrab 1
paingrab 1
falldie 1
bounce  1
jugglepoints  100
aimove   chasez
animationscript data/scripts/aniscripts.c
palette          data/chars/dino/idle_000.png
alternatepal     data/chars/dino/idle_001.png
alternatepal     data/chars/dino/idle_002.png
alternatepal     data/chars/dino/idle_003.png
alternatepal     data/chars/dino/idle_004.png
offscreenkill   9000
load burndino
load frozdino
load dinoid
load orcsit


rider header ( he is enemy now cause none didnt worked) :

Code:
name    orcsit
health    100
speed  28
type    enemy
nolife   1
shadow   0
candamage  npc obstacle player
hostile player obstacle
projectilehit enemy obstacle
dust   dust
throw 2 10
risetime  700
cantgrab 1
paingrab 1
falldie 1
bounce  1
jugglepoints  100
aimove   chasez
animationscript data/scripts/aniscripts.c
 offscreenkill  9999999
palette          data/chars/orc/idle_000.png
alternatepal     data/chars/orc/red.png
alternatepal     data/chars/orc/green.png
alternatepal     data/chars/orc/idle_003.png
alternatepal     data/chars/orc/idle_004.png
alternatepal     data/chars/orc/idle_005.png
alternatepal     data/chars/orc/idle_006.png
offscreenkill   9000
load burnorc
load frozorc
load orcberz
 
Last edited:
@bWWd Have the orcsit a walk animation? According to my tests the binded entity only disappears when I declare a walk anim, any other works fine.
I have to check if there's any kind of intended behaviour between type none entities removal and walk anim. It happens even with bindanimation at zero.
Try to remove the walk anim and put bindanimation zero, just to check if it's causing the problem in your game.
 
yes he does, cause he needs it, dino has walk and anims have to match
Also i did what you wrote - removed walk, changed 6 to 0 and yes now he wont disappear even having none type.
So the walk is guilty, but what now ? The best fix for me is still changing to enemy and then to none mid spawn /get anim.
 
@bWWd

Ok, I discovered where the problem is. For some reason the engine was programmed to kill type none entities during the walk animation in case it exceeds a certain distance from the screen edge (80px to be more precise).

It didn't happen to me in the SORX because I don't sync binded entity animations using "bindanimation", instead I use scripts to check the owner and trigger specific follow animations at the same frames.

I just compiled an engine test build without the anything_walk() function and the binded entity didn't disappear.
I think that the best way is by changing the binded entity type to npc, in case you have conflicts with type enemy in your game.


1749516081513.png

1749516193798.png
 
Back
Top Bottom