Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Poll: Isnt this problem such a bitch!?
You do not have permission to vote in this poll.
YES IT'S SOO ANNOYING
100.00%
3 100.00%
nah, I don't make custom stories
0%
0 0%
Total 3 vote(s) 100%
* You voted for this item. [Show Results]

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Amnesia custom story .hps file problem HELP ASAP
Dynomite33 Offline
Junior Member

Posts: 18
Threads: 5
Joined: Dec 2011
Reputation: 0
#1
Bug  Amnesia custom story .hps file problem HELP ASAP

when I go to play my custom story it says
"
FATAL ERROR: could not load script file
'custom_stories/Mine/maps/00_tutorial.hps'!
main (11,2) : ERR : Unexpected end of file
this is my .hps

void OnStart()
{
AddUseItemCallback("", "BedroomKey_1", "bedroom_1, "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in as Entity);

{
SetSwingDoorLocked("bedroom_1", false, true);
PlaySoundAtEntity("", "unlock_door", "bedroom_1", 0, false);
RemoveItem("BedroomKey_1");
}

I've been playing around with this for about 5 HOURS
(This post was last modified: 12-30-2011, 03:06 PM by Dynomite33.)
12-30-2011, 02:28 AM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#2
RE: Amnesia custom story .hps file problem HELP ASAP

This is a Custom Story support question so doesn't belong to Technical Help section.
Your problem is that you forgot to close the " in your AddUseItemCallback function, exactly here:
AddUseItemCallback("", "BedroomKey_1", "bedroom_1, "UsedKeyOnDoor", true);
It should be like this:
AddUseItemCallback("", "BedroomKey_1", "bedroom_1", "UsedKeyOnDoor", true);

12-30-2011, 03:06 AM
Website Find
Dynomite33 Offline
Junior Member

Posts: 18
Threads: 5
Joined: Dec 2011
Reputation: 0
#3
RE: Amnesia custom story .hps file problem HELP ASAP

but now i have a problem that says
main (8,1) unexpected token '{'

If life gives you lemons, give them back and demand chocolate
snf*~scoutillite
(This post was last modified: 12-30-2011, 03:05 PM by Dynomite33.)
12-30-2011, 03:00 PM
Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#4
RE: Amnesia custom story .hps file problem HELP ASAP

You have a semi-colon at the end of "void UsedKeyOnDoor(string &in asItem, string &in as Entity)". Also you have "as Entity" instead of "asEntity". The following should work:
void OnStart()
{
AddUseItemCallback("", "BedroomKey_1", "bedroom_1", "UsedKeyOnDoor", true);
}

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

Edit: Code formatting fixed.
(This post was last modified: 12-30-2011, 03:22 PM by Apjjm.)
12-30-2011, 03:20 PM
Find
Dynomite33 Offline
Junior Member

Posts: 18
Threads: 5
Joined: Dec 2011
Reputation: 0
#5
RE: Amnesia custom story .hps file problem HELP ASAP

(12-30-2011, 03:20 PM)Apjjm Wrote: You have a semi-colon at the end of "void UsedKeyOnDoor(string &in asItem, string &in as Entity)". Also you have "as Entity" instead of "asEntity". The following should work:
void OnStart()
{
AddUseItemCallback("", "BedroomKey_1", "bedroom_1", "UsedKeyOnDoor", true);
}

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

Edit: Code formatting fixed.
my door doesnt work now :/
EDIT:
the key works on the door, but the door isnt locked to start with
my .hps

void OnStart()
{
AddUseItemCallback("", "bedroomkey_1", "bedroom_1", "UsedKeyOnDoor", true);
}

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

void OnEnter()
{
}

void OnLeave()
{
}



If life gives you lemons, give them back and demand chocolate
snf*~scoutillite
(This post was last modified: 12-30-2011, 04:36 PM by Dynomite33.)
12-30-2011, 04:24 PM
Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#6
RE: Amnesia custom story .hps file problem HELP ASAP

You will need to put "SetSwingDoorLocked" in the onStart event or mark the door as locked in the level editor.
12-30-2011, 06:17 PM
Find
Xeronaile Offline
Junior Member

Posts: 21
Threads: 2
Joined: Jan 2012
Reputation: 0
#7
RE: Amnesia custom story .hps file problem HELP ASAP

I'll show you my portion of my script file (Took some help for me as well) but it works for me.

Hps:


void OnStart()
{
AddUseItemCallback("", "cellar_key", "cellar_wood01_1", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "AreaHelp", "CollideAreaHelp", false, 1);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("cellar_wood01_1", false, true);
PlaySoundAtEntity("", "unlock_door", "cellar_wood01_1", 0, false);
RemoveItem("cellar_key");
}
02-01-2012, 02:47 AM
Find




Users browsing this thread: 1 Guest(s)