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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help
MindScope Offline
Junior Member

Posts: 3
Threads: 1
Joined: Feb 2017
Reputation: 0
#1
Help

I was told to post my problem on this forum. So, I'm making a custom story (i'm a little new to this), and I'm trying to set up a key with a door. I have the key and door named and i have the correct coding for them to work together. I also have the latest version of amnesia, and notepad++. But whenever i save the script, and boot up the custom story, I can't use the key with the door. Please help
02-23-2017, 02:13 AM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#2
RE: Help

When you say you can't use the key, does the game just say "No object to use this item on" or similar? Then that means you need to add an AddUseItemCallback() for your key in OnStart(). Recheck the names of your door, key, and your .hps script file so that it matches your map name.

You can also post your script here for us to look at.

Discord: Romulator#0001
[Image: 3f6f01a904.png]
02-23-2017, 07:04 AM
Find
MindScope Offline
Junior Member

Posts: 3
Threads: 1
Joined: Feb 2017
Reputation: 0
#3
RE: Help

It says "cannot use this item this way" or something like that. Here's the script:
[Image: fhwRuq9.png]
(This post was last modified: 02-24-2017, 12:54 AM by MindScope.)
02-24-2017, 12:54 AM
Find
XeOnTricks Offline
Junior Member

Posts: 27
Threads: 12
Joined: Feb 2017
Reputation: 0
#4
RE: Help

(02-24-2017, 12:54 AM)MindScope Wrote: It says "cannot use this item this way" or something like that. Here's the script:
[Image: fhwRuq9.png]

try this. it may work


void OnStart()
{

AddUseItemCallback("", "Key", "Door/", "Unlock", true);

}


void Unlock(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);

PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);

RemoveItem(asItem);
}


if it does not work someone else can correct the issue. Smile hopefully this helped you.
02-24-2017, 06:22 AM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#5
RE: Help

If it says "Cannot Use Item This Way", it usually means the names of your Key or your Door are wrong in the Level Editor.

Make sure that the "Key" in your script is the same name as the key in the Level Editor. It could be something like "key_study_1" and not just key. The same with the door, since the door may be something completely different like "mansion_2".

----------

The code above doesn't change much. It only plays a sound at the door and removes the item from the inventory. If the names referenced in the code as they do in the Level Editor do not match, then the above code won't change anything.

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 02-24-2017, 09:27 AM by Romulator.)
02-24-2017, 09:25 AM
Find
XeOnTricks Offline
Junior Member

Posts: 27
Threads: 12
Joined: Feb 2017
Reputation: 0
#6
RE: Help

(02-24-2017, 09:25 AM)Romulator Wrote: If it says "Cannot Use Item This Way", it usually means the names of your Key or your Door are wrong in the Level Editor.

Make sure that the "Key" in your script is the same name as the key in the Level Editor. It could be something like "key_study_1" and not just key. The same with the door, since the door may be something completely different like "mansion_2".

----------

The code above doesn't change much. It only plays a sound at the door and removes the item from the inventory. If the names referenced in the code as they do in the Level Editor do not match, then the above code won't change anything.

ik i just thought i would be nice and try to help. i was going to say the same thing you did but i thought it would be better for someone else to do that
02-24-2017, 10:11 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#7
RE: Help

Another thing that COULD be the issue is that the .hps file and the .map file are not named the same.
Make sure that your .map file is named "Level1.map" since that's what you've called your .hps file.

Trying is the first step to success.
(This post was last modified: 02-24-2017, 11:51 AM by FlawlessHappiness.)
02-24-2017, 10:58 AM
Find
MindScope Offline
Junior Member

Posts: 3
Threads: 1
Joined: Feb 2017
Reputation: 0
#8
RE: Help

(02-24-2017, 10:58 AM)FlawlessHappiness Wrote: Another thing that COULD be the issue is that the .hps file and the .map file are not named the same.
Make sure that your .map file is named "Level1.map" since that's what you've called your .hps file.

Thanks that worked!

Also thanks to everyone who tried to help Big Grin
02-24-2017, 08:34 PM
Find




Users browsing this thread: 1 Guest(s)