Author Topic: Change stats of enemy unit ingame  (Read 1746 times)

ZaRo

  • Guest
Change stats of enemy unit ingame
« on: 9 November 2009, 11:12:59 »
Hello

The idea is to have a "freeze" and/or "haste" spell the magic (or semi magic) unit can cast on enemies. Is that possible?

The code in the xml only sets the damage you inflict, not a change in stats: (Here from battlemage)
Code: [Select]
<attack-strenght value="140"/>
<attack-var value="40"/>
<attack-range value="7"/>
<attack-type value="energy"/>

Best regards
ZaRo

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Change stats of enemy unit ingame
« Reply #1 on: 9 November 2009, 11:49:37 »
GAE has some pretty nifty effects that you can apply to an attack.  They can alter the target's attack strength, attack speed, and lots of other stuff.  For reference, see here: https://docs.megaglest.org/GAE/Guide

So, taking your example of the Battlemage, if you wanted to make him freeze the enemy with his attack, you could some code like this after the </splash> tag:

Code: [Select]
<effects>
        <effect name="freeze"
                bias="detrimental"
                stacking="overwrite"
                target="any"
                chance="100.0"
                duration="8"
                image=""> <!-- image path goes here, but I think you can leave it out -->
            <static-modifiers/>
            <multipliers>
                <attack-speed value="0.0"/>
<move-speed value="0.0"/>
            </multipliers>
            <flags/>
            <fields-added/>
            <fields-removed/>
            <light enabled="false"/>
            <sound enabled="false"/>
            <particle value="false"/>
            <recourse-effects/>
        </effect>
    </effects>

This only works with GAE, though!
« Last Edit: 18 June 2016, 19:39:49 by filux »

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Change stats of enemy unit ingame
« Reply #2 on: 9 November 2009, 15:36:32 »
Ah, but John, there's no way to cast it on your allies. They plan to make a cast_spell command, but to my knowledge, haven't gotten around to doing so.
Edit the MegaGlest wiki: http://docs.megaglest.org/

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

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Change stats of enemy unit ingame
« Reply #3 on: 10 November 2009, 04:21:32 »
I remember Daniel saying you could add an <effects> tag to a repair skill, but I don't know if that works yet.  Either way, you can use an attack on your own units if you want.  You'd just want to make <attack-strenght value="0"/> and give it beneficial effects.  Of course, the units wouldn't know to use it, but that's Glest AI for you.  You can also give the unit an attack that will do damage to the enemy and produce an effect on only allied units in the area.

Loronal

  • Guest
Re: Change stats of enemy unit ingame
« Reply #4 on: 11 November 2009, 18:21:21 »
It doesnt I tried and got errors

Exazzo

  • Guest
Re: Change stats of enemy unit ingame
« Reply #5 on: 16 November 2009, 07:36:59 »
hey guys . please only put replys to my post and do NOT ask other q's in  here.. make your own thread plz.
its confuseing for me.

thanx in advance.

Loronal

  • Guest
Re: Change stats of enemy unit ingame
« Reply #6 on: 16 November 2009, 21:15:34 »
Okay
1. Use an emanation which is beneficial to make your unit stronger
2. use an emanation to do the opposite
3.use effects on your attack