Frictional Games Forum (read-only)
hps file scripting errors *i need helpX|* - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: hps file scripting errors *i need helpX|* (/thread-22269.html)



hps file scripting errors *i need helpX|* - Bludsik - 07-29-2013

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");


RE: hps file scripting errors *i need helpX|* - Tomato Cat - 07-29-2013

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 



RE: hps file scripting errors *i need helpX|* - The chaser - 07-30-2013

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.


RE: hps file scripting errors *i need helpX|* - Bludsik - 07-30-2013

(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


RE: hps file scripting errors *i need helpX|* - The chaser - 07-30-2013

(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");
}


RE: hps file scripting errors *i need helpX|* - Bludsik - 07-31-2013

(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