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
Thalers and Treasure Chests
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#6
RE: Thalers and Treasure Chests

MEMO
Small is 1
Medium is 5
Large is 10

Let's just say you need two thalers to open a chest. That means Small X 2 because 10 X 2 is 20.
void OnStart()
{
SetLocalVarInt("ThalerCount", 0); //The LocalVarInt that tracks count of the amount of Thalers you have. Make it Global if you want it across maps.
SetEntityCallbackFunc("coin_medium", "ThalerAdd"); //3 types. Small, Medium, and Large. Make sure they match in the Level Editor and put them in quote ("") in the script. And use _ instead of space.
SetEntityPlayerInteractCallback("Treasure_Chest", "ThalerCheck", false);
}

void ThalerAdd(string &in asEntity, string &in type)
{
AddLocalVarInt("ThalerCount", 1); //Adds thaler count to 1
}

void ThalerCheck(string &in asEntity)
{
if(GetLocalVarInt("ThalerCount") == 2) //2 because the scenario wants it to be two.
{
SetSwingDoorLocked("Treasure_Chest", false, true);
}

else if
{
SetMessage("MessageCategory", "MessageEntry", 0); //You need someone else to explain this part. I can't do it.
}
}

"Veni, vidi, vici."
"I came, I saw, I conquered."
06-06-2013, 04:03 PM
Find


Messages In This Thread
Thalers and Treasure Chests - by TotalFragout - 06-06-2013, 01:34 PM
RE: Thalers and Treasure Chests - by TotalFragout - 06-06-2013, 02:27 PM
RE: Thalers and Treasure Chests - by TotalFragout - 06-06-2013, 03:36 PM
RE: Thalers and Treasure Chests - by PutraenusAlivius - 06-06-2013, 04:03 PM
RE: Thalers and Treasure Chests - by TotalFragout - 06-06-2013, 05:15 PM



Users browsing this thread: 1 Guest(s)