same level but different spawn obstacles

Steven1985

Active member
Hi, there are two identical levels, but in one of them the last three obstacles are displayed correctly on the screen (stage_5_test.txt), while in stage_5.txt they are too far to the right. Why is that? Thank you in advance.
 

Attachments

These files are not even remotely similar, never mind identical. Stage 5 is filled with different spawns and items, any of which could be affecting the stage geometry and positioning. Start by adding small bits at a time and testing. You don't have to shut down the engine to look at a level layout, just close the level and come back into it.

DC
 
I've examined both files and found the issue in stage_5.txt.
Code:
#---------------8

group 4 4    # default 100 100
at    1840

# 12 enemies spawn

spawn    Box #obstacle 
spawnscript data/scripts/enemies/randmz.c
item    RandItem
coords 480 198
at 2231

There are 12 enemies which could be spawned after grouping however the group only allows 4 enemies at max. Because of that, it is very possible to reach scrollpos 2231 before all 12 enemies have been spawned. If that were to happen, the box spawn will not happen and thus scrollpos could be higher or IOW player could move farther than scrollpos 2231 before all 12 enemies were spawned.
Yes, I'm aware that the box is not one of the last 3 obstacles but the issue above could also cause the latter to be spawned farther than they should be. There are 7 enemies spawn between box and the last 3 obstacles BTW which makes it very possible to get this problem.
 
Back
Top Bottom