[Solved] Global code questions
Posted: Wed Nov 06, 2013 11:37 pm
My recent failure in trying to use the global code made me believe, I must
have misunderstood something very fundamental here.
There are rare examples of more complex global code in the docs/tuts, than
just declaring some global vars and functions.
And even such simple things I can't get to work.
Maybe, I'm missing something, concerning the access to the global.c file.
Where must it reside, in the main game dir, where the .geds are stored ?
Are there more than 1 <whatever>.c files allowed, or does that confuse GE ?
When I'm ready in the global code editor, I choose File -> Save.
Starting now the game mode, it seems, that the global code I've saved in
global.c is not included.
When I open the editor, it is empty all the time.
What is wrong here, how gets GE access to the global.c ?
More generally, what else can I do in the global code, than just declaring
vars and functions ?
Can I put real pieces of code in there, and how can I realize that ?
Does GE run direct code in the global code at all ?
And if so, can I just put the commands in there, or do I have to put them
into a code block, or what ?
Really important for me, to get that cleared. Depending on the result, maybe
I have to rework the (planned) implementation of my game concept...
have misunderstood something very fundamental here.
There are rare examples of more complex global code in the docs/tuts, than
just declaring some global vars and functions.
And even such simple things I can't get to work.
Maybe, I'm missing something, concerning the access to the global.c file.
Where must it reside, in the main game dir, where the .geds are stored ?
Are there more than 1 <whatever>.c files allowed, or does that confuse GE ?
When I'm ready in the global code editor, I choose File -> Save.
Starting now the game mode, it seems, that the global code I've saved in
global.c is not included.
When I open the editor, it is empty all the time.
What is wrong here, how gets GE access to the global.c ?
More generally, what else can I do in the global code, than just declaring
vars and functions ?
Can I put real pieces of code in there, and how can I realize that ?
Does GE run direct code in the global code at all ?
And if so, can I just put the commands in there, or do I have to put them
into a code block, or what ?
Really important for me, to get that cleared. Depending on the result, maybe
I have to rework the (planned) implementation of my game concept...