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 Im sure this is easier than i am making it...
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#3
RE: Im sure this is easier than i am making it...

AddUseItemCallback("", "exitkey_2", "exitdoor_2", "KeyOnDoor4", true); ///here

You were missing a quotation after "exitdoor_2".

In addition, I modified your callbacks a bit using some "shortcuts"; this will greatly reduce excess lines of script and make it less cluttered; be sure to remove all of the other functions for the keys/doors that aren't "UseKeyOnDoor". If you can't get this to work, you can just use the one fix I pointed out.



////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "key_1", "door_1", "UseKeyOnDoor", true);
AddUseItemCallback("", "key_cabinet_1", "cabinet_1", "UseKeyOnDoor", true);
AddUseItemCallback("", "exitkey_1", "exitdoor_1", "UseKeyOnDoor", true);
AddUseItemCallback("", "exitkey_2", "exitdoor_2", "UseKeyOnDoor", true); ///here
AddUseItemCallback("", "exitkey_3", "exitdoor_3", "UseKeyOnDoor", true);
AddEntityCollideCallback("Player", "ScriptArea_1", "MonsterFunction1", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "MonsterFunction2", true, 1);
}


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




void MonsterFunction1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("enemy_1", true);
SetSwingDoorLocked("trapdoor_1", true, true);
}


void MonsterFunction2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("enemy_2", true);
SetSwingDoorLocked("trapdoor_1", true, true);
}


////////////////////////////
//Run when entering map
void OnEnter()
{


}


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


}
Hope that helped!

I rate it 3 memes.
(This post was last modified: 07-31-2012, 05:24 AM by Adny.)
07-31-2012, 05:21 AM
Find


Messages In This Thread
RE: Im sure this is easier than i am making it... - by Adny - 07-31-2012, 05:21 AM



Users browsing this thread: 1 Guest(s)