Closed benloh closed 1 year ago
requested review from @jdanish
marked this merge request as ready
@jdanish I don't think anyone's using this at the moment, but if for some reason a blueprint needs to access the Round's roundTime
property, we can implement the round REFEREE_AGENT the same way that we're implementing global
. (roundTime
used to be in the global agent, but has been moved to a separate REFEREE_AGENT that manages rounds)
added 1 commit
In GitLab by @jdanish on Sep 11, 2022, 06:14
I don't actually recall what roundTime was - is that just the count within the round? In which case we can fake it with a global property of some sort? In which case I think we are fine.
In GitLab by @jdanish on Sep 11, 2022, 06:14
This appears to work, by the way - so I am OK with a merge if you are.
mentioned in commit ec608916fb8d53040db10e52086b4b4956edf7cd
Merges dev-bl/global -> dev-next
In trying to implement support for global properties in the wizard UI, it quickly became clear that the most efficient way to support global properties was to make the global agent a blueprint that can be edited like any other blueprint. Any other solutions involved torturous workarounds.
What this involves:
global
blueprint that is automatically added to every project. If a project is missing theglobal
blueprint, it will be added when it is opened and saved.global
agent has no properties beyond a normal agent properties. For the most part agent properties will be ignored. However, thevisible
property is set to false to so that the global agent does not appear on the screen.global
agent has aPopulation
feature enabled. (We can revisit this to see if it's necessary).Global
feature has now been removed. It is no longer necessary to use it to create and access global properties.global
blueprint as you would any other blueprint, and add anaddProp
line.global
as the blueprint name, e.g. insideFish
, you can useprop global.energyReleasedAsHeat add 5
featProp global.Population...
andfeatCall global.Population...
global
agent if you do not need it. You do not need to do anything with it.Conversion
In general, here's what you need to do for any project that is currently using the
Global
feature.global
agent will be added.addFeature Global
featCall Global.addGlobalProp xxx
calls to a newaddProp xxx
in theglobal
agent.featCall Global.globalProp xxx
calls to aprop global.xxx
in the current agent.featCall Global.getGlobalProp xxx
calls to aprop global.xxx
in the current agent.Example from
decomposition_energy
See
art-assets
repo, branchglobal-fix
, filedecomposition_energy.gemprj
for an example of how to do the conversion from use of the Global Feature to using the global agent.