Logo Platform
logo amplifiers simplified

QUESTION - Experience Accumulator

Reply
Copied to clipboard!
10 years ago
Feb 11, 2015, 3:00:05 PM
Hello,



I'm trying to set up an accumulator (similar to EmpireMoneyAccumulator) that counts all of the XP gain from battles during a game. Is this possible? And if so, can you point me in the direction on how to do it?



Thanks in advance!
0Send private message
10 years ago
Feb 11, 2015, 4:36:42 PM
Although the Manual only mentions it as used for tags, the $SumProperty([simulationPath:]propertyName) seems to be what you are looking for. Here's how I would use it:



$SumProperty(./EmpireTypeMajor/Garrison/ClassUnit:Experience)




I am unsure how this works, but it may be worth time to look into it.



If you're using Aptana or Notepad++ you can search all the files within Public folder for $SumProperty to see how it is used. From what I see it is used in calculations.
0Send private message
10 years ago
Feb 11, 2015, 4:48:41 PM
That would add in all of the experience that units are awarded at creation though (ex. XP you get free in Era 2, XP from Improvements) and would only sum up for units that are currently alive.



Looking for a way to accumulate all of the XP gained in combat. There's a Level up SimulationObject that calculates the XP, but not sure how to wire this into an accumulator.



Thanks for the idea though!
0Send private message
10 years ago
Feb 11, 2015, 8:00:09 PM
What you could do is add the ExperienceReward value to a custom SimulationPropertyDescriptor defined in EmpireTypeMajor. That way even if a unit dies, its experienceReward is still stored in the variable. If only we had arrays : (



Also this bit in GameStatisticDefinitions.xml has the sum of AllUnitsLevels.

$SumProperty(ClassEmpire/Garrison/UnitRankStandard:LevelDisplayed)
0Send private message
10 years ago
Feb 12, 2015, 6:16:58 AM
VaulterWhite wrote:
What you could do is add the ExperienceReward value to a custom SimulationPropertyDescriptor defined in EmpireTypeMajor. That way even if a unit dies, its experienceReward is still stored in the variable. If only we had arrays : (




That's pretty much what I want to do. Creating the value in EmpireTypeMajor isn't an issue, it's just getting the ExperienceReward of the kills to accumulate. Messing with UnitLevelUp may be a way to do it but I'm not sure when that runs or how (or if) you can store it back to the Empire.



Sum of all Unit Levels doesn't help, it counts the leveled of an Empire's units but not what they've killed...
0Send private message
?

Click here to login

Reply
Comment