Author Topic: Bugs for the percentage upgrades  (Read 2529 times)

RobotKiller001

  • Archer
  • *
  • Posts: 29
    • View Profile
Bugs for the percentage upgrades
« on: 27 November 2020, 19:17:23 »
I found this bug doing some exsperiments with the Upgrades, and when I put a percentage value it doesn't work correctly, infact sometimes the value added doesn't matches with the value on the unit.
for exemple on an Archer(tech) with 700 hp, the description of the upgrade says that it increases his life by 10%, but instead gives him like 3 hp and i'm so confused LOL., same for the damage Upgrades.
But this problem doesn't appear on all units.
Working on Megaglest Improved Mod.

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: Bugs for the percentage upgrades
« Reply #1 on: 12 December 2020, 19:50:35 »
Do you still have trouble with this ? Is it really a bug? If you think so please show us an example xml.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

RobotKiller001

  • Archer
  • *
  • Posts: 29
    • View Profile
Re: Bugs for the percentage upgrades
« Reply #2 on: 13 December 2020, 10:56:41 »
The script i used for the percentage valor its this:

<upgrade>
   <image path="images/upgrade_healthpoints.png"/>
   <image-cancel path="../images/upgrade_cancel.bmp"/>
   <time value="20"/>
   <unit-requirements/>
   <upgrade-requirements/>
   <resource-requirements/>
   <effects/>
   <max-hp value="10" value-percent-multiplier="true"/>
   <max-ep value="0"/>
   <sight value="0"/>
   <attack-strenght value="0"/>
   <attack-range value="0"/>
   <armor value="0"/>
   <move-speed value="0"/>
   <production-speed value="0"/>
</upgrade>
Working on Megaglest Improved Mod.

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: Bugs for the percentage upgrades
« Reply #3 on: 20 December 2020, 20:04:09 »
https://docs.megaglest.org/index.php?title=XML/Upgrade#max-hp

What you wanted to do is:
<max-hp value="110" value-percent-multiplier="true"/>

this will do +10%  ( because it's 110% of the original value )
« Last Edit: 20 December 2020, 20:09:27 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios