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
ERROR: Expected '('
drujeful Offline
Junior Member

Posts: 4
Threads: 2
Joined: Jul 2012
Reputation: 0
#1
ERROR: Expected '('

I tried searching all over for this problem and though many threads were similar, none helped me with my problem.

Here's my error:


FATAL ERROR: Could not load script file 'custom_stories/Collin/maps/firstfloor.hps'!
main (54, 7) : ERR : Expected '('

Here's my code:



void OnStart()
{
AddUseItemCallback("", "basekey_1", "stairdoor", "KeyOnDoor", true);

SetEntityPlayerInteractCallback("basekey_1", "ActivateMonster", true);

SetPlayerLampOil(50.0f);

AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);


}



void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("stairdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "stairdoor", 0.0f, false);
RemoveItem("basekey_1");
}

void ActivateMonster(string &in item)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "");

}

void DoorLockedPlayer(string &in entity)


{
if(GetSwingDoorLocked("stairdoor") == true)
{

SetMessage("Messages", "basedoorlock", 0);

}


void func_slam (string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("kitchendoor", true, true);

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0.0f, false);
PlaySoundAtEntity("", "react_scare", "Player", 0.0f, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0.0f, false);

GiveSanityDamage(5.0f, true);
}
}
void OnEnter()
{
}
void OnLeave()
{
}


I am trying to make an instance where the player steps into an area and a door (kitchendoor) slams shut, startling the player. I really appreciate all you guys do to help us newbies out. I've found most of my problems here, but just can't seem to figure this one out. Thanks.
(This post was last modified: 07-24-2012, 11:09 PM by drujeful.)
07-24-2012, 10:56 PM
Find Reply
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: ERROR: Expected '('

There were a few misplaces/mishaped brackets, so I went ahead and fixed all of them, here ya go:


void OnStart()
{
AddUseItemCallback("", "basekey_1", "stairdoor", "KeyOnDoor", true);
SetEntityPlayerInteractCallback("basekey_1", "ActivateMonster", true);
SetPlayerLampOil(50.0f);
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("stairdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "stairdoor", 0.0f, false);
RemoveItem("basekey_1");
}

void ActivateMonster(string &in item)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "");

}

void DoorLockedPlayer(string &in entity)
{
if(GetSwingDoorLocked("stairdoor") == true)
{
SetMessage("Messages", "basedoorlock", 0);
}
}

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

void OnEnter()
{

}

void OnLeave()
{

}

Hope that helped.

I rate it 3 memes.
07-24-2012, 11:04 PM
Find Reply
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#3
RE: ERROR: Expected '('

YOU FORGOT TO PUT AN "}" AT THE END OF
void func_slam (string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("kitchendoor", true, true);

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0.0f, false);
PlaySoundAtEntity("", "react_scare", "Player", 0.0f, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0.0f, false);
i HOPE THIS HELPS(sorry capslock)

CURRENTLY WORKING ON:
Final Light = 40%
Need of voice actors.
07-24-2012, 11:04 PM
Find Reply
drunkmonk Offline
Member

Posts: 109
Threads: 7
Joined: Jun 2012
Reputation: 4
#4
RE: ERROR: Expected '('

Try backspacing before the first bracket in your void func_slam (string &in asParent, string &in asChild, int alState) see if that helps and also you don't need the quotes inside those brackets
Make it look like this
void func_slam(string &in asParent, string &in asChild, int alState)

Edit: oh I see I got ninja'd while I was typing up an answer lol :p
(This post was last modified: 07-24-2012, 11:08 PM by drunkmonk.)
07-24-2012, 11:05 PM
Find Reply
drujeful Offline
Junior Member

Posts: 4
Threads: 2
Joined: Jul 2012
Reputation: 0
#5
RE: ERROR: Expected '('

Alright, it worked perfectly! Thanks guys!
07-24-2012, 11:08 PM
Find Reply




Users browsing this thread: 1 Guest(s)