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
I Need A Help Regarding The Lock Doors
Jayvee17 Offline
Junior Member

Posts: 25
Threads: 6
Joined: May 2011
Reputation: 0
#1
I Need A Help Regarding The Lock Doors

When I Try My Custom Story, I Get My 1st Key That Can Unlock The 1st Door.. There Are Many Locked Doors Especially In The 2nd Floor...But When I Unlock The 1st Door... I Go To The 2nd Floor And All The Locked Doors Are Unlocked Too... Please Help Me...This Is My Custom Story's .hps...

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Door_1_Key", "Door_1", "UsedKeyOnDoor", true);

AddUseItemCallback("", "Door_3_Key", "Door_3", "UsedKeyOnDoor", true);

AddUseItemCallback("", "Door_4_Key", "Door_4", "UsedKeyOnDoor", true);

AddUseItemCallback("", "Crowbar_1", "Door_5", "UsedKeyOnDoor", true);

AddUseItemCallback("", "Door_6_Key", "Door_6", "UsedKeyOnDoor", true);

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

SetSwingDoorLocked("Door_3", false, true);
PlaySoundAtEntity("", "unlock_door", "Door_3", 0, false);
RemoveItem("Door_3_Key");

SetSwingDoorLocked("Door_4", false, true);
PlaySoundAtEntity("", "unlock_door", "Door_4", 0, false);
RemoveItem("Door_4_Key");

SetSwingDoorLocked("Door_5", false, true);
PlaySoundAtEntity("", "unlock_door", "Door_5", 0, false);
RemoveItem("Crowbar_1");

SetSwingDoorLocked("Door_6", false, true);
PlaySoundAtEntity("", "unlock_door", "Door_6", 0, false);
RemoveItem("Door_6_Key");

}

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

}

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

}
05-29-2011, 04:58 PM
Find
laser50 Offline
Member

Posts: 242
Threads: 22
Joined: Apr 2011
Reputation: 0
#2
RE: I Need A Help Regarding The Lock Doors

I have no idea, but i think you gotta seperate them.
05-29-2011, 05:25 PM
Find
iVicio Offline
Junior Member

Posts: 4
Threads: 1
Joined: Sep 2010
Reputation: 0
#3
RE: I Need A Help Regarding The Lock Doors

// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Door_1_Key", "Door_1", "UsedKeyOnDoor_01", true);

AddUseItemCallback("", "Door_3_Key", "Door_3", "UsedKeyOnDoor_02", true);

AddUseItemCallback("", "Door_4_Key", "Door_4", "UsedKeyOnDoor_03", true);

AddUseItemCallback("", "Crowbar_1", "Door_5", "UsedKeyOnDoor_04", true);

AddUseItemCallback("", "Door_6_Key", "Door_6", "UsedKeyOnDoor_05", true);

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

void UsedKeyOnDoor_02(string &in asItem, string &in asEntity)
}
SetSwingDoorLocked("Door_3", false, true);
PlaySoundAtEntity("", "unlock_door", "Door_3", 0, false);
RemoveItem("Door_3_Key");
}

void UsedKeyOnDoor_03(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door_4", false, true);
PlaySoundAtEntity("", "unlock_door", "Door_4", 0, false);
RemoveItem("Door_4_Key");
}
void UsedKeyOnDoor_04(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door_5", false, true);
PlaySoundAtEntity("", "unlock_door", "Door_5", 0, false);
RemoveItem("Crowbar_1");
{

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


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

}

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

}

Wink
05-29-2011, 06:14 PM
Website Find
Jayvee17 Offline
Junior Member

Posts: 25
Threads: 6
Joined: May 2011
Reputation: 0
#4
RE: I Need A Help Regarding The Lock Doors

It's Not Working...
05-30-2011, 08:56 AM
Find
laser50 Offline
Member

Posts: 242
Threads: 22
Joined: Apr 2011
Reputation: 0
#5
RE: I Need A Help Regarding The Lock Doors

Are the Door_1 and Key1_Door1 Or something Exactly the same as the ones you wanna open?
05-30-2011, 12:05 PM
Find
Jayvee17 Offline
Junior Member

Posts: 25
Threads: 6
Joined: May 2011
Reputation: 0
#6
RE: I Need A Help Regarding The Lock Doors

(05-30-2011, 12:05 PM)laser50 Wrote: Are the Door_1 and Key1_Door1 Or something Exactly the same as the ones you wanna open?
Yes It Is...
05-30-2011, 01:54 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#7
RE: I Need A Help Regarding The Lock Doors

Still got problems with that script?

Try this:

void OnStart()
{
     AddUseItemCallback("", "Door_1_Key", "Door_1", "UsedKeyOnDoor", true);
     AddUseItemCallback("", "Door_3_Key", "Door_3", "UsedKeyOnDoor", true);
     AddUseItemCallback("", "Door_4_Key", "Door_4", "UsedKeyOnDoor", true);
     AddUseItemCallback("", "Crowbar_1", "Door_5", "UsedKeyOnDoor", true);
     AddUseItemCallback("", "Door_6_Key", "Door_6", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
     SetSwingDoorLocked(asEntity, false, true);
     PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
     RemoveItem(asItem);
}

It makes it much more simplified and easier to read. Smile

05-30-2011, 02:24 PM
Find
DannieWest Offline
Member

Posts: 156
Threads: 13
Joined: Apr 2011
Reputation: 0
#8
RE: I Need A Help Regarding The Lock Doors

(05-29-2011, 06:14 PM)iVicio Wrote: void UsedKeyOnDoor_01(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "Door_1", 0, false);
RemoveItem("Door_1_Key");

void UsedKeyOnDoor_02(string &in asItem, string &in asEntity)
}
SetSwingDoorLocked("Door_3", false, true);
PlaySoundAtEntity("", "unlock_door", "Door_3", 0, false);
RemoveItem("Door_3_Key");
}

The problem with this script here is 1. you forgot to put a } after RemoveItem("Door_1_Key); and 2. under UsedKeyOnDoor_02 there should be a {, instead of } Smile
If it dun work after that, then I don't know :o And I agree with Kyle, if you make it his way you see more clearly what belongs to which and so =)
05-30-2011, 02:41 PM
Find
Jayvee17 Offline
Junior Member

Posts: 25
Threads: 6
Joined: May 2011
Reputation: 0
#9
RE: I Need A Help Regarding The Lock Doors

Ok Thanks For The Help... I Deleted My Custom Story XDD...
05-30-2011, 03:08 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#10
RE: I Need A Help Regarding The Lock Doors

(05-30-2011, 03:08 PM)Jayvee17 Wrote: Ok Thanks For The Help... I Deleted My Custom Story XDD...

That wasn't a good idea... unless you plan to make a better one. Tongue

Perhaps you should keep getting good scripting methods and practice more and then make a new one.

05-30-2011, 03:22 PM
Find




Users browsing this thread: 1 Guest(s)