Hi,

I'm working on a small project that requires some data initialisation following each new level that is loaded. However, despite the fact that the Lite-C documentation says scripts continue following the level_load instruction, this initialisation doesn't take place when the player model leaves the initial level.

The code I'm using is:

function Main_loadLevel(STRING* strLevel) {

level_load(strLevel);
wait(2);

DebugOutputPanel_addToLog("qwertyuisxcvbnm");

Global_entCharacter = ent_create(NULL, NULL, CharacterBehaviour);
Character_calculateArmour();
Character_calculateDamage();

STRING* temp1 = "";
str_for_num(temp1, Global_vecPlayerLocation[0]);
DebugOutputPanel_addToLog(temp1);
str_for_num(temp1, Global_vecPlayerLocation[1]);
DebugOutputPanel_addToLog(temp1);
str_for_num(temp1, Global_vecPlayerLocation[2]);
DebugOutputPanel_addToLog(temp1);

Global_entPlayer = ent_for_name("entPlayer");
Global_entPlayer.x = Global_vecPlayerLocation[0];
Global_entPlayer.y = Global_vecPlayerLocation[1];
Global_entPlayer.z = Global_vecPlayerLocation[2];
Global_entPlayer.pan = Global_numPlayerPan;

// Initialise level entities to saved states
IO_loadLevel(Global_strLevelToLoad);

// Set the level name and character info component text
HudPanel_setLevelName();
HudPanel_setCharacterName();
HudPanel_setCharacterHp();
}

It works fine when the game is first loaded but doesn't work when a new level is loaded - none of the debug text is displayed within the log.

Thanks in advance!

Jim