| 
		
	
		| TotalFragout   Junior Member
 
 Posts: 5
 Threads: 2
 Joined: Jun 2013
 Reputation: 
0
 | 
			|  Thalers and Treasure Chests 
 
				I was just wondering how many Thalers (money) i need to open a Treasure Chest and how i can change that in a Custom Story.
			 |  |  
	| 06-06-2013, 01:34 PM |  |  
	
		| PutraenusAlivius   Posting Freak
 
 Posts: 4,713
 Threads: 75
 Joined: Dec 2012
 Reputation: 
119
 | 
			| RE: Thalers and Treasure Chests 
 
				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.
			 
 "Veni, vidi, vici.""I came, I saw, I conquered."
 |  |  
	| 06-06-2013, 02:18 PM |  |  
	
		| TotalFragout   Junior Member
 
 Posts: 5
 Threads: 2
 Joined: Jun 2013
 Reputation: 
0
 | 
			| RE: Thalers and Treasure Chests 
 
				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?
			 
				
(This post was last modified: 06-06-2013, 02:29 PM by TotalFragout.)
 |  |  
	| 06-06-2013, 02:27 PM |  |  
	
		| PutraenusAlivius   Posting Freak
 
 Posts: 4,713
 Threads: 75
 Joined: Dec 2012
 Reputation: 
119
 | 
			| RE: Thalers and Treasure Chests 
 
				 (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.
			 
 "Veni, vidi, vici.""I came, I saw, I conquered."
 |  |  
	| 06-06-2013, 02:42 PM |  |  
	
		| TotalFragout   Junior Member
 
 Posts: 5
 Threads: 2
 Joined: Jun 2013
 Reputation: 
0
 | 
			| RE: Thalers and Treasure Chests 
 
				Can you please send me a code? I can rep+ you for the help.
			 |  |  
	| 06-06-2013, 03:36 PM |  |  
	
		| PutraenusAlivius   Posting Freak
 
 Posts: 4,713
 Threads: 75
 Joined: Dec 2012
 Reputation: 
119
 | 
			| 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 |  |  
	
		| TotalFragout   Junior Member
 
 Posts: 5
 Threads: 2
 Joined: Jun 2013
 Reputation: 
0
 | 
			| RE: Thalers and Treasure Chests 
 
				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);
 }
 |  |  
	| 06-06-2013, 05:15 PM |  |  
	
		| PutraenusAlivius   Posting Freak
 
 Posts: 4,713
 Threads: 75
 Joined: Dec 2012
 Reputation: 
119
 | 
			| RE: Thalers and Treasure Chests 
 
				Add another } below the existing one. That should do the trick.
			 
 "Veni, vidi, vici.""I came, I saw, I conquered."
 |  |  
	| 06-06-2013, 05:55 PM |  |  
	
		| VeNoMzTeamHysterical   Member
 
 Posts: 240
 Threads: 36
 Joined: Dec 2012
 Reputation: 
3
 | 
			| RE: Thalers and Treasure Chests 
 
				 (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.
			 
 |  |  
	| 06-07-2013, 02:30 PM |  |  |