Author Topic: BUGS: Extra linebreak in effects and effects not working.  (Read 1364 times)

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
BUGS: Extra linebreak in effects and effects not working.
« on: 9 November 2010, 18:46:41 »
In 0.3.1, the effects aren't seeming to work. In my tests, I had an attack that set a negative value for the HP regen, but the effect was never applied (despite 100% chance of applying). I don't think the problem is in my XML, as I've tested said XMLs before, and even tried a copy-paste from the wiki. Seems to me that the effects simply won't apply to the units...

Also, relatedly, there is an extra line (which is blank, except for that odd bullet character that appears on the effect menu when you hover over the attack button). I have an image that details exactly what I mean, and will post it when I get home (sorry, school computers) along with the XML.

EDIT// Here's the image of what I am describing:
« Last Edit: 9 November 2010, 21:50:05 by Omega »
Edit the MegaGlest wiki: http://docs.megaglest.org/

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

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: BUGS: Extra linebreak in effects and effects not working.
« Reply #1 on: 10 November 2010, 12:01:56 »
Formatting issues are fixed,



I tested negative hp-regen and it did work for me, but I believe the sums are not coming out right :look: Will have to investigate that some more...

Does the effect have a damge-type ? If so, did you take the multiplier into account ?
Glest Advanced Engine - Code Monkey

Timeline | Downloads

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: BUGS: Extra linebreak in effects and effects not working.
« Reply #2 on: 10 November 2010, 22:24:40 »
For more information, here's the effect tag of the unit's attack (note, not the same as the example. NONE of the effects seem to work for me. Simply aren't applied):

Code: [Select]
      <effects>
        <effect name="stunned" bias="detrimental" stacking="overwrite" target="any" chance="75" duration="2">
          <static-modifiers />
          <multipliers>
            <movement-speed value="0.0" />
            <attack-speed value="0.0" />
            <sight value="0.0" />
          </multipliers>
          <flags />
          <fields-added />
          <fields-removed />
          <light enabled="false" />
          <sound enabled="false" />
          <particle value="false" />
          <recourse-effects />
        </effect>
      </effects>

And the entire XML:
Code: [Select]
<?xml version="1.0" standalone="no"?>
<unit>
  <parameters>
    <size value="1" />
    <height value="2" />
    <max-hp value="1500" regeneration="3" />
    <max-ep value="0" />
    <armor value="50" />
    <armor-type value="infantry" />
    <sight value="14" />
    <time value="120" />
    <multi-selection value="true" />
    <cellmap value="false" />
    <levels>
      <level name="vicious" kills="4">
        <static-modifiers>
          <max-hp value="500" />
          <sight value="-1" />
          <attack-strength value="100" />
          <attack-speed value="30" />
        </static-modifiers>
        <multipliers>
          <max-hp value="1" />
          <max-ep value="1" />
          <sight value="1" />
          <armor value="1" />
        </multipliers>
      </level>
      <level name="brutal" kills="8">
        <static-modifiers>
          <max-hp value="500" />
          <sight value="-1" />
          <attack-strength value="100" />
          <attack-speed value="30" />
        </static-modifiers>
        <multipliers>
          <max-hp value="1" />
          <max-ep value="1" />
          <sight value="1" />
          <armor value="1" />
        </multipliers>
      </level>
    </levels>
    <fields>
      <field value="land" />
    </fields>
    <properties />
    <light enabled="false" />
    <unit-requirements>
      <unit name="ops_facility" />
    </unit-requirements>
    <upgrade-requirements />
    <resource-requirements>
      <resource name="gold" amount="150" />
      <resource name="metal" amount="25" />
      <resource name="wood" amount="50" />
      <resource name="food" amount="1" />
    </resource-requirements>
    <resources-stored />
    <image path="images/baton_soldier.bmp" />
    <image-cancel path="../headquarters/images/cancel.bmp" />
    <meeting-point value="false" />
    <selection-sounds enabled="true">
      <sound path="../../sound/unit/sel1.wav" />
      <sound path="../../sound/unit/sel2.wav" />
      <sound path="../../sound/unit/sel3.wav" />
      <sound path="../../sound/unit/sel4.wav" />
      <sound path="../../sound/unit/sel5.wav" />
      <sound path="../../sound/unit/sel6.wav" />
      <sound path="../../sound/unit/sel7.wav" />
      <sound path="../../sound/unit/sel8.wav" />
    </selection-sounds>
    <command-sounds enabled="true">
      <sound path="../../sound/unit/comm1.wav" />
      <sound path="../../sound/unit/comm2.wav" />
      <sound path="../../sound/unit/comm3.wav" />
      <sound path="../../sound/unit/comm4.wav" />
      <sound path="../../sound/unit/comm5.wav" />
      <sound path="../../sound/unit/comm6.wav" />
      <sound path="../../sound/unit/comm7.wav" />
      <sound path="../../sound/unit/comm8.wav" />
    </command-sounds>
  </parameters>
  <skills>
    <skill>
      <type value="stop" />
      <name value="stop_skill" />
      <ep-cost value="0" />
      <speed value="100" />
      <anim-speed value="55" />
      <animation path="models/baton_soldier_stop.g3d" />
      <sound enabled="false" />
    </skill>
    <skill>
      <type value="move" />
      <name value="move_skill" />
      <ep-cost value="0" />
      <speed value="275" />
      <anim-speed value="250" />
      <animation path="models/baton_soldier_move.g3d" />
      <sound enabled="false" />
    </skill>
    <skill>
      <type value="attack" />
      <name value="attack_skill" />
      <ep-cost value="0" />
      <speed value="100" />
      <anim-speed value="60" />
      <animation path="models/baton_soldier_attack.g3d" />
      <sound enabled="true" start-time="0.1">
        <sound-file path="../../sound/attacks/bullethit.wav" />
      </sound>
      <attack-strenght value="250" />
      <attack-var value="50" />
      <attack-range value="1" />
      <attack-type value="physical" />
      <attack-fields>
        <field value="land" />
      </attack-fields>
      <attack-start-time value="0.1" />
      <projectile value="false" />
      <splash value="false" />
      <effects>
        <effect name="stunned" bias="detrimental" stacking="overwrite" target="any" chance="75" duration="2">
          <static-modifiers />
          <multipliers>
            <movement-speed value="0.0" />
            <attack-speed value="0.0" />
            <sight value="0.0" />
          </multipliers>
          <flags />
          <fields-added />
          <fields-removed />
          <light enabled="false" />
          <sound enabled="false" />
          <particle value="false" />
          <recourse-effects />
        </effect>
      </effects>
    </skill>
    <skill>
      <type value="die" />
      <name value="die_skill" />
      <ep-cost value="0" />
      <speed value="300" />
      <anim-speed value="100" />
      <animation path="models/baton_soldier_die.g3d" />
      <sound enabled="true" start-time="0">
        <sound-file path="../../sound/deaths/die1.wav" />
        <sound-file path="../../sound/deaths/die2.wav" />
        <sound-file path="../../sound/deaths/die3.wav" />
        <sound-file path="../../sound/deaths/die4.wav" />
        <sound-file path="../../sound/deaths/die5.wav" />
        <sound-file path="../../sound/deaths/die6.wav" />
        <sound-file path="../../sound/deaths/die7.wav" />
        <sound-file path="../../sound/deaths/die8.wav" />
      </sound>
      <fade value="false" />
    </skill>
  </skills>
  <commands>
    <command>
      <type value="stop" />
      <name value="stop" />
      <image path="images/stop.bmp" />
      <unit-requirements />
      <upgrade-requirements />
      <stop-skill value="stop_skill" />
    </command>
    <command>
      <type value="move" />
      <name value="move" />
      <image path="images/move.bmp" />
      <unit-requirements />
      <upgrade-requirements />
      <move-skill value="move_skill" />
    </command>
    <command>
      <type value="attack" />
      <name value="electric_baton" />
      <image path="images/attack.bmp" />
      <unit-requirements />
      <upgrade-requirements />
      <move-skill value="move_skill" />
      <attack-skill value="attack_skill" />
    </command>
    <command>
      <type value="attack_stopped" />
      <name value="stand_ground" />
      <image path="images/hold.bmp" />
      <unit-requirements />
      <upgrade-requirements />
      <stop-skill value="stop_skill" />
      <attack-skill value="attack_skill" />
    </command>
    <command>
      <type value="guard" />
      <name value="guard" />
      <image path="images/guard.bmp" />
      <unit-requirements />
      <move-skill value="move_skill" />
      <attack-skill value="attack_skill" />
      <max-distance value="2" />
    </command>
    <command>
      <type value="patrol" />
      <name value="patrol" />
      <image path="images/patrol.bmp" />
      <unit-requirements />
      <upgrade-requirements />
      <move-skill value="move_skill" />
      <attack-skill value="attack_skill" />
      <max-distance value="2" />
    </command>
  </commands>
</unit>
Edit the MegaGlest wiki: http://docs.megaglest.org/

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

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: BUGS: Extra linebreak in effects and effects not working.
« Reply #3 on: 11 November 2010, 02:26:59 »
Two errors in there, looks like the error reporting is not so nice on effects...

target='any' should be target='all'

'movement-speed' should be 'move-speed'

Multipliers of 0.0 are ill-advised, and could lead to some odd behaviour. I'll open a ticket to allow effects to remove access to certain skill classes, which will give what you want here without the nasty side effects.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: BUGS: Extra linebreak in effects and effects not working.
« Reply #4 on: 12 November 2010, 06:41:12 »
Two errors in there, looks like the error reporting is not so nice on effects...

target='any' should be target='all'

'movement-speed' should be 'move-speed'

Multipliers of 0.0 are ill-advised, and could lead to some odd behaviour. I'll open a ticket to allow effects to remove access to certain skill classes, which will give what you want here without the nasty side effects.

Very odd... It's probably my fault. I was using old versions of the wiki pages which I saved on my computer...

As for the multipliers of zero, basically, I'd want to replicate a unit that cannot attack or move, and assumed that multiplying by zero would give zeros for move and attack speed, thus creating the appearance of being stunned... What will happen if I use them?
Edit the MegaGlest wiki: http://docs.megaglest.org/

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