Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help and or Assistance
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#2
RE: Help and or Assistance

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()
{
}

04-28-2011, 02:11 PM
Find


Messages In This Thread
Help and or Assistance - by Tesseract - 04-28-2011, 01:42 PM
RE: Help and or Assistance - by Kyle - 04-28-2011, 02:11 PM
RE: Help and or Assistance - by Tesseract - 04-28-2011, 02:22 PM
RE: Help and or Assistance - by Khyrpa - 04-28-2011, 04:46 PM
RE: Help and or Assistance - by Exostalker - 04-28-2011, 04:52 PM
RE: Help and or Assistance - by Tesseract - 04-29-2011, 12:00 AM



Users browsing this thread: 2 Guest(s)