Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit Upgrade Cost in data.json #70

Open
denniske opened this issue Aug 31, 2020 · 5 comments
Open

Unit Upgrade Cost in data.json #70

denniske opened this issue Aug 31, 2020 · 5 comments

Comments

@denniske
Copy link

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.

@HSZemi
Copy link
Member

HSZemi commented Nov 20, 2020

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.

@denniske
Copy link
Author

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)

@denniske
Copy link
Author

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

image

image

@HSZemi
Copy link
Member

HSZemi commented Nov 24, 2021

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!

@HSZemi
Copy link
Member

HSZemi commented Nov 24, 2021

Hardcoded for now 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants