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
hps file scripting errors *i need helpX|*
Bludsik Offline
Junior Member

Posts: 3
Threads: 1
Joined: Jul 2013
Reputation: 0
#1
hps file scripting errors *i need helpX|*

I was able to fix most of the errors myself, (first time coding Undecided)
I'm really failing at this please someone helpDodgy

The error reads: FATAL ERROR: could not load script file (blah blah...)
main(6,1):ERR: Expected ',' or ';'
main(18,12):ERR: Expected identifier

Here is my current script in my .hps file...
void OnStart
(
AddUseItemCallback("", "key_1", "door_1", "FUNCTION", true)
)

void OnEnter()
(

)

void OnLeave()
(

)
void FUNCTION(string &in item, string &in door)
(
SetSwingDoorLocked("door_1", false);
RemoveItem("key_1");
07-29-2013, 06:18 PM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#2
RE: hps file scripting errors *i need helpX|*

Function bodies (and pretty much everything else requires curly braces --> { }

For example,

PHP Code: (Select All)
void OnStart()
{



Also,

PHP Code: (Select All)
AddUseItemCallback("""key_1""door_1""FUNCTION"true)
//This requires a semicolon 
07-29-2013, 07:40 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#3
RE: hps file scripting errors *i need helpX|*

void OnStart
{
AddUseItemCallback("", "key_1", "door_1", "FUNCTION", true);
}

void OnEnter()
{

}

void OnLeave()
{

}
void FUNCTION(string &in item, string &in asEntity)
{
SetSwingDoorLocked("door_1", false);
RemoveItem("key_1");
}

There, fixed it for you. You had some things wrong:

-You put these "(" instead "{"
-You didn't have the FUNCTION function closed (with a })
-You hadn't put a ; at the end of the AddUseItemCallback.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
07-30-2013, 11:08 AM
Find
Bludsik Offline
Junior Member

Posts: 3
Threads: 1
Joined: Jul 2013
Reputation: 0
#4
RE: hps file scripting errors *i need helpX|*

(07-30-2013, 11:08 AM)The chaser Wrote: void OnStart
{
AddUseItemCallback("", "key_1", "door_1", "FUNCTION", true);
}

void OnEnter()
{

}

void OnLeave()
{

}
void FUNCTION(string &in item, string &in asEntity)
{
SetSwingDoorLocked("door_1", false);
RemoveItem("key_1");
}

There, fixed it for you. You had some things wrong:

-You put these "(" instead "{"
-You didn't have the FUNCTION function closed (with a })
-You hadn't put a ; at the end of the AddUseItemCallback.
Thanks so much for replying. I fixed the errors, but now it comes up with an error saying
main (17,1):ERR: No matching signatures to 'SetSwingDoorLocked(string@&, const bool)'
Any suggestions? Undecided
07-30-2013, 10:17 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#5
RE: hps file scripting errors *i need helpX|*

(07-30-2013, 10:17 PM)Bludsik Wrote:
(07-30-2013, 11:08 AM)The chaser Wrote: void OnStart
{
AddUseItemCallback("", "key_1", "door_1", "FUNCTION", true);
}

void OnEnter()
{

}

void OnLeave()
{

}
void FUNCTION(string &in item, string &in asEntity)
{
SetSwingDoorLocked("door_1", false);
RemoveItem("key_1");
}

There, fixed it for you. You had some things wrong:

-You put these "(" instead "{"
-You didn't have the FUNCTION function closed (with a })
-You hadn't put a ; at the end of the AddUseItemCallback.
Thanks so much for replying. I fixed the errors, but now it comes up with an error saying
main (17,1):ERR: No matching signatures to 'SetSwingDoorLocked(string@&, const bool)'
Any suggestions? Undecided

Sorry, I had a mistake D:

This should be ok:

void OnStart
{
AddUseItemCallback("", "key_1", "door_1", "FUNCTION", true);
}

void OnEnter()
{

}

void OnLeave()
{

}
void FUNCTION(string &in item, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, false);
RemoveItem("key_1");
}

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
07-30-2013, 11:14 PM
Find
Bludsik Offline
Junior Member

Posts: 3
Threads: 1
Joined: Jul 2013
Reputation: 0
#6
RE: hps file scripting errors *i need helpX|*

(07-30-2013, 11:14 PM)The chaser Wrote:
(07-30-2013, 10:17 PM)Bludsik Wrote:
(07-30-2013, 11:08 AM)The chaser Wrote: void OnStart
{
AddUseItemCallback("", "key_1", "door_1", "FUNCTION", true);
}

void OnEnter()
{

}

void OnLeave()
{

}
void FUNCTION(string &in item, string &in asEntity)
{
SetSwingDoorLocked("door_1", false);
RemoveItem("key_1");
}

There, fixed it for you. You had some things wrong:

-You put these "(" instead "{"
-You didn't have the FUNCTION function closed (with a })
-You hadn't put a ; at the end of the AddUseItemCallback.
Thanks so much for replying. I fixed the errors, but now it comes up with an error saying
main (17,1):ERR: No matching signatures to 'SetSwingDoorLocked(string@&, const bool)'
Any suggestions? Undecided

Sorry, I had a mistake D:

This should be ok:

void OnStart
{
AddUseItemCallback("", "key_1", "door_1", "FUNCTION", true);
}

void OnEnter()
{

}

void OnLeave()
{

}
void FUNCTION(string &in item, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, false);
RemoveItem("key_1");
}
omfg It works Big GrinBig Grin
Thank you so so much! Big Grin
07-31-2013, 02:04 AM
Find




Users browsing this thread: 2 Guest(s)