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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] I suck at scripting, help!
Som1Lse Offline
Member

Posts: 183
Threads: 9
Joined: Sep 2010
Reputation: 0
#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.
(This post was last modified: 01-22-2011, 03:14 PM by Som1Lse.)
01-22-2011, 03:13 PM
Website Find


Messages In This Thread
RE: I suck at scripting, help! - by ThePaSch - 01-21-2011, 09:54 PM
RE: I suck at scripting, help! - by TarkoRehin - 01-21-2011, 10:04 PM
RE: I suck at scripting, help! - by Sharkhead - 01-21-2011, 10:41 PM
RE: I suck at scripting, help! - by Tanshaydar - 01-21-2011, 10:57 PM
RE: I suck at scripting, help! - by TarkoRehin - 01-21-2011, 11:07 PM
RE: I suck at scripting, help! - by Tanshaydar - 01-21-2011, 11:47 PM
RE: I suck at scripting, help! - by TarkoRehin - 01-22-2011, 12:37 AM
RE: I suck at scripting, help! - by Tottel - 01-22-2011, 11:59 AM
RE: I suck at scripting, help! - by TarkoRehin - 01-22-2011, 02:49 PM
RE: I suck at scripting, help! - by Som1Lse - 01-22-2011, 03:13 PM
RE: I suck at scripting, help! - by TarkoRehin - 01-22-2011, 04:43 PM



Users browsing this thread: 1 Guest(s)