Initial support for reading ini-defined campaign variables. #592
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm still working on this but wanted to open the PR now that I've got a general plan of what I'm going to be doing and have laid out some of the foundation. I ended up designing something that goes beyond simply tracking global variables but I really wanted to make something more extensible and flexible than what DTA uses.
The basic concept here is to have the client parse additional tags that can be added to missions in the battle ini that dynamically define integer variables and use some formula to map them to some in-game local/global variables. We convert this mapping to some kind of ini content to add to the spawnmap.ini, which should open up all sorts of design possibilities for campaign missions as well as better support for vanilla Tiberian Sun missions. It also means we can get the client to do things with these variables, like keep missions locked until you complete prerequisite missions.
This feature requires that mission maps be copied to spawnmap.ini to function and has limited functionality without specific game logging functions provided by Vinifera or Phobos used to dump the states of in-game variables. I would greatly appreciate some guidance on how to handle addressing these limitations.