Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved .hps Error expected '('
Author Message
Matt201496 Offline
Junior Member

Posts: 11
Joined: Jun 2012
Reputation: 0
Post: #1
.hps Error expected '('
It says "error expected '(' " in this part of my script on line 36:

void OnStart()
{
AddUseItemCallback("", "DungeonKey1", "DungeonDoor", "UnlockDungeon", true);

int AM = 0;

};


void ActivateMonster (string &in item)
{
if AM < 2 \\ this is line 36
{

SetEntityActive("DungeonGrunt", true);
AddEnemyPatrolNode("DungeonGrunt", "PathNodeArea_1", 0, "idle");
AddEnemyPatrolNode("DungeonGrunt", "PathNodeArea_2", 0, "idle");

void AddTimer(string& AMTimer, float 45){

int AM++;}

};



}

(This post was last modified: 06-17-2012 05:10 AM by Matt201496.)
06-17-2012 02:49 AM
Find all posts by this user Quote this message in a reply
Rapture Offline
Posting Freak

Posts: 752
Joined: May 2011
Reputation: 21
Post: #2
RE: .hps Error expected '('
Put your "int AM = 0" above your "void OnStart()"

Edit: I don't think that will work. I would suggest using a timer (I'm taking the assumption that the AM refers to the clock so a Timer would be helpful in this case) and put your "if AM < 2" in that and do a if, if else.

Edit2: It be "int AM;" then you put a "AM = 0;" in the void OnStart().
(This post was last modified: 06-17-2012 03:32 AM by Rapture.)
06-17-2012 03:23 AM
Find all posts by this user Quote this message in a reply
SilentStriker Offline
Posting Freak

Posts: 939
Joined: Jul 2011
Reputation: 39
Post: #3
RE: .hps Error expected '('
Seriously your script is a mess, is this your whole script?

06-17-2012 03:28 AM
Find all posts by this user Quote this message in a reply
Matt201496 Offline
Junior Member

Posts: 11
Joined: Jun 2012
Reputation: 0
Post: #4
RE: .hps Error expected '('
AM is just an abbreviation for Activate Monster i want the monster to appear then disappear after a set amount of time ( 45 seconds ). Heres the whole script after i did what u said. this time it just says "Main (38,5): ERR : Expected '(' "

////////////////////////////
// Run when the map starts

int AM;

void OnStart()
{
AddUseItemCallback("", "DungeonKey1", "DungeonDoor", "UnlockDungeon", true);
AM = 0;


};



////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

void UnlockDungeon(string &in item, string &in door)
{
SetSwingDoorLocked(door, false, true);
PlaySoundAtEntity("", "unlock_door", door, 0, false);
RemoveItem(item);
}

void ActivateMonster (string &in item)
{
if AM < 2
{

SetEntityActive("DungeonGrunt", true);
AddEnemyPatrolNode("DungeonGrunt", "PathNodeArea_1", 0, "idle");
AddEnemyPatrolNode("DungeonGrunt", "PathNodeArea_2", 0, "idle");

void AddTimer(string& AMTimer, float 45){

int AM++;}

};



}
(This post was last modified: 06-17-2012 03:43 AM by Matt201496.)
06-17-2012 03:36 AM
Find all posts by this user Quote this message in a reply
Obliviator27 Offline
Posting Freak

Posts: 801
Joined: Jul 2011
Reputation: 65
Post: #5
RE: .hps Error expected '('
void ActivateMonster (string &in item)

{

if AM < 2

{



SetEntityActive("DungeonGrunt", true);

AddEnemyPatrolNode("DungeonGrunt", "PathNodeArea_1", 0, "idle");

AddEnemyPatrolNode("DungeonGrunt", "PathNodeArea_2", 0, "idle");



void AddTimer(string& AMTimer, float 45){



int AM++;}



};







}

This segment is your problem segment.

void ActivateMonster (string &in item)

{

if(AM < 2)

{



SetEntityActive("DungeonGrunt", true);

AddEnemyPatrolNode("DungeonGrunt", "PathNodeArea_1", 0, "idle");

AddEnemyPatrolNode("DungeonGrunt", "PathNodeArea_2", 0, "idle");
AM++;

}







}

You also had an AddTimer function in there for some reason. I'm not sure why, as it isn't referenced further in the script.

06-17-2012 04:30 AM
Find all posts by this user Quote this message in a reply
Matt201496 Offline
Junior Member

Posts: 11
Joined: Jun 2012
Reputation: 0
Post: #6
RE: .hps Error expected '('
Thanks it works now but, How would I add a timer after picking up a note to make the grunt go away.
06-17-2012 04:49 AM
Find all posts by this user Quote this message in a reply
Obliviator27 Offline
Posting Freak

Posts: 801
Joined: Jul 2011
Reputation: 65
Post: #7
RE: .hps Error expected '('
Use something along the lines of

AddTimer("", 10, "DeactivateMonster"); // Replace 10 with whatever number you want.

void DeactivateMonster(string &in asTimer)
{
SetEntityActive("DungeonGrunt", false);
}

06-17-2012 04:54 AM
Find all posts by this user Quote this message in a reply
Matt201496 Offline
Junior Member

Posts: 11
Joined: Jun 2012
Reputation: 0
Post: #8
RE: .hps Error expected '('
Thanks that worked.
06-17-2012 05:09 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)