MegaGlest Forum
Archives (read only) => Glest Advanced Engine => General discussion => Topic started by: lazyanttu on 12 August 2011, 22:03:16
-
Well, I tried to make technology which upgrades attack speed of my infantry units. However it didn't take effect. When I changed it to add attack strenght, everything worked well. Am I using wrong syntax or something like that. I put it as "attack-speed".
<upgrade>
<image path="images/stables.bmp"/>
<image-cancel path="images/tech_upgrade_cancel.bmp"/>
<time value="200"/>
<unit-requirements>
<unit name="military_academy"/>
</unit-requirements>
<upgrade-requirements/>
<resource-requirements>
<resource name="gold" amount="75"/>
<resource name="steel" amount="50"/>
</resource-requirements>
<effects>
<unit name="assault_infantry"/>
<unit name="rocket_infantry"/>
</effects>
<max-hp value="0"/>
<max-ep value="0"/>
<sight value="0"/>
<attack-strenght value="0"/>
<attack-range value="0"/>
<attack-speed value="200"/>
<armor value="0"/>
<move-speed value="0"/>
<production-speed value="0"/>
</upgrade>
How could I make the upgrade to improve attack speed of their attacks?
During my summer holiday I paused working of my mod, but now I'm back at making it forward after few months :P.
EDIT: Could I also improve the gather rate of workers via upgrades?
-
Welcome back. Firstly, you're using rather obsolete code, GAE now has enhancement style code for upgrades that works better. Secondly, you'll want to take a look at the XML documentation (https://docs.megaglest.org/XMLs) on the wiki, specifically XML/Upgrade (https://docs.megaglest.org/XML/Upgrade).
Here's what your full upgrade code would look like with the current GAE code (for GAE 0.4):
<?xml version="1.0" standalone="no"?>
<upgrade>
<image path="images/stables.bmp" />
<image-cancel path="images/tech_upgrade_cancel.bmp" />
<time value="200" />
<unit-requirements>
<unit name="military_academy" />
</unit-requirements>
<upgrade-requirements />
<resource-requirements>
<resource name="gold" amount="75" />
<resource name="steel" amount="50" />
</resource-requirements>
<enhancements>
<enhancement>
<affects>
<unit name="assault_infantry" />
<unit name="rocket_infantry" />
</affects>
<effects>
<static-modifiers>
<attack-speed value="200" />
</static-modifiers>
</effects>
</enhancement>
</enhancements>
</upgrade>
However, there's no reason that GAE shouldn't function correctly with the legacy code, may be a bug that slipped in as few upgrades enchance attack speed yet. It should be noted, though, that increasing the speed by 200 might be a touch high.
As for increasing worker's harvesting, use the tag <harvest-speed value="x" />.
-
Thanks for help, I think I should update all of my upgrades into this "enchantment"-style. Attack speed 200 was just for testing if that actually work, because such change is very noticeable.
Now both of them work, thanks!