Author Topic: Problem with attack-speed upgrade  (Read 1234 times)

lazyanttu

  • Guest
Problem with attack-speed upgrade
« 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?
« Last Edit: 12 August 2011, 22:48:32 by lazyanttu »

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Problem with attack-speed upgrade
« Reply #1 on: 13 August 2011, 03:04:38 »
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 on the wiki, specifically XML/Upgrade.

Here's what your full upgrade code would look like with the current GAE code (for GAE 0.4):

Code: [Select]
<?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" />.
« Last Edit: 18 June 2016, 18:01:02 by filux »
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

lazyanttu

  • Guest
Re: Problem with attack-speed upgrade
« Reply #2 on: 13 August 2011, 12:19:48 »
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!

 

anything