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
Help needed with .hps scripting
Author Message
planetbomb Offline
Junior Member

Posts: 5
Joined: Nov 2010
Reputation: 0
Post: #1
Help needed with .hps scripting
Ok when I go to test my custom story, I get this message.

FATAL ERROR: Could not load script file
"custom_stories/Escape"/maps/Top_floor-A.hps"!
main (12,2) : ERR : Unexpected end of line


And this the script in the .hps file

////////////////////////////
// Run first time starting map
void OnStart()
{
ddUseItemCallback("", ""doorkey_1", "keydoor_1", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("keydoor_1", false, True);
PlaySoundAtEntity("", "unlock_door", "keydoor_1", 0, false);
RemoveItem("doorkey_1");
}



Any help?Huh
06-05-2011 08:17 PM
Find all posts by this user Quote this message in a reply
Tanshaydar Offline
From Beyond

Posts: 3,091
Joined: Mar 2009
Reputation: 66
Post: #2
RE: Help needed with .hps scripting
ddUseItemCallback -> AddUseItemCallback
I don't know if AngelScript is case sensitive, but always try to write true instead of True

06-05-2011 08:27 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Apjjm Offline
Super Moderator

Posts: 444
Joined: Apr 2011
Reputation: 42
Post: #3
RE: Help needed with .hps scripting
Is that everything in the script file? If it is, then you missed adding in two routines. Also, you missed an "A" on AddUseItemCallback. Try the following:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "doorkey_1", "keydoor_1", "UsedKeyOnDoor", true);
}

//You missed these:
void OnEnter() {}
void OnLeave() {}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("keydoor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "keydoor_1", 0, false);
RemoveItem("doorkey_1");
}

Hope that helps Smile

(This post was last modified: 06-06-2011 01:08 AM by Apjjm.)
06-05-2011 08:28 PM
Find all posts by this user Quote this message in a reply
planetbomb Offline
Junior Member

Posts: 5
Joined: Nov 2010
Reputation: 0
Post: #4
RE: Help needed with .hps scripting
(06-05-2011 08:28 PM)Apjjm Wrote:  Is that everything in the script file? If it is, then you missed adding in two routines. Also, you missed an "A" on AddUseItemCallback. Try the following:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", ""doorkey_1", "keydoor_1", "UsedKeyOnDoor", true);
}

//You missed these:
void OnEnter() {}
void OnLeave() {}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("keydoor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "keydoor_1", 0, false);
RemoveItem("doorkey_1");
}

Hope that helps Smile

Well I got rid of those as they were having the same problem, didn't know you needed them.

EDIT: Put them back in and it still won't work.
(This post was last modified: 06-05-2011 08:34 PM by planetbomb.)
06-05-2011 08:30 PM
Find all posts by this user Quote this message in a reply
DannieWest Offline
Member

Posts: 156
Joined: Apr 2011
Reputation: 0
Post: #5
RE: Help needed with .hps scripting
(06-05-2011 08:17 PM)planetbomb Wrote:  Ok when I go to test my custom story, I get this message.

FATAL ERROR: Could not load script file
"custom_stories/Escape"/maps/Top_floor-A.hps"!
main (12,2) : ERR : Unexpected end of line


And this the script in the .hps file

////////////////////////////
// Run first time starting map
void OnStart()
{
ddUseItemCallback("", ""doorkey_1", "keydoor_1", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("keydoor_1", false, True);
PlaySoundAtEntity("", "unlock_door", "keydoor_1", 0, false);
RemoveItem("doorkey_1");
}



Any help?Huh


I'm not using the OnEnter and OnLeave ones, script works without them as well, but I suppose they can be good for something, which I haven't learned yet xP
Back to business Tongue At "AddUseItemCallback" you put 2 "" in front of doorkey_1, that's why it still dun work Smile
06-06-2011 12:38 AM
Find all posts by this user Quote this message in a reply
planetbomb Offline
Junior Member

Posts: 5
Joined: Nov 2010
Reputation: 0
Post: #6
RE: Help needed with .hps scripting
(06-06-2011 12:38 AM)DannieWest Wrote:  
(06-05-2011 08:17 PM)planetbomb Wrote:  Ok when I go to test my custom story, I get this message.

FATAL ERROR: Could not load script file
"custom_stories/Escape"/maps/Top_floor-A.hps"!
main (12,2) : ERR : Unexpected end of line


And this the script in the .hps file

////////////////////////////
// Run first time starting map
void OnStart()
{
ddUseItemCallback("", ""doorkey_1", "keydoor_1", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("keydoor_1", false, True);
PlaySoundAtEntity("", "unlock_door", "keydoor_1", 0, false);
RemoveItem("doorkey_1");
}



Any help?Huh


I'm not using the OnEnter and OnLeave ones, script works without them as well, but I suppose they can be good for something, which I haven't learned yet xP
Back to business Tongue At "AddUseItemCallback" you put 2 "" in front of doorkey_1, that's why it still dun work Smile

I saw that error as soon as I posted this, but the problem is the "Unexpected end of line"

Thanks anyway
06-06-2011 12:40 AM
Find all posts by this user Quote this message in a reply
Apjjm Offline
Super Moderator

Posts: 444
Joined: Apr 2011
Reputation: 42
Post: #7
RE: Help needed with .hps scripting
Quote:I saw that error as soon as I posted this, but the problem is the "Unexpected end of line"

Thanks anyway
The string not terminating (which is happening because of the two "") will cause that, you know. There really appears to be nothing else after the above fixes.

(This post was last modified: 06-06-2011 01:07 AM by Apjjm.)
06-06-2011 12:52 AM
Find all posts by this user Quote this message in a reply
DannieWest Offline
Member

Posts: 156
Joined: Apr 2011
Reputation: 0
Post: #8
RE: Help needed with .hps scripting
Fail xD Worth a shot xP
06-06-2011 01:02 AM
Find all posts by this user Quote this message in a reply
Post Reply 




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