Storfigge
Member
Posts: 101
Threads: 31
Joined: Sep 2012
Reputation:
0
|
Hollow needle
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?
|
|
12-06-2012, 01:53 PM |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
RE: Hollow needle
Exactly, what kind of problem do you have? I don't see anything wrong in the script.
THE OTHERWORLD (WIP)
Aculy iz dolan.
|
|
12-06-2012, 03:10 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Hollow needle
Yea, whats the problem.. and what is a "barred door"?
Trying is the first step to success.
|
|
12-06-2012, 03:39 PM |
|
6346021815
Junior Member
Posts: 23
Threads: 2
Joined: May 2012
Reputation:
2
|
RE: Hollow needle
Yea, there is nothing wrong with the script.
|
|
12-06-2012, 04:21 PM |
|
Saitoshiba
Junior Member
Posts: 7
Threads: 2
Joined: Dec 2012
Reputation:
0
|
RE: Hollow needle
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.
|
|
12-06-2012, 11:12 PM |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
RE: Hollow needle
Maybe for barred he meant a level door. In that case, use:
SetLevelDoorLocked("LevelDoor", false);
THE OTHERWORLD (WIP)
Aculy iz dolan.
|
|
12-06-2012, 11:16 PM |
|
Storfigge
Member
Posts: 101
Threads: 31
Joined: Sep 2012
Reputation:
0
|
RE: Hollow needle
(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
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 ! Have anyone else experienced something like this or do you know what is causing this problem?
(This post was last modified: 12-07-2012, 12:05 AM by Storfigge.)
|
|
12-06-2012, 11:17 PM |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
RE: Hollow needle
(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.
THE OTHERWORLD (WIP)
Aculy iz dolan.
|
|
12-07-2012, 12:05 AM |
|
Storfigge
Member
Posts: 101
Threads: 31
Joined: Sep 2012
Reputation:
0
|
RE: Hollow needle
(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.
|
|
12-07-2012, 01:44 AM |
|
TheGreatCthulhu
Member
Posts: 213
Threads: 10
Joined: Oct 2010
Reputation:
32
|
RE: Hollow needle
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?
|
|
12-07-2012, 03:33 AM |
|
|