06-06-2013, 01:34 PM
06-06-2013, 02:18 PM
You can adjust how many Thalers you need to open a chest. You can do so, but there will be no menu to say that will you open this or not.
06-06-2013, 02:27 PM
Where do i change it? Do i need to add a code or something? And how do i see how many Thalers i got in game?
06-06-2013, 02:42 PM
(06-06-2013, 02:27 PM)TotalFragout Wrote: [ -> ]Where do i change it? Do i need to add a code or something? And how do i see how many Thalers i got in game?
You need to add some scripting. And no, you can't see how many Thalers you have. You need to set the value it self.
06-06-2013, 03:36 PM
Can you please send me a code? I can rep+ you for the help.
06-06-2013, 04:03 PM
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.
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.
Code:
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.
}
}
06-06-2013, 05:15 PM
Thanks man. Rep+ for you.
But there's only 1 error that says "Unexpected end of file"
Below is my ending of the hps file
void ThalerAdd(string &in asEntity, string &in type)
{
if(GetLocalVarInt("ThalerCount") == 2)
{
SetSwingDoorLocked("Treasure_Chest", false, true);
}
But there's only 1 error that says "Unexpected end of file"
Below is my ending of the hps file
void ThalerAdd(string &in asEntity, string &in type)
{
if(GetLocalVarInt("ThalerCount") == 2)
{
SetSwingDoorLocked("Treasure_Chest", false, true);
}
06-06-2013, 05:55 PM
Add another } below the existing one. That should do the trick.
06-07-2013, 02:30 PM
(06-06-2013, 05:15 PM)TotalFragout Wrote: [ -> ]Thanks man. Rep+ for you.
But there's only 1 error that says "Unexpected end of file"
Below is my ending of the hps file
void ThalerAdd(string &in asEntity, string &in type)
{
if(GetLocalVarInt("ThalerCount") == 2)
{
SetSwingDoorLocked("Treasure_Chest", false, true);
}
If you wonder why because the first {.
void ThalerAdd(string &in asEntity, string &in type)
{ // first one does not have anything to close it }
if(GetLocalVarInt("ThalerCount") == 2)
{
SetSwingDoorLocked("Treasure_Chest", false, true);
} // And this one belongs to GetLocalVarInt
} // Closes the the bracket on the top.
Hope this explains it a bit to you.