Frictional Games Forum (read-only)
Hollow needle - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Hollow needle (/thread-19461.html)

Pages: 1 2


Hollow needle - Storfigge - 12-06-2012

Hey can someone please tell me why this doesn't work? I've had a similar problem before but I just removed the map.cache to fix it but that wont work this time.


void Onstart()
{
AddUseItemCallback("", "hneedle", "pdoor", "UsedNeedleOnPdoor", true);
}


void UsedNeedleOnPdoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("pdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "pdoor", 0, false);
RemoveItem("hneedle");
}


void OnEnter()
{
}


void OnLeave()
{
}

According to what I've read you do the same things with the hollow needle as you do with a key. By the way I'm using a barred door though that shouldn't matter right?


RE: Hollow needle - The chaser - 12-06-2012

Exactly, what kind of problem do you have? I don't see anything wrong in the script.


RE: Hollow needle - FlawlessHappiness - 12-06-2012

Yea, whats the problem.. and what is a "barred door"?


RE: Hollow needle - 6346021815 - 12-06-2012

Yea, there is nothing wrong with the script.


RE: Hollow needle - Saitoshiba - 12-06-2012

I am not sure if this is the main problem, but try to put the extension of the sound in:

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



and change for false here:


SetSwingDoorLocked("pdoor", false, false);



but I am not sure if this will be much difference. Try to look at the entities name and see if it's the same one. For me looks perfectly fine. I usually use the default name of the entity to avoid misspelling their names on the script.


RE: Hollow needle - The chaser - 12-06-2012

Maybe for barred he meant a level door. In that case, use:

SetLevelDoorLocked("LevelDoor", false);


RE: Hollow needle - Storfigge - 12-06-2012

(12-06-2012, 03:39 PM)beecake Wrote: Yea, whats the problem.. and what is a "barred door"?
Don't know why I didn't write down my problem... I can't get my hollow needle to unlock a door. And a barred door is what the name suggests :S a door with bars like in a prison.

Ok I've kind of found out the problem. The problem is that the map wont answer my .hps file Dodgy
I tried with another code and this one didn't work either. I've removed the .map_cache, I've checked the code, I've rewritten the .hps file and it has the correct name. What is wrong? This is making me quite annoyed Angry! Have anyone else experienced something like this or do you know what is causing this problem?


RE: Hollow needle - The chaser - 12-07-2012

(12-06-2012, 11:17 PM)Storfigge Wrote:
(12-06-2012, 03:39 PM)beecake Wrote: Yea, whats the problem.. and what is a "barred door"?
Don't know why I didn't write down my problem... I can't get my hollow needle to unlock a door. And a barred door is what the name suggests :S a door with bars like in a prison.
Then just check names. Angel script is case-sensitive.


RE: Hollow needle - Storfigge - 12-07-2012

(12-07-2012, 12:05 AM)The chaser Wrote:
(12-06-2012, 11:17 PM)Storfigge Wrote:
(12-06-2012, 03:39 PM)beecake Wrote: Yea, whats the problem.. and what is a "barred door"?
Don't know why I didn't write down my problem... I can't get my hollow needle to unlock a door. And a barred door is what the name suggests :S a door with bars like in a prison.
Then just check names. Angel script is case-sensitive.
There's nothing wrong with the code it's just that my hps file wont work? It's named correctly and everything. But none of the things I've written work. All the other maps I have i this CS works perfectly.


RE: Hollow needle - TheGreatCthulhu - 12-07-2012

Are you sure about the names? You can use the Print() or the AddDebugMessage() function to check if the script is loaded at all (just call it from OnEnter()). For the first one, you'll have to check the log file, so make it print something distinctive, like:
Print("---------------------------- OnEnter() function -------------------------------");

AddDebugMessage() func should display something on the screen if the script get's called, and debug messages are enabled.

If any of these is shown, then the script is executed, but there's some other subtle problem.
Also, if are you loading a saved game? This can sometimes cause strange behavior when the map is sitll being developed - have you tried reloading the map from the debug menu?