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
Door slam error
tokugawa1 Offline
Junior Member

Posts: 37
Threads: 8
Joined: Aug 2012
Reputation: 0
#1
Door slam error

So i tried adding the door slam event and this showed up

FATAL ERROR: Could not load script file 'custom_stories/The Deception/maps/The Deception.hps'!

main (10,1) : ERR :Expected ',' or ';'


And here is the script:
void OnStart()
{
AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);
SetEntityPlayerInteractCallback("monster_tinderbox", "Spawn_Monster", true);
AddEntityCollideCallback("Player", "Scr_enemy_spawner1", "MonsterFunction", true, 1);
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door1", true, true);
SetSwingDoorLocked(asEntity, false, true);
PlayGuiSound("unlock_door", 0.8f);
RemoveItem(asItem);
SetSwingDoorClosed("door2", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}


void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_3", true);
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_10", 4, "");
}

void Spawn_Monster(string &in asEntity)
{
SetEntityActive("servant_brute_1", true);
}
08-02-2012, 08:32 PM
Find
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#2
RE: Door slam error

uhm you forgot to put an "{" "}" at void UsedKeyOnDoor
copy paste this:

void OnStart()
{
AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);
SetEntityPlayerInteractCallback("monster_tinderbox", "Spawn_Monster", true);
AddEntityCollideCallback("Player", "Scr_enemy_spawner1", "MonsterFunction", true, 1);
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlayGuiSound("unlock_door", 0.8f);
RemoveItem("key_1");
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door1", true, true);
SetSwingDoorClosed("door2", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}


void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_3", true);
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_10", 4, "");
}

void Spawn_Monster(string &in asEntity)
{
SetEntityActive("servant_brute_1", true);
}

EDIT: I corrected some things

CURRENTLY WORKING ON:
Final Light = 40%
Need of voice actors.
(This post was last modified: 08-02-2012, 08:50 PM by Steve.)
08-02-2012, 08:44 PM
Find
tokugawa1 Offline
Junior Member

Posts: 37
Threads: 8
Joined: Aug 2012
Reputation: 0
#3
RE: Door slam error

(08-02-2012, 08:44 PM)Steve Wrote: uhm you forgot to put an "{" "}" at void UsedKeyOnDoor
copy paste this:

void OnStart()
{
AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);
SetEntityPlayerInteractCallback("monster_tinderbox", "Spawn_Monster", true);
AddEntityCollideCallback("Player", "Scr_enemy_spawner1", "MonsterFunction", true, 1);
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlayGuiSound("unlock_door", 0.8f);
RemoveItem("key_1");
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door1", true, true);
SetSwingDoorClosed("door2", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}


void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_3", true);
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_brute_3", "PathNodeArea_10", 4, "");
}

void Spawn_Monster(string &in asEntity)
{
SetEntityActive("servant_brute_1", true);
}

EDIT: I corrected some things
ok this worked thanks man
08-02-2012, 09:07 PM
Find




Users browsing this thread: 2 Guest(s)