2 registered members (AndrewAMD, squik),
934
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Very important question !!!! Please help me :-)
[Re: Daniel_M]
#301108
12/08/09 14:10
12/08/09 14:10
|
Joined: May 2007
Posts: 2,043 Germany
Lukas
Programmer
|
Programmer
Joined: May 2007
Posts: 2,043
Germany
|
|
|
|
Re: Very important question !!!! Please help me :-)
[Re: Lukas]
#301119
12/08/09 15:10
12/08/09 15:10
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
Expert
|
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
don´t load your levels from the mainscript. create a new function with a string parameter to load levels.
That´s more flexibly.
Last edited by Espér; 12/08/09 15:11.
|
|
|
Re: Very important question !!!! Please help me :-)
[Re: Daniel_M]
#301124
12/08/09 15:22
12/08/09 15:22
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
Expert
|
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
STRING* endfile = "#10";
function leveload(STRING *filename)
{
str_cpy(endfile, filename);
str_cat(endfile, ".wmb");
level_load(endfile);
wait(2);
}
function something()
{
[...]
leveload("filename without extention");
wait_for(leveload);
[...]
}
|
|
|
Re: Very important question !!!! Please help me :-)
[Re: Daniel_M]
#301126
12/08/09 15:26
12/08/09 15:26
|
Joined: Dec 2008
Posts: 1,660 North America
Redeemer
Serious User
|
Serious User
Joined: Dec 2008
Posts: 1,660
North America
|
You could do it like this:
STRING* level1_map = "level1.wmb";
STRING* level2_map = "level2.wmb";
function change_map(level)
{
switch( level )
{
case 1: level_load(level1_map); break;
case 2: level_load(level2_map); break;
default: break;
}
}
Please excuse me if I made a couple syntax errors or something.
Last edited by Redeemer; 12/08/09 15:26.
|
|
|
Re: Very important question !!!! Please help me :-)
[Re: Daniel_M]
#301127
12/08/09 15:26
12/08/09 15:26
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
Expert
|
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
yes,
when your #include codes are in the mainscript, they are part of your game and can be started.
But don´t forget: If you want to start an action or function from your last script, you need to include it BELOW all other scripts
Last edited by Espér; 12/08/09 15:28.
|
|
|
Re: Very important question !!!! Please help me :-)
[Re: Daniel_M]
#301132
12/08/09 15:33
12/08/09 15:33
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
Expert
|
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
no problem.. Yes, the loaded levels can use all functions from the included scripts. Tipp: Try to read the Tutorial and use the Manual as reference ^^ That should be your first step to understand #include the level_load function and everything else.
|
|
|
|