swapinamnesia
Junior Member
Posts: 3
Threads: 1
Joined: Feb 2012
Reputation:
0
|
Need help with key sais error
Hi im trying to make my first amnesia map i did a map with a key and a door that was locked but when i try to load the map in amnesia this error pops up
FATAL ERROR
FATAL ERROR: Could not load script file custom_stories/TheHauntedCellar/maps/TheHauntedCellar.hps! main (13,16) : ERR : Key_1 is not declared
What does that mean??? and heres my script in the hps file
void OnStart()
{
AddUseItemCallback("", "Key_1", "door_1", "UsedKeyOnDoor", true);
}
void FUNCTION(string &in item, string &in door)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem(Key_1);
}
Could anyone help me have been searching on youtube and google for a solution but i cant find any please help.
|
|
02-29-2012, 11:48 PM |
|
Tanshaydar
From Beyond
Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation:
67
|
RE: Need help with key sais error
void FUNCTIONUsedKeyOnDoor(string &in item, string &in door)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem(Key_1 "Key_1");
}
|
|
03-01-2012, 12:18 AM |
|
Obliviator27
Posting Freak
Posts: 792
Threads: 10
Joined: Jul 2011
Reputation:
66
|
RE: Need help with key sais error
void FUNCTIONUsedKeyOnDoor(string &in item, string &in door)(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem(Key_1 "Key_1");
}
|
|
03-01-2012, 12:58 AM |
|
Tanshaydar
From Beyond
Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation:
67
|
RE: Need help with key sais error
You don't have to write asItem and asEntity if you are not using them as string variables.
|
|
03-01-2012, 01:30 AM |
|
Juby
Senior Member
Posts: 290
Threads: 2
Joined: May 2011
Reputation:
5
|
RE: Need help with key sais error
My personal favorite way to do this:
void UsedKeyOnDoor(string &in Item, string &in Door)
{
SetSwingDoorLocked(Door, false, true);
PlaySoundAtEntity("", "unlock_door", Door, 0, false);
RemoveItem(Item);
}
so you can use it multiple times
Insanity. Static.
|
|
03-01-2012, 07:01 AM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: Need help with key sais error
(03-01-2012, 07:01 AM)Juby Wrote: My personal favorite way to do this:
void UsedKeyOnDoor(string &in Item, string &in Door)
{
SetSwingDoorLocked(Door, false, true);
PlaySoundAtEntity("", "unlock_door", Door, 0, false);
RemoveItem(Item);
}
so you can use it multiple times Wouldn't it be
SetSwingDoorLocked(asEntity, false, true);
|
|
03-01-2012, 07:08 AM |
|
Tanshaydar
From Beyond
Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation:
67
|
RE: Need help with key sais error
It wouldn't be because:
void UsedKeyOnDoor(string &in Item, string &in Door)
{
SetSwingDoorLocked(Door, false, true);
PlaySoundAtEntity("", "unlock_door", Door, 0, false);
RemoveItem(Item);
}
|
|
03-01-2012, 08:57 AM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: Need help with key sais error
Ah, didn't read that.
|
|
03-01-2012, 09:08 AM |
|
jessehmusic
Senior Member
Posts: 423
Threads: 102
Joined: Dec 2011
Reputation:
8
|
RE: Need help with key sais error
(02-29-2012, 11:48 PM)swapinamnesia Wrote: Hi im trying to make my first amnesia map i did a map with a key and a door that was locked but when i try to load the map in amnesia this error pops up
FATAL ERROR
FATAL ERROR: Could not load script file custom_stories/TheHauntedCellar/maps/TheHauntedCellar.hps! main (13,16) : ERR : Key_1 is not declared
What does that mean??? and heres my script in the hps file
void OnStart()
{
AddUseItemCallback("", "Key_1", "door_1", "UsedKeyOnDoor", true);
}
void FUNCTION(string &in item, string &in door)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem(Key_1);
}
Could anyone help me have been searching on youtube and google for a solution but i cant find any please help. void OnStart()
{
AddUseItemCallback("", "Key_1", "door_1", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in item, string &in door)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem(Key_1);
}
try this
|
|
03-01-2012, 04:53 PM |
|
swapinamnesia
Junior Member
Posts: 3
Threads: 1
Joined: Feb 2012
Reputation:
0
|
RE: Need help with key sais error
Thanks guys so much it works now
|
|
03-02-2012, 05:03 PM |
|
|