Frictional Games Forum (read-only)

Full Version: hps file scripting errors *i need helpX|*
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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");
Function bodies (and pretty much everything else requires curly braces --> { }

For example,

PHP Code:
void OnStart()
{



Also,

PHP Code:
AddUseItemCallback("""key_1""door_1""FUNCTION"true)
//This requires a semicolon 
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.
(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)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");
}
(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