Page 1 of 1

Global Code

PostPosted: Sat Feb 21, 2004 3:59 pm
by ingsan
Image

After enter your code, enter a name for it and click in Add button.

from GE documentation.

Well i don't know if it is a bug or not, but clicking on Add doesn't seem to record my code. when i do ADD in Global code, i go back to Script mode and have no other choice but to click on Close. :x

PostPosted: Sat Feb 21, 2004 6:14 pm
by makslane
If you back to Global Code editor and click in the "choose" list, your code don't appear?

PostPosted: Sat Feb 21, 2004 8:59 pm
by ingsan
what i do is the following :

Add Event Draw Actor on an actor, let's say test.
Add Action Script Editor>Global Code and load the code that u gave me.
The code is named "save". and i can actually choose it.

But when i add the code in Global code, i automatically go back to the normal Script Editor and if whenever i click on "add", i have an error message. So i have no other choice tjan to click on "Close", thus loosing my "Draw Actor" on actor test. :(

PostPosted: Sun Feb 22, 2004 9:06 pm
by makslane
In your "Draw Actor" event, or other event, you can use the funcitons and vars added in Global Code Editor.

So, after add the code, you can use saveLives or loadLives, or other funcitons in global code, by calling it:

saveLives();
loadLives();

PS.: To use the Global Code feature, is a good thing have some basics backgrounds in C language