Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] I suck at scripting, help!
Author Message
Someone else Offline
Member

Posts: 178
Joined: Sep 2010
Reputation: 0
Post: #11
RE: I suck at scripting, help!
(01-22-2011 02:49 PM)TarkoRehin Wrote:  My script file looks like this:

Replace it with this:
void TakeTinder(string &in asEntity)
{
    SetEntityActive("servant_grunt_1", true);
}

void OnStart()
{
SetEntityPlayerInteractCallback("tinderbox_1", "TakeTinder", true);
}

void OnEnter()
{

}

void OnLeave()
{

}
What it means is, that when the level starts, it adds a callback (basically when something happens, the callback activates a function).
Thus when you interact with "tinderbox_1", the function "TakeTinder" is run with the parameters ("tinderbox_1").

The parameter "string &in asType" is only used when you specify the callback in the editor, but I recommend always add callbacks in the scripts to keep the stuff more organised. (thus you only have to look once to find what you are looking for, and it is searchable)

Oh, and I totally forgot to say:
"You don't suck, you only haven't learned it yet."
~Someone else

Think of it that way.

Support the developer.
Say no to piracy.
My avatar used to shape shift, but that is no longer the case.
(This post was last modified: 01-22-2011 03:14 PM by Someone else.)
01-22-2011 03:13 PM
Visit this user's website Find all posts by this user Quote this message in a reply
TarkoRehin Offline
Junior Member

Posts: 8
Joined: Jan 2011
Reputation: 0
Post: #12
RE: I suck at scripting, help!
Thanks alot, finally got the script working.

Also had to delete the script file once, no idea why as the one I recreated was entirely the same.

Regardless thanks again, and time to get working Big Grin
01-22-2011 04:43 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)