Dropdead script is devastating to the players on the left side

oldyz

Well-known member
This account is temporarily muted.
trying to fix the bonus level from hell,

basically i have tried changing values, changing the checkwall to checkhole, adding lines of script but nothing seems to work

everytime players fall off the left side of the Van, they lose all their lives
here is the script responsible for the floor "splat"

Code:
void main(){
    int i, dx,dz;
    void ent, parent;
    int ent_max = openborvariant("ent_max");
    for(i=0; i<ent_max; i++){
        ent = getentity(i);
        if(getentityproperty(ent, "exists")){
            parent = getentityproperty(ent, "parent");
            if(!parent || getentityproperty(parent, "type")!=openborconstant("TYPE_PLAYER")){
                if(getentityproperty(ent, "x")<-500) killentity(ent);
                if( getentityproperty(ent, "setlayer")<400
                    && getentityproperty(ent, "model")!="aramer"
                    && (getentityproperty(ent, "type")==openborconstant("TYPE_ENEMY") ||
                    getentityproperty(ent, "type")==openborconstant("TYPE_PLAYER") ||
                    getentityproperty(ent, "type")==openborconstant("TYPE_OBSTACLE") ||
                    getentityproperty(ent, "type")==openborconstant("TYPE_NONE") ||
                    getentityproperty(ent, "aiflag", "blink")==1 ||
                    getentityproperty(ent, "setlayer")==5)
                    //&& !(getentityproperty(ent, "type")==openborconstant("TYPE_PLAYER") &&(getentityproperty(ent, "animationid")==openborconstant("ANI_SPAWN") || getentityproperty(ent, "animationid")==openborconstant("ANI_RESPAWN")))
                ){
                    if(0==getentityproperty(ent, "base")){
                        if( getentityproperty(ent, "a")<10 ){
                            if(getentityproperty(ent, "health")>0) {damageentity(ent, ent, 10000, 1, openborconstant("ATK_NORMAL5")); }
                            changeentityproperty(ent, "velocity", -3.5, 0, 0);
                            changeentityproperty(ent, "subject_to_wall", 0);
                            changeentityproperty(ent, "no_adjust_base", 1);
                            changeentityproperty(ent, "subject_to_screen", 0);
                            changeentityproperty(ent, "setlayer", -2);
                            changeentityproperty(ent, "position", getentityproperty(ent, "x"), getentityproperty(ent, "z"), 0);
                        }else if( getentityproperty(ent, "a")<50){
                            bindentity(ent, NULL());
                            if(getentityproperty(ent, "x")<290 && getentityproperty(ent, "x")>100){
                                changeentityproperty(ent, "position", 290, getentityproperty(ent, "z"), getentityproperty(ent, "a"));
                            }
                        }
                    }else if(getentityproperty(ent, "dead") && 0==checkwall(getentityproperty(ent, "x")+100, getentityproperty(ent, "z")) ){
                            changeentityproperty(ent, "base", 0);
                            changeentityproperty(ent, "no_adjust_base", 1);
                    }
                }
            }
        }
    }
    
}

even tried to modify the script to see if i could create buffer zones to the left or right of the Van, but no dice,
anything to the right of these apparent value range
if(getentityproperty(ent, "x")<290 && getentityproperty(ent, "x")>100){
results in loss of all lives

here are the level.txt Van wall numbers:

##### auto wall ####
wall 95 245 0 0 265 255 40 120
 
dropdead script seems to be spawned as child of other entity even though it checks other entity's position.

Anyways, nothing in that script does something which could kill or devastate any entity falling to the left of the van.
There's this line:
C:
if(getentityproperty(ent, "x") < -500){
   killentity(ent);
 }

which could drain all of player lives but only if player could go offscreen 500 pixels to the left.

TLDR, IMO there might be other cause of this devastation such as respawning mechanic/script which isn't compatible with falling to the left of the van.
 
@Bloodbane

i fixed the problem, but it affects the timing of enemy spawns big time, so much that the gargoyle character takes too long to appear, here is the new script:

Code:
void main(){
    int i, dx,dz;
    void ent, parent;
    int ent_max = openborvariant("ent_max");
    for(i=0; i<ent_max; i++){
        ent = getentity(i);
        if(getentityproperty(ent, "exists")){
            parent = getentityproperty(ent, "parent");
            if(!parent || getentityproperty(parent, "type")!=openborconstant("TYPE_PLAYER")){
                            if(getentityproperty(ent, "x")<-500 && getentityproperty(ent, "x")>880)
killentity(ent);
                if( getentityproperty(ent, "setlayer")<400
                    && getentityproperty(ent, "model")!="aramer"
                    && getentityproperty(ent, "model")!="aramerX"
                    && getentityproperty(ent, "model")!="aramerX-2"
                    && getentityproperty(ent, "model")!="aramerX-3"
                    && getentityproperty(ent, "model")!="aramerX-7"
                    && getentityproperty(ent, "model")!="aramerX-10"
                    && (getentityproperty(ent, "type")==openborconstant("TYPE_ENEMY") ||
                    getentityproperty(ent, "type")==openborconstant("TYPE_PLAYER") ||
                    getentityproperty(ent, "type")==openborconstant("TYPE_OBSTACLE") ||
                    getentityproperty(ent, "type")==openborconstant("TYPE_NONE") ||
                    getentityproperty(ent, "aiflag", "blink")==1 ||
                    getentityproperty(ent, "setlayer")==5)
                    //&& !(getentityproperty(ent, "type")==openborconstant("TYPE_PLAYER") &&(getentityproperty(ent, "animationid")==openborconstant("ANI_SPAWN") || getentityproperty(ent, "animationid")==openborconstant("ANI_RESPAWN")))
                ){
                    if(0==getentityproperty(ent, "base")){
                        if( getentityproperty(ent, "a")<10 ){
                            if(getentityproperty(ent, "health")>0) {damageentity(ent, ent, 10000, 1, openborconstant("ATK_NORMAL5")); }
                            changeentityproperty(ent, "velocity", -3.5, 0, 0);
                            changeentityproperty(ent, "subject_to_wall", 0);
                            changeentityproperty(ent, "no_adjust_base", 1);
                            changeentityproperty(ent, "subject_to_screen", 0);
                            changeentityproperty(ent, "setlayer", -2);
                            changeentityproperty(ent, "position", getentityproperty(ent, "x"), getentityproperty(ent, "z"), 0);
                        }else if( getentityproperty(ent, "a")<50){
                            bindentity(ent, NULL());
                            if(getentityproperty(ent, "x")<399 && getentityproperty(ent, "x")>356){
                                changeentityproperty(ent, "position", 420, getentityproperty(ent, "z"), getentityproperty(ent, "a"));
                            }
                        }
                    }else if(getentityproperty(ent, "dead") && 0==checkwall(getentityproperty(ent, "x")-100, getentityproperty(ent, "z")) ){
                            changeentityproperty(ent, "base", 0);
                            changeentityproperty(ent, "no_adjust_base", 1);
                    }
                }
            }
        }
    }
    
}

this portion of the script
if(getentityproperty(ent, "x")<399 && getentityproperty(ent, "x")>356){
changeentityproperty(ent, "position", 420, getentityproperty(ent, "z"), getentityproperty(ent, "a"));
only seems to control aestetics where if you fall to the right of the Van, it repositions an entity so it seems like you roll off the bumper...

this other portion,
}else if(getentityproperty(ent, "dead") && 0==checkwall(getentityproperty(ent, "x")-100, getentityproperty(ent, "z")) ){

if i make it +100 or -100 seemed to make no difference
 
Back
Top Bottom