#How to increase max cap gold greater than 99,999 ?
1 messages · Page 1 of 1 (latest)
you already asked this question awhile back. answer hasnt changed.
#1040153235165560842 message
if you want help with how to go about making those changes i can try to point you in the right direction
OMG! lol, sorry i completely forget about this, thank you for remind me. Sure! i would like to learn and see that point, it will help me a lot
ok, so the simplest way is to just track the gold in your own variable instead of valves gold value.
where every time the player gets gold you add to your variable and every time they lose gold you subtract from your variable, and at the same time you set valves gold to whatever your variable is or just to 99999 if your variable is greater than that.
and in panorama override the displayed gold count with your gold variable.
as mentioned in the other thread, this method has the problem where you wont be able to buy anything that costs more than valves gold cap since the shop is reading valves gold, not your custom variable.
the better alternative is to make your own shop, where you could have complete control over everything instead of being restricted by valves gold limits. but this is a lot more work.
for the simple way, you would use the gold filter to track gold gains/losses.
https://moddota.com/api/#!/vscripts/CDOTABaseGameMode#SetModifyGoldFilter
and you would probably want to turn this on too.
https://moddota.com/api/#!/vscripts/CDOTAGameRules#SetFilterMoreGold
to be honest, i havent used the gold filter beyond simple tests before. so im not sure if it actually filters all gold gains/losses.
if for some reason it doesnt, you could instead just check the players gold every frame in a timer and check for any losses/gains
thats pretty much all there is to it for the gold tracking part.
to override the displayed gold in panorama you would need to just launch the game and press f6 to open the panorama debugger. use the inspect element button and click on the gold and it will take you to where that panel is in the hierarchy.
just to see where it is and what panels its parented to
after knowing this, in code you would just need to use parent.FindChildTraverse("child_name") a few times, starting from your context panel $.GetContextPanel() to navigate to where the gold label is in the hierarchy.
and with the handle of that gold label panel, you can just set its text value.
panel.text = "123"
or it may be better to hide that panel and replace it with your own, so that valves not trying to update the value
any time their gold changes you would send an event from lua to panorama to update that text
if you dont know how to do any of that panorama stuff id suggest following some of the panorama tutorials on moddota https://moddota.com/panorama/inclusive-panorama-ui
just to learn the basics
Great man! thank you a lot, i will start learning more about panorama throught that link and after i will follow your instructions