Hello TC, Regist here.
Currently playing around with the core and trying to create quest objectives. I’m up to the final quest in the chain and I’m having a couple of problems. I’ve not got a great deal of formal knowledge with C++ and most of what I do is examining other working part of the code and applying or changing them to the best of my ability in order to fulfill a purpose - in fact I’m suprised I’ve made it this far on my own and I’m happy to say I’ve learnt a lot along the way. Anyway, Part of the scenario involves resources accumulation, a lot like the accumulation of resources, AB is the best analogue I can think of that everyone will have some experience with.
Anyway, I need the client to display the number of resources accumulated, this will begin at zero and tick up to infinity, or a set value if infinity causes problems. (In essence the difficulty of the quest (NPC spawn rate and aggro range, certain spell cast rates etc.) is designed to increase as an “enemy” group of NPCs generates a resource, the accumulation of the resource will hopefully be modifiable; again, analogous to the modification of tic rate and amount in AB based on number of bases controlled - but I realise the information I’ve bracketed here involves a lot more than a simple timer so it’s not the main part I’m worrying about for now, I’d also like a certain amount of resources to be “lost” when certain quest objectives are met, but ignore that part for now).
As you see, the main analogy I’m working on for the “timer” element is that of AB resource accumulation. This presents a problem as I can’t quite figure out how it works from examining Battleground/BattlegroundAB.cpp/h; The area where the tic amount and frequency is controlled is simple to identify and the setting for the max value looks simple. The part I struggle with is finding out where the function of the “timer” is declared and how it works and how it stores the value in memory so that I might modify that logic to fit my own needs.
This might be the worst way of doing it mind you; it might be easier to code a simple modifiable resource timer that stores an increasing value in memory until a certain point, but my problem here is that I need the client to display that value(a text display think; “Resources:####” at the top of the screen a lot like AB or any manner of quests where a resource timer exists) and have no idea of how to go about doing that. If I could get that to work I could probably then write another process to read the value in memory and modify other values or conditions accordingly for the quest, as well as add conditions where certain amounts would be subtracted from the value.
If anyone can give me any pointers, that’d be great.