08-29-2012, 04:45 PM
Hi. Recently I've begun creating a custom story with the help of YourComputer's video series. Up to now, I've created scripts without problems (and fixed errors) but recently I've gotten one I can't seem to figure out. I've looked over the script multiple times, but find nothing wrong. This is what I'm getting:
And this is my map01.hps:
When a key is picked up, a Grunt will spawn behind a door, smash the door down, and make his way outside. Once he's outside, if a lever is pulled, a cave in will spawn and a ragdoll of the Grunt will spawn and fall onto the ground.
Thanks in advance!
Spoiler below!
And this is my map01.hps:
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
SetEntityConnectionStateCallback("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 level state)
{
if(level_state == 1);
{
SetEntityActive("cave_in_1", "cave_in_2", "cave_in_3", true);
FadeEnemyToSmoke("servant_grunt_1", true);
SetEntityActive("servant_grunt_2", true);
}
}
{
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
SetEntityConnectionStateCallback("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 level state)
{
if(level_state == 1);
{
SetEntityActive("cave_in_1", "cave_in_2", "cave_in_3", true);
FadeEnemyToSmoke("servant_grunt_1", true);
SetEntityActive("servant_grunt_2", true);
}
}
When a key is picked up, a Grunt will spawn behind a door, smash the door down, and make his way outside. Once he's outside, if a lever is pulled, a cave in will spawn and a ragdoll of the Grunt will spawn and fall onto the ground.
Thanks in advance!