Shadowfied
Senior Member
Posts: 261
Threads: 34
Joined: Jul 2010
Reputation:
5
|
RE: Crowbar script
All callbacks must be within the squiggly brackets of the onstart void.
void OnStart()
{
They go here
here
here
}
etc.
(01-17-2012, 02:24 AM)flamez3 Wrote: You have two void OnStarts? Anyway, use this:
Quote:void OnStart()
{
AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);
AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);
AddUseItemCallback("1", "crowbar_1", "Mansion_1", UseCrowbarOnDoor, true);
}
void MonsterFunc1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ghostgrunt", true);
ShowEnemyPlayerPosition("ghostgrunt");
AddTimer("", 1, "TimerGruntEnd");
StartPlayerLookAt("AreaLookAt", 30, 50, "");
AddTimer("", 1, "TimerStopPlayerLook");
}
void UseCrowbarOnDoor(string &in asItem, string &in asEntity)
{
SetEntityActive("crowbar_joint_1", true);
RemoveItem(asItem);
}
void TimerStopPlayerLook (string &in asTimer)
{
SetEntityActive("ghostgrunt", false);
StopPlayerLookAt();
SetEntityActive("servant_grunt_1", true);
}
void MonsterFunc1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ghostgrunt", true);
ShowEnemyPlayerPosition("ghostgrunt");
AddTimer("", 1, "TimerGruntEnd");
StartPlayerLookAt("AreaLookAt", 30, 50, "");
AddTimer("", 1, "TimerStopPlayerLook");
}
void TimerStopPlayerLook (string &in asTimer)
{
SetEntityActive("ghostgrunt", false);
StopPlayerLookAt();
SetEntityActive("servant_grunt_1", true);
}
You are putting the callbacks in the wrong places. They go in void OnStart. And don't make another void OnStart for a different even. Look at the way I set it up and go from there. He does not have two OnStart's, if you read, he said that the other part was the script without the crowbar.
(This post was last modified: 01-17-2012, 09:36 AM by Shadowfied.)
|
|