Script Functions
The scripting language is quite easy once you get the feel of it. I will describe a little of what some of the parts of script functions do.
string = a word (think of a string of characters)
int = a integer (whole number that can be positive or negative)
float = a part of a whole number and some left (example: 1.3)
bool = a true/false statement
void = The beginning of a function or callback
asCallback = When something happens, it calls a function and then tells it what to do.
void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);
Lets take this apart, "void" begins the callback, "AddEntityCollideCallback" causes something to happens when two entities collide. The "string& asParentName" shows the name of the more important entity. "Player" can be a asParentName. Which brings us to "asChildName", which is the entity the parent collides with. "string& asFunction" is the name of the function you want to use for when these 2 entities collide. You can put any name you want to, just remember that all strings cannot have a space in it. "bool abDeleteOnCollide" asks if you want the callback to be deleted once these two entities collide. So if you say "true" then the two entities will only collide once when related to the funtion being called. "int alStates" asks you to either type 1, 0, or -1 into that. 1 means when the entity enters it. 0 means when the entity enters or exits. -1 means when the entity leaves it. Also remember to put strings in quotations ("").
Example:
void onStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "PlayerCollideArea1", true, 1);
}
void PlayerCollideArea1(string &in asParent, string &in asChild, int alState)
{
[INSERT THINGS YOU WANT TO HAPPEN HERE]
}
void onEnter()
{
}
void onLeave()
{
}