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


Thread Rating:
  • 4 Vote(s) - 3.75 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting n00b in need of help.
Cellrage Offline
Junior Member

Posts: 4
Threads: 0
Joined: Oct 2010
Reputation: 0
#2
RE: Scripting n00b in need of help.

First, you should move your CollideCallback into the OnStart function.

Then, make a new function, (Not inside the OnStart, OnEnter, or OnLeave), which should look like:

void scareactivate(string &in asParent, string &in asChild, int alState)
{
}

Then you put whatever it is you want to be activated inside those brackets.

Your finished code should look something like this:
void OnStart()
{  
   GiveItemFromFile("lantern", "lantern.ent");

   for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");

AddEntityCollideCallback("Player", "scaretrigger", "scareactivate", true, 1);
}

void scareactivate(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("scaremonster", true);
AddEnemyPatrolNode("scaremonster", "scaremonsterpath1", 0, "");
}

Don't forget to set the monster to inactive in the level editor.
11-13-2010, 01:37 AM
Find


Messages In This Thread
Scripting n00b in need of help. - by Akumasama - 11-13-2010, 12:59 AM
RE: Scripting n00b in need of help. - by Cellrage - 11-13-2010, 01:37 AM
RE: Scripting n00b in need of help. - by Chilton - 11-13-2010, 03:02 AM
RE: Scripting n00b in need of help. - by Chilton - 11-13-2010, 02:52 PM
RE: Scripting n00b in need of help. - by Chilton - 11-13-2010, 03:15 PM
RE: Scripting n00b in need of help. - by Chilton - 11-13-2010, 03:41 PM
RE: Scripting n00b in need of help. - by anzki - 11-13-2010, 05:42 PM
RE: Scripting n00b in need of help. - by Cellrage - 11-14-2010, 03:08 AM
RE: Scripting n00b in need of help. - by Chilton - 11-14-2010, 03:33 AM
RE: Scripting n00b in need of help. - by Cellrage - 11-14-2010, 03:37 AM



Users browsing this thread: 1 Guest(s)