HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Max Gold/Lumber

02-23-2007, 11:15 PM#1
notor
how do you set a maximum amount of gold or lumber that a player can have?
02-24-2007, 12:24 AM#2
WNxCryptic
Advanced -> Gameplay Constants
02-24-2007, 02:50 AM#3
notor
cool, is there any way to adjust this in game? like, if a player has a Lumber Mill he can gather more lumber?
02-24-2007, 09:11 AM#4
darkwulfv
Periodic trigger. Check to see how many lumber mills a player has. Lets say for each lumber mill you can have a maximum of 200 more wood.

Set an integer variable to the number of lumber mills x 200.
Compare the player's current wood amount to the max. If it's less, do nothing. If more, set their wood property to the max. You can then do whatever you feel like doing to prevent them from getting more lumber for the time being, or w/e.
02-26-2007, 11:04 AM#5
Alvatar
or you can have triggers that will run recount when lumber mill is built / dies to save performance. Triggers that runing only if necessary are always better than periodic ones ;)
02-26-2007, 03:27 PM#6
WNxCryptic
Like when a unit builds another lumber mill, re-run the check for all players (just to be safe), that'll save some computational time.

Be aware though, that the lumber a player has cannot EVER exceed the lumber maximum set in gameplay constants.