Global Code

Non-platform specific questions.

Global Code

Postby ingsan » Sat Feb 21, 2004 3:59 pm

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
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby makslane » Sat Feb 21, 2004 6:14 pm

If you back to Global Code editor and click in the "choose" list, your code don't appear?
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby ingsan » Sat Feb 21, 2004 8:59 pm

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. :(
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby makslane » Sun Feb 22, 2004 9:06 pm

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
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest