Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Needle on Door [SOLVED]
Author Message
Karai16 Offline
Member

Posts: 164
Joined: Apr 2011
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
dragonlordsd Offline
Member

Posts: 113
Joined: May 2011
Reputation: 0
Post: #2
RE: Needle on Door
umm... i think it's supposed to read: SetSwingDoorLocked("GamesDoor", false, true);
05-13-2011 06:52 PM
Find all posts by this user Quote this message in a reply
Anxt Offline
Senior Member

Posts: 588
Joined: Mar 2011
Reputation: 10
Post: #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 all posts by this user Quote this message in a reply
dragonlordsd Offline
Member

Posts: 113
Joined: May 2011
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Anxt Offline
Senior Member

Posts: 588
Joined: Mar 2011
Reputation: 10
Post: #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 all posts by this user Quote this message in a reply
dragonlordsd Offline
Member

Posts: 113
Joined: May 2011
Reputation: 0
Post: #6
RE: Needle on Door
yeah, I thought so, but I wasn't sure.
05-13-2011 07:11 PM
Find all posts by this user Quote this message in a reply
Karai16 Offline
Member

Posts: 164
Joined: Apr 2011
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Acies Offline
Posting Freak

Posts: 1,283
Joined: Feb 2011
Reputation: 54
Post: #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 all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)