16
Technical forum / including global after if
« on: January 08, 2004, 09:43:00 AM »
we want to make the language chooseable in our game.
now I began to test it with teh text="mainmenu" in the mainwindow.
i can change it in the mwinwindow.script by self.text="blabla";
and I hope so
var text1="blabla";
self.text=text1;
In the base.inc I declared a global language="de";
for german.
now I scripted in the game.script (base.inc is included):
if(language="de"){
#include "language\de\captions.inc"
}
later I can add other languages.
in the captions.inc :
global text1="Hauptmenu";
and int the mainwindow.script
global text1;
self.text=text1;
at first: It does not work. I think its because of the #include (just work on top of file without a ';' ? )
How can I make it run?
How can i script It in a way I dont have to inital the varables in the file i used it, or in base.inc
i mean that i can do it in the captions.inc at once.
global text1="blablabla"
an then i can use it in my files without say
global text1;
For that i have to include it, but then I can't do the if(language="de" thing)
Does anybody understand what I mean. I hope someone can help me.
ThX DraX
now I began to test it with teh text="mainmenu" in the mainwindow.
i can change it in the mwinwindow.script by self.text="blabla";
and I hope so
var text1="blabla";
self.text=text1;
In the base.inc I declared a global language="de";
for german.
now I scripted in the game.script (base.inc is included):
if(language="de"){
#include "language\de\captions.inc"
}
later I can add other languages.
in the captions.inc :
global text1="Hauptmenu";
and int the mainwindow.script
global text1;
self.text=text1;
at first: It does not work. I think its because of the #include (just work on top of file without a ';' ? )
How can I make it run?
How can i script It in a way I dont have to inital the varables in the file i used it, or in base.inc
i mean that i can do it in the captions.inc at once.
global text1="blablabla"
an then i can use it in my files without say
global text1;
For that i have to include it, but then I can't do the if(language="de" thing)
Does anybody understand what I mean. I hope someone can help me.
ThX DraX