Level_load entity issues? (solved)

Posted By: deianthropus

Level_load entity issues? (solved) - 07/31/10 19:09

I'm now having issues with level_load. I can't pinpoint the issue, since there are several inconsistent symptoms.

I'm loading a new level on an interaction between the player and an entity (model) defined in WED. It's not the collision event that is causing the issue - I believe it's that the engine wants to read entities that no longer exist once level_load has been called.


1: The following problems seem to occur on random instances of the level_load function. That is, sometimes the level will load, but only after an "empty pointer in main" or similar message (the message is not always the same, either, suggesting that my problem varies by program and variable status)

2: When the level has loaded, the frame rate jumps between 40 and 50 on a regular, pulsing beat that makes the fps appear to lag and skip. This can be corrected (of all things!) by changing the view to windowed thru alt-enter. (Why does it do this????)

3: in the cases when the level does not load, it crashes the game. My guess for this is an empty "you" or "me," but I can't find it.

I'm sure this has happened to others of you. What did you do when it did?
Posted By: Pappenheimer

Re: Level_load entity issues? - 07/31/10 23:33

Do you load the level from within an event? You shouldn't... wink
Switch a variable instead which causes a different function to load the new level...
Posted By: deianthropus

Re: Level_load entity issues? - 07/31/10 23:53

Actually, I'm not running it thru a true event. The entity's action sets a skill which is caught by a switch in a c_trace pseudo-collision (game loop). This was a workaround for a totally unrelated problem (see this old thread ) that had serendipitous consequences for this particular problem.

But it seems my original diagnosis was correct, and I just needed to shut off my main while(1) loop while the level initializes, and once the player, level and sky entities have loaded, restart the loop.
© 2024 lite-C Forums