Dynomite33
Junior Member
Posts: 18
Threads: 5
Joined: Dec 2011
Reputation:
0
|
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 |
|
Tanshaydar
From Beyond
Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation:
67
|
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 |
|
Dynomite33
Junior Member
Posts: 18
Threads: 5
Joined: Dec 2011
Reputation:
0
|
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 |
|
Apjjm
Is easy to say
Posts: 496
Threads: 18
Joined: Apr 2011
Reputation:
52
|
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 |
|
Dynomite33
Junior Member
Posts: 18
Threads: 5
Joined: Dec 2011
Reputation:
0
|
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 |
|
Apjjm
Is easy to say
Posts: 496
Threads: 18
Joined: Apr 2011
Reputation:
52
|
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 |
|
Xeronaile
Junior Member
Posts: 21
Threads: 2
Joined: Jan 2012
Reputation:
0
|
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 |
|
|