Leveload Code mit error

Posted By: Det

Leveload Code mit error - 02/07/11 21:54

Hallo !

Habe hier einen Level Load code wo Wed die Fehlermeldung

text uncleard identifier
<text Missions_txt

Hab im Hanbuch nichts gefunden was den Fehler beheben könnte ich weiß nur das etwas in dem Code fehlt nur nichso genau was

Code:
text Missions_txt
{
     strings = 3; //Number of Levels +1 (3 for are 2 possible Levels)
     string = "";
              "Level1.wmb"; //Names of the Levelfiles (this will be loaded for 1)
              "Level2.wmb"; //this for 2
}

This is the action with its event to load the new level:

function LevelLoad_event()
{
     my.enable_impact = off;

     var LevelNum;
     LevelNum = my.skill1;

     my = NULL;
     you = NULL;

     level_load(Missions_txt[LevelNum]);
     wait(3);
}

//skill1: LevelNumber 1
action Lvl_Change_Run()
{
     my.enable_impact = on;
     my.event = LevelLoad_event;

     my.polygon = on;
     my.fat = off;
     my.narrow = off;

     my.invisible = on;
}
}


Posted By: Det

Re: Leveload Code mit error - 02/07/11 22:24

Einen Fehler hab ich jetzt gefunden es muß heißen :



TEXT* Missions_txt
{
strings = 3; //Number of Levels +1 (3 for are 2 possible Levels)
string = "",
"Level1.wmb", //Names of the Levelfiles (this will be loaded for 1)
"Level2.wmb"; //this for 2
}


aber jetzt habe ich noch einen Syntax Error
Posted By: Logan

Re: Leveload Code mit error - 02/07/11 22:33

Hi,

I don't speak German, but this line looks wrong to me:
level_load(Missions_txt[LevelNum]);

Because Missions_txt is a TEXT pointer, and you're treating it like an array. I also think that's where your syntax error is coming from. I might be wrong though.

Try:
level_load((Missions_txt.pstring)[LevelNum]);
Posted By: Det

Re: Leveload Code mit error - 02/07/11 22:39

Ok thank you : I tryed it like this level_load((Missions_txt.pstring)[LevelNum]);
but it comes a Syntax Error again the error is in line 4 says the computer (WED)
Posted By: Logan

Re: Leveload Code mit error - 02/07/11 22:47

Oh.

Put parentheses here, in the text definition:

string("",
"Level1.wmb", //Names of the Levelfiles (this will be loaded for 1)
"Level2.wmb"); //this for 2
Posted By: Logan

Re: Leveload Code mit error - 02/07/11 22:49

And, I think for the sake of good practice, you need to define the text as

TEXT* Missions_txt = {.....

Not simply
TEXT* Missions_txt { .....
Posted By: Det

Re: Leveload Code mit error - 02/07/11 23:09

Now comes the error after changing the other error :

my.enable_impact = off;

is not a member of Enity
Posted By: Logan

Re: Leveload Code mit error - 02/07/11 23:22

my.emask &= ~ENABLE_IMPACT;

Lots of little things change with the transition to Lite-C. tongue

EDIT: You're also going to need to change a few of the flag-setting lines in the entity action. The good news is you can condense most of them down to a couple lines.

my.emask |= ENABLE_IMPACT;
set(my,POLYGON | INVISIBLE);
my.eflags &= ~(FAT | NARROW);
Posted By: Det

Re: Leveload Code mit error - 02/07/11 23:29

Now the next error it is an error in the Action

my.enable_impact = on;

is not a meber of Enity


It seems to be a C Script code and not Lite C
Posted By: Logan

Re: Leveload Code mit error - 02/07/11 23:30

Check my above post again... I edited it about 90 times before I finally got it right.
Posted By: Det

Re: Leveload Code mit error - 02/07/11 23:34

Ok that`s fine from you thank you for helping me .
Posted By: Det

Re: Leveload Code mit error - 02/07/11 23:54

The last shit Error is a Syntax Error




my.INVISIBLE = on; //Syntax Error in this line
set(my,INVISIBLE);

It is from the manual it`s the same

Posted By: Logan

Re: Leveload Code mit error - 02/08/11 00:03

Yeah. Gotta get those my.flag = .... out of there. The Lite-C way of doing flags is different.

set(my,INVISIBLE) in Lite-C does the same thing as my.INVISIBLE = on used to do in C-Script. So just erase that old C-Script line. And any other ones in your code.

All this is in the "Migration to Lite-C" page in the manual. I'd recommend reading that page closely because your code had a lot of old C-Script stuff in.
Posted By: Det

Re: Leveload Code mit error - 02/08/11 00:41

Ok Thank you again for Helping . Have a nice Day in the US -)
© 2024 lite-C Forums