Very important question !!!! Please help me :-)

Posted By: Daniel_M

Very important question !!!! Please help me :-) - 12/08/09 13:59

Hello.

I have a question.

I am working on a selfmade game with 3dgs.

I have three different level with one mainskript. in mainskript I have also inserted teleport to following levels.
in the last level, it must work with the actions and functions, which exist in underscripts ones.

Can anybody tell me, what I have to do, so that the effects are explained in level, because it appeals only on mainskript

I hope you understand this . My english isnt very well ;-). greets daniel
Posted By: Lukas

Re: Very important question !!!! Please help me :-) - 12/08/09 14:10

http://manual.conitec.net/alevel_load.htm
Posted By: Espér

Re: Very important question !!!! Please help me :-) - 12/08/09 15:10

don´t load your levels from the mainscript. create a new function with a string parameter to load levels.

That´s more flexibly.
Posted By: Daniel_M

Re: Very important question !!!! Please help me :-) - 12/08/09 15:14

hi. thanks for your help. can you show me, how i can write a function in my skript? a example? greets daniel
Posted By: Espér

Re: Very important question !!!! Please help me :-) - 12/08/09 15:22

Code:
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);
	[...]
}


Posted By: Daniel_M

Re: Very important question !!!! Please help me :-) - 12/08/09 15:24

in the last level .. in the script... there are 8 include lines of another scripts for this level.. are the included?
Posted By: Redeemer

Re: Very important question !!!! Please help me :-) - 12/08/09 15:26

You could do it like this:

Code:
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.
Posted By: Espér

Re: Very important question !!!! Please help me :-) - 12/08/09 15:26

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
Posted By: Daniel_M

Re: Very important question !!!! Please help me :-) - 12/08/09 15:28

okay no prob ^^... if i add the name of the level in the first line... .. the script of this level is included right ?^^ sorry for my questions.. but i dont understand this at the moment.. :-)
Posted By: Espér

Re: Very important question !!!! Please help me :-) - 12/08/09 15:33

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.
© 2023 lite-C Forums