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
Needle on Door [SOLVED]
Karai16 Offline
Member

Posts: 164
Threads: 24
Joined: Apr 2011
Reputation: 0
#1
Photo  Needle on Door [SOLVED]

Hey guys, I'm once again trying to get something to work, and it just doesn't... Huh
I'm trying to get a door open with a needle, but it just says that I cannot use the needle that way
void OnStart()
{
AddUseItemCallback("", "HollowNeedle", "GamesDoor", "UsedItemOnDoor", true);
}

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

Can anybody tell me what's wrong?

Custom stories:
Her Games (100% Complete)
Her Games, All Bugs Fixed (100% Complete)
(This post was last modified: 05-13-2011, 09:11 PM by Karai16.)
05-13-2011, 06:47 PM
Find
dragonlordsd Offline
Member

Posts: 112
Threads: 7
Joined: May 2011
Reputation: 0
#2
RE: Needle on Door

umm... i think it's supposed to read: SetSwingDoorLocked("GamesDoor", false, true);
05-13-2011, 06:52 PM
Find
Anxt Offline
Senior Member

Posts: 588
Threads: 12
Joined: Mar 2011
Reputation: 10
#3
RE: Needle on Door

Did you rename the hollow needle to HollowNeedle? If not, the name of the entity is likely "hollow_needle_1".

The only thing I can suggest is to double and triple check to make sure all names are what they should be. The code looks fine to me.

05-13-2011, 06:57 PM
Find
dragonlordsd Offline
Member

Posts: 112
Threads: 7
Joined: May 2011
Reputation: 0
#4
RE: Needle on Door

oh yeah, and in mine I usually define the removed item:
RemoveItem("HollowNeedle");

Don't know if that changes anything though. Anxt is probably right, he knows more.
05-13-2011, 07:07 PM
Find
Anxt Offline
Senior Member

Posts: 588
Threads: 12
Joined: Mar 2011
Reputation: 10
#5
RE: Needle on Door

asEntity and asItem will work in the ways Karai used them, and since the game isn't spitting out an error, I think it is just a mis-named object somewhere.

05-13-2011, 07:08 PM
Find
dragonlordsd Offline
Member

Posts: 112
Threads: 7
Joined: May 2011
Reputation: 0
#6
RE: Needle on Door

yeah, I thought so, but I wasn't sure.
05-13-2011, 07:11 PM
Find
Karai16 Offline
Member

Posts: 164
Threads: 24
Joined: Apr 2011
Reputation: 0
#7
RE: Needle on Door

(05-13-2011, 07:08 PM)Anxt Wrote: asEntity and asItem will work in the ways Karai used them, and since the game isn't spitting out an error, I think it is just a mis-named object somewhere.

yeah, But I'm pretty sure I named my Hollow Needle HollowNeedle, and also but it in that ItemSub something bar...

-------
EDIT: nvm, I found the mistake... In the level editor I misspelled the name (HolowNeedle)
at Dragonlordsd, I use asEntity and asItem instead of the names because then I can reuse the function, instead of making a UsedKeyOnDoor1, "2... etc

Custom stories:
Her Games (100% Complete)
Her Games, All Bugs Fixed (100% Complete)
(This post was last modified: 05-13-2011, 09:11 PM by Karai16.)
05-13-2011, 08:15 PM
Find
Acies Offline
Posting Freak

Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation: 73
#8
RE: Needle on Door

The itemSub is used to name the item/add description using the .lang file and will not affect your "open door" script in any way.

The only possible issue is a false name on either the needle or the door.

[Image: mZiYnxe.png]


05-13-2011, 08:23 PM
Find




Users browsing this thread: 1 Guest(s)