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
Script Help Two doors, one key?
KamenRiderSun Offline
Junior Member

Posts: 5
Threads: 2
Joined: Mar 2012
Reputation: 0
#1
Two doors, one key?

I'm currently working on a CS that's very choice driven. [Is "Bump in the Night" taken as a CS name? Blush ]
Right now, I'm having a little issue with making one key able to unlock two doors, removing the other choice in the process. My question is, is this even possible?

First I tried this:

void OnStart()
{
SetMessage("Messages", "Intro", 0);
AddUseItemCallback("OpenDoor", "ChoiceKey", "LevelDoor_Mansion", "UnlockLevelDoor", true);
AddUseItemCallback("OpenDoor", "ChoiceKey", "LevelDoor_Basement", "UnlockLevelDoor", true);
}

void UnlockLevelDoor(string &in item, string &in entity)
{
SetLevelDoorLocked(entity, false);
RemoveItem(item);

But no results. I then tried:

AddUseItemCallback("OpenDoor", "ChoiceKey", "LevelDoor_Mansion", "UnlockLevelDoor1", true);
AddUseItemCallback("OpenDoor", "ChoiceKey", "LevelDoor_Basement", "UnlockLevelDoor2", true);
}

void UnlockLevelDoor1(string &in item, string &in entity)
{
SetLevelDoorLocked(entity, false);
RemoveItem(item);
}
void UnlockLevelDoor2(string &in item, string &in entity)
{
SetLevelDoorLocked(entity, false);
RemoveItem(item);
}

Also, no results. My confusion is whether my scripting method or syntax are wrong, or if it's just not possible.
Thanks for any advice!
(This post was last modified: 03-26-2012, 10:50 PM by KamenRiderSun.)
03-26-2012, 10:47 PM
Find


Messages In This Thread
Two doors, one key? - by KamenRiderSun - 03-26-2012, 10:47 PM
RE: Two doors, one key? - by Your Computer - 03-26-2012, 11:07 PM
RE: Two doors, one key? - by KamenRiderSun - 03-27-2012, 12:04 AM
RE: Two doors, one key? - by Your Computer - 03-27-2012, 12:17 AM
RE: Two doors, one key? - by KamenRiderSun - 03-27-2012, 12:23 AM



Users browsing this thread: 1 Guest(s)