In the code below, i am calling the function entername() in main and i want to load the main level from startgame() function.
When i run the game, the intro part of the game is working fine, but after that the level_load(level_str) in the startgame() function is not loaded(black screen is visible).
function entername()
{
<code>
.
.
.
</code>
wait(3);
select_panels_on();
run_select_level();
}
}
function run_select_level()
{
var temporary_postition = 0; //position for weapons before positioned correctly
level_type = select;
.
.
level_load(select_level_str);
wait(2); //wait until level is loaded
mouse_mode = 1; //use mouse for ship select level
//create and position avatars
ent_create (male_mdl, vector(-100,100,-95), male_selected);
ent_create (female_mdl, vector(-100,100,-98), female_selected);
ent_create (hairy_mdl, vector(-100,100,-98), hairy_selected);
ent_create (lizard_mdl, vector(-100,100,-98), lizard_selected);
.
.
.
startgame();
}
function startgame()
{
select_panels_off();
level_load(level_str);
wait(2);
if (player_captain == male){ent_create(male_mdl,temp,PlBiped01);}
if (player_captain == female){ent_create(female_mdl,vector(1600, 100, -800),PlBiped01);}
if (player_captain == lizard){ent_create(lizard_mdl,vector(1600, 100, -800),PlBiped01);}
if (player_captain == hairy){ent_create(hairy_mdl,vector(1600, 100, -800),PlBiped01);}
}