Basic Scripting Questions Part 2
by Joe Nobody · in Torque Game Engine · 11/13/2003 (8:55 pm) · 9 replies
What the hell calls script functions? Do other scripts call them? Are they called in code? If they are called by other script functions, then are all script fuctions global? Also, if I was to add another player what function do I call to do this (or what class do I have to declare)?
#2
What I'm trying to determine is program flow.
It looks like there are some scripts that are nothing but to help with initialization.
But others look like their game logic.
What I'm wondering is all the functions I see in .CS files; do they get called in the engine, or by other functions, in other .CS files. IF they do get called by other .CS files, does that mean that all functions are global. Because I don't see any #includes at the top of .CS files. (obviously)
Thanks
11/15/2003 (1:56 pm)
No not console functions just ones in .CS filesWhat I'm trying to determine is program flow.
It looks like there are some scripts that are nothing but to help with initialization.
But others look like their game logic.
What I'm wondering is all the functions I see in .CS files; do they get called in the engine, or by other functions, in other .CS files. IF they do get called by other .CS files, does that mean that all functions are global. Because I don't see any #includes at the top of .CS files. (obviously)
Thanks
#3
2. Script functions are global
11/15/2003 (2:00 pm)
1. Script functions can be called by both C++ and Script.2. Script functions are global
#4
11/15/2003 (3:11 pm)
.cs files execute other .cs files by calling exec("path to script file");
#5
11/15/2003 (3:48 pm)
OK thanks. What is the command in the source code to call a .CS function?
#6
Please read the scripting overview, it explains this in some detail.
11/15/2003 (4:01 pm)
function foo() {
echo("blah");
}
foo(); // Call fooPlease read the scripting overview, it explains this in some detail.
#7
//Like this
foo();
Won't this get a compiler error, cause it won't know what this function is?
11/16/2003 (2:20 pm)
How would I call foo in source code. //Like this
foo();
Won't this get a compiler error, cause it won't know what this function is?
#8
Con::exec is a good place to start. The engine reference goes over this in some detail.
11/16/2003 (5:07 pm)
You mean, from C++ code?Con::exec is a good place to start. The engine reference goes over this in some detail.
#9
11/22/2003 (8:05 pm)
Your right th engine reference does go over this...thanks.
Associate Kyle Carter
Most script just calls other script.
Or are you talking about ConsoleMethod/ConsoleFunctions?