Level won't progress/end after a particular wave??

MysticalMist

Well-known member
I'm redesigning a level currently and I added some custom intros for my enemies that are called via script within the level file.

For some reason, after all of the enemies are cleared, the level doesn't proceed nor end. Here is the portion of code at the end of the level, and when this is removed, the issue disappears randomly. Though I still want to implement it. I've done this before just fine, so I dunno why it's buggy this time around.

Code:
wait
at 1400

group 3 3
at 1400

spawn TartS
alias Tart
coords 490 273
at 1400

spawn Sanchez
health 100
@script void main() {
   performattack(getlocalvar("self"), openborconstant("ANI_FOLLOW12"));
} @end_script
coords 320 209
map 1
at 1400

spawn TartWindow
health 1
alias Ember
coords 464 213 75
map 1
at 1400

spawn Sanchez
health 100
@script void main() {
   performattack(getlocalvar("self"), openborconstant("ANI_FOLLOW12"));
} @end_script
coords 419 208
map 1
at 1400

spawn Tart
@script void main() {
   performattack(getlocalvar("self"), openborconstant("ANI_FOLLOW12"));
} @end_script
coords 86 207
flip 1
at 1400

spawn Tart
@script void main() {
   performattack(getlocalvar("self"), openborconstant("ANI_FOLLOW12"));
} @end_script
coords 371 207 75
at 1400

spawn Sanchez
coords 495 276
map 1
at 1400
 
I'm redesigning a level currently and I added some custom intros for my enemies that are called via script within the level file.

For some reason, after all of the enemies are cleared, the level doesn't proceed nor end. Here is the portion of code at the end of the level, and when this is removed, the issue disappears randomly. Though I still want to implement it. I've done this before just fine, so I dunno why it's buggy this time around.

Code:
wait
at 1400

group 3 3
at 1400

spawn TartS
alias Tart
coords 490 273
at 1400

spawn Sanchez
health 100
@script void main() {
   performattack(getlocalvar("self"), openborconstant("ANI_FOLLOW12"));
} @end_script
coords 320 209
map 1
at 1400

spawn TartWindow
health 1
alias Ember
coords 464 213 75
map 1
at 1400

spawn Sanchez
health 100
@script void main() {
   performattack(getlocalvar("self"), openborconstant("ANI_FOLLOW12"));
} @end_script
coords 419 208
map 1
at 1400

spawn Tart
@script void main() {
   performattack(getlocalvar("self"), openborconstant("ANI_FOLLOW12"));
} @end_script
coords 86 207
flip 1
at 1400

spawn Tart
@script void main() {
   performattack(getlocalvar("self"), openborconstant("ANI_FOLLOW12"));
} @end_script
coords 371 207 75
at 1400

spawn Sanchez
coords 495 276
map 1
at 1400
Maybe there's an enemy stuck somewhere, or you may have some "type enemy" entity used for decoration purposes and not killed.
Or even walls/platforms holding an enemy advancement, I would like to see more info about the entities and the entire level design.

Try to remove all enemies and gradually add them one by one, and see after which one the issue starts. And some of these Tart characters spawn with a custom height, try to remove these values and see if it changes something.
 
@MysticalMist as my friends explained, there is some enemy stuck somewhere.

I use this code for those situations and it helps me to detect which entity is stuck. Put this in your updated.c inside the main() loop:

C-like:
if(openborvariant("in_system_options"))
{
drawstring( 140, 50,1,"Models:  Cached "+openborvariant("models_cached")+" - Loaded:  "+openborvariant("models_loaded"));
drawstring( 100, 60,1,"Entities:  Enemies - "+openborvariant("count_enemies")+" - NPCs:  "+openborvariant("count_npcs")+" - Total:  "+openborvariant("count_entities"));

    //White Dragon debug. Thanks!
    int i = 0, count = 0;
    int x = 10, y = 10, font_index = 0, yspace = 10;
    int prev_strwidth = 0, cols = 10;

    for(i = 0; i < openborvariant("count_entities"); i++) {
        void ent = getentity(i);
        char name = "", comma = ", ";
        int col = count/cols; // current colon

            if ( ent == NULL() || !getentityproperty(ent,"exists") ) continue;
            name = getentityproperty(ent,"model");
            if (i >= openborvariant("count_entities")-1) comma = "";
            drawstring(x+prev_strwidth,y+yspace*col,font_index,(name+comma));
            prev_strwidth += strwidth((name+comma),font_index); // sum row spaces
            ++count; // count ents
            if (col < count/cols) prev_strwidth = 0; // reset colons
        }
}

Now inside the stage, hit ENTER and press F12 to go to options > System Options
You will have a list of all the entities which are present on the stage, visible/offscreen or not
1775136692669.png
As a bonus, the code says how much models you have cached, how much you had loaded, how many enemies and NPCs
 
SOLVED, I just figured it out. Turns out "TartWindow" (that was coded much like a "striker" enemy, where she just throws a bomb from a window) wasn't deleted once her FOLLOW12 animation finished (the "running away" part didn't go fully offscreen and her visibility was behind the panel layer so I didn't see that. Offscreenkill didn't delete the entity for where it was placed, BUT I fixed it with adding a short lifespan. I thought they were deleted only because I saw that the name disappeared from the "basic properties" debug setting once the animation was finished.

@O Ilusionista, that's actually a really cool feature! I'll actually remember to implement that soon.

Thanks everyone!!
 
Back
Top Bottom