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
Scripting Error
Zaffre Away
Posting Freak

Posts: 867
Threads: 50
Joined: Jul 2012
Reputation: 30
#7
RE: Scripting Error

(08-29-2012, 06:09 PM)Statyk Wrote: Try this. I highlighted changes in bold:
Spoiler below!

void OnStart()
{
SetEntityPlayerInteractCallback("key_study_1", "ActivateMonster", true);
AddUseItemCallback("BedroomLevelDoorOpen", "key_study_1", "level_wood_1", "UnlockLevelDoor", true);
SetPlayerActive(false);
FadeOut(0);
AddTimer("activate_player", 3, "FadeIn");

//Lever
SetEntityConnectionStateChangeCallback("lever_small01_1", "DoCaveIn");
}


void OnEnter()
{

}

void OnLeave()
{

}

void FadeIn(string &in activate_player)
{
FadeIn(2);
SetPlayerActive(true);
SetEntityActive("servant_grunt_2", false);
}

void ActivateMonster(string &in item)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "Idle");

}

void UnlockLevelDoor(string &in item, string &in entity)
{
SetLevelDoorLocked("level_wood_1", false);
RemoveItem("key_study_1");
}

void DoCaveIn(string &in entity, int alState)
{
if(alState == 1)
{
SetEntityActive("cave_in_*", true);
FadeEnemyToSmoke("servant_grunt_1", true);
SetEntityActive("servant_grunt_2", true);
}

}


Thank you. All the errors are gone and everything works great. Thanks a ton!

As of September 2nd, 2014, I've left the Frictional forums. Check my profile for more details.
08-29-2012, 06:28 PM
Find


Messages In This Thread
Scripting Error - by Zaffre - 08-29-2012, 04:45 PM
RE: Scripting Error - by Melvin - 08-29-2012, 04:49 PM
RE: Scripting Error - by Statyk - 08-29-2012, 04:55 PM
RE: Scripting Error - by Zaffre - 08-29-2012, 05:30 PM
RE: Scripting Error - by Steve - 08-29-2012, 06:04 PM
RE: Scripting Error - by Statyk - 08-29-2012, 06:09 PM
RE: Scripting Error - by Zaffre - 08-29-2012, 06:28 PM
RE: Scripting Error - by Statyk - 08-29-2012, 07:32 PM



Users browsing this thread: 1 Guest(s)