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
Script help!
klacke Offline
Junior Member

Posts: 7
Threads: 4
Joined: May 2011
Reputation: 0
#1
Script help!

I have just started with the editor. but when i script so a key would open a door i just get error when opening my map...

Here is my scrip

////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "monsterdoorkey_1", "monsterdoor", "UsedKeyOnDoor", true);
}
void MyFunc(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("monsterdoor", False, True);
PlaySoundAtEntity("", "unlock_door", "monsterdoor", 0, false);
RemoveItem(monsterdoorkey_1);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}


Anyone got a clue whats wrong?
Sorry for my bad english Tongue
(This post was last modified: 06-05-2011, 06:22 AM by klacke.)
05-15-2011, 10:17 AM
Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#2
RE: Script help!

(05-15-2011, 10:17 AM)klacke Wrote: I have just started with the editor. but when i script so a key would open a door i just get error when opening my map...

Here is my scrip

////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "monsterdoorkey_1", "monsterdoor", "UsedKeyOnDoor", true);
}
void MyFunc(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("monsterdoor", False, True);
PlaySoundAtEntity("", "unlock_door", "monsterdoor", 0, false);
RemoveItem(monsterdoorkey_1);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}


Anyone got a clue whats wrong?
Sorry for my bad english Tongue

Try this:

////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "monsterdoorkey_1", "monsterdoor", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
   SetSwingDoorLocked("monsterdoor", false, true);
       PlaySoundAtEntity("", "unlock_door", "monsterdoor", 0, false);
       RemoveItem("monsterdoorkey_1");
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

Added quotes around "monsterdoorkey_1", changed the MyFunc to UsedKeyOnDoor (needs to be the same as the callback above) and changed "False, True" to "false, true" (not sure, but it might not work if capitalized.
05-15-2011, 10:26 AM
Find
klacke Offline
Junior Member

Posts: 7
Threads: 4
Joined: May 2011
Reputation: 0
#3
RE: Script help!

haha it was so easy? omg ;P Ty!
05-15-2011, 10:31 AM
Find




Users browsing this thread: 1 Guest(s)