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
[SOLVED] Newbie .lang file error
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#4
RE: Newbie .lang file error

Might be wrong, but you seem to miss keyroom1 in the script. Also add OnStart().Also, you can just use asEntity and asItem in the UsedKeyOnDoor function. So basically:
void OnStart()
{
}
////////////////////////////
// Run when entering map

void OnEnter()
{
AddUseItemCallback("", "room101key", "room101", "UsedKeyOnDoor", true);
AddUseItemCallback("", "keyroom1", "thedooritopens", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", asEntity, "room101", 0, false);
RemoveItem(asItem);
}
This way, you save the whole function of the other key. And doesn't the true at AddUseItemCallback already destroy the item? No need for RemoveItem, as far as I know. Might want to switch the Callbacks from OnEnter to OnStart, but it depends on what exactly you wanted to do with it.
For the problem itself, those are the only things I noticed, and I might be wrong. Good luck Smile

Edit: you seem to miss the extension for the sound file, too. So, it's unlock_door.snt.
(This post was last modified: 06-18-2012, 09:25 PM by Cruzore.)
06-18-2012, 09:20 PM
Find


Messages In This Thread
[SOLVED] Newbie .lang file error - by The Shanus - 06-18-2012, 08:17 PM
RE: Newbie .lang file error - by Statyk - 06-18-2012, 08:34 PM
RE: Newbie .lang file error - by The Shanus - 06-18-2012, 08:40 PM
RE: Newbie .lang file error - by Cruzore - 06-18-2012, 09:20 PM
RE: Newbie .lang file error - by The Shanus - 06-18-2012, 09:24 PM
RE: Newbie .lang file error - by Cruzore - 06-18-2012, 09:35 PM
RE: Newbie .lang file error - by The Shanus - 06-18-2012, 09:41 PM
RE: Newbie .lang file error - by Cruzore - 06-18-2012, 10:22 PM
RE: Newbie .lang file error - by The Shanus - 06-18-2012, 10:36 PM
RE: Newbie .lang file error - by Cruzore - 06-18-2012, 10:40 PM



Users browsing this thread: 1 Guest(s)