Zaffre
Posting Freak
Posts: 867
Threads: 50
Joined: Jul 2012
Reputation:
30
|
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 |
|