aoe2techtree
aoe2techtree copied to clipboard
Unit Upgrade Cost in data.json
Hi, I want to display the upgrade cost and research time in my app. Is it possible to add this to your data file?
I know I can use the description text e.g.
Upgrades: range, attack (University); to Heavy Scorpion 1000F, 1100W (Siege Workshop); more resistant to Monks (Monastery).
But there the research time is missing and I am displaying the range/attack upgrades etc. in another way already.
Oh sorry, I thought there was already an answer here.
In order to do that, one would essentially have to map the upgrade techs to the units. That could be semi-automated by looking at the upgrade Effects and which units get upgraded to which, but since for example the upgrade Effect for Champion contains upgrade commands for the whole Militia line, that data would have to get cleaned up afterwards.
Yeah that would be cool. I am parsing the description at the moment which is not optimal: https://github.com/denniske/aoe2companion/blob/master/data/src/helper/units.ts#L2823 (getUnitUpgradeCost)
I have seen that you have added unit cost to aoe2techtree and the following seem to have been switched up with huns atheism tech:
demolition ship fire ship
Funny. Demolition Ship and Fire Ship actually have "Trigger Tech ID":21,
, which is the unit id of War Galley, not the ID of the War Galley upgrade. I'll have to check if I can deduce such cases automatically or if I have to hardcode something for that case. Thanks for the report!
Hardcoded for now :shrug: