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
Hollow needle
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#1
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
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#2
RE: Hollow needle

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

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
12-06-2012, 03:10 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#3
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
Find
6346021815 Offline
Junior Member

Posts: 23
Threads: 2
Joined: May 2012
Reputation: 2
#4
RE: Hollow needle

Yea, there is nothing wrong with the script.
12-06-2012, 04:21 PM
Find
Saitoshiba Offline
Junior Member

Posts: 7
Threads: 2
Joined: Dec 2012
Reputation: 0
#5
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
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#6
RE: Hollow needle

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

SetLevelDoorLocked("LevelDoor", false);

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
12-06-2012, 11:16 PM
Find
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#7
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 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?

(This post was last modified: 12-07-2012, 12:05 AM by Storfigge.)
12-06-2012, 11:17 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#8
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)
[Image: k6vbdhu]

Aculy iz dolan.
12-07-2012, 12:05 AM
Find
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#9
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
Find
TheGreatCthulhu Offline
Member

Posts: 213
Threads: 10
Joined: Oct 2010
Reputation: 32
#10
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?
(This post was last modified: 12-07-2012, 03:34 AM by TheGreatCthulhu.)
12-07-2012, 03:33 AM
Find




Users browsing this thread: 1 Guest(s)