The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Door set to locked, but unlocked?
Asaratha Offline
Junior Member

Posts: 14
Threads: 5
Joined: Jul 2011
Reputation: 0
#1
Door set to locked, but unlocked?

Hey, guys!

So, in my custom story I have a door set to "locked" and you must grab a key and you know, use it to unlock it.

Keys name = key_2
Doors name = keydoor_2

void OnStart()

{
AddUseItemCallback("", "key_1", "keydoor_1", "KeyOnDoor", true);
AddUseItemCallback("", "hidden_key", "hidden_door", "KeyOnHiddenDoor", true);
SetEntityPlayerInteractCallback("key_2", "Spawn_Monster", true);
AddUseItemCallback("", "key_2", "keydoor_2", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("keydoor_1", false, true);
    PlaySoundAtEntity("", "unlock_door", "keydoor_1", 0, false);
    RemoveItem("key_1");
    SetSwingDoorLocked("keydoor_2", false, true);
    PlaySoundAtEntity("", "unlock_door", "keydoor_2", 0, false);
    RemoveItem("key_2");
}
void Spawn_Monster(string &in entity)
{
    SetEntityActive("grunt", true);
    AddEnemyPatrolNode("grunt", "PathNodeArea_1", 2, "");
    AddEnemyPatrolNode("grunt", "PathNodeArea_2", 0, "");
    AddEnemyPatrolNode("grunt", "PathNodeArea_3", 4, "");
}

For some reason, the door is always unlocked and I just can't get it to stay locked.

Any ideas?
08-01-2011, 04:23 PM
Find


Messages In This Thread
Door set to locked, but unlocked? - by Asaratha - 08-01-2011, 04:23 PM



Users browsing this thread: 2 Guest(s)