The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
#1
Scripting Error

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:
Spoiler below!
[Image: 9SD6y.png]

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);
}

}


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!

As of September 2nd, 2014, I've left the Frictional forums. Check my profile for more details.
08-29-2012, 04:45 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: 2 Guest(s)