Author Topic: [Not a bug] effects-buildings flag ?  (Read 2069 times)

ProfEclipse

  • Summoner
  • **
  • Posts: 49
    • View Profile
[Not a bug] effects-buildings flag ?
« on: 13 September 2012, 06:29:49 »
I trying to making catapult burning effect. It was done in GAE 0.212b, but when I compile it with ver 0.3.2 or 0.3.93, I caught an error. :(
Take a look at this :
Code: [Select]
<effects>
        <effect name= "burning" .....
    <flags>
   <effects-buildings />
  </flags>
        </effect>
 </effects>
And error message...

(click to show/hide)
Seem the "effects-buildings" flag is removed in GAE 0.3x.
If this flag removed, please add it as soon as possible.  :)

Edit by Omega: Changed title as per my reply.
« Last Edit: 13 September 2012, 21:16:09 by Omega »

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: effects-buildings flag ?
« Reply #1 on: 13 September 2012, 21:14:56 »
Use tags instead. Tags are basically a label that can be slapped to any unit, and then effects can be limited to units with certain tags. For example, we might give all buildings a "building" tag. Or we might give defensive buildings a special tag of their own. Perhaps they take less damage from the effect? Essentially, tags are more versatile than just "buildings". Effects and emanations can currently only be applied to a single tag (although units can have multiple tags, so it's possible to make a tag for all units that can be hit by an attack and use that along with other tags).

Why is this better for you? Suppose you don't want an all-stone building to burn, but you do want the wooden buildings to burn. Now that can be narrowed down. And since you can give an attack command multiple effects, you could have different intensities of "burning". Perhaps one effect is just a minor burning which affects a building that is part wood and part stone (like Magic's Mage Tower, which has a wooden roof, but the rest is stone), but then a different effect makes a more intense burning on all wood buildings, such as Tech's Technodrome.

Personally, I would have kept the "effects-buildings" flag for legacy support, but we really want to push for the use of tags, I guess.

The code for adding tags to units is:
Code: [Select]
<unit>
<parameters>
[..]
<tags>
<tag value="defensive" />
<tag value="effected-by-ads" />
<tag value="unatf" />
</tags>
[..]
</parameters>
[..]
</unit>

And the code for limiting an effect/emanation to a tag is:
Code: [Select]
<effect name="active_denial" bias="detrimental" stacking="overwrite" target="any" chance="100.0" duration="1">
<affect value="effected-by-ads" /> <!-- Name of the tag -->
<multipliers>
<move-speed value="0.0" />
<attack-speed value="0.0" />
<production-speed value="0.0" />
<harvest-speed value="0.0" />
</multipliers>
<flags>
<scale-splash-strength />
</flags>
</effect>
Both code snippets from the abandoned and unreleased AD4. PS: Don't try and set a move speed multiplier of zero like this.

Helpful links:
https://docs.megaglest.org/XML/Unit#tags
https://docs.megaglest.org/GAE/Effects#XML_definition
https://docs.megaglest.org/GAE/Emanations#XML_definition
« Last Edit: 18 June 2016, 17:51:37 by filux »
Edit the MegaGlest wiki: http://docs.megaglest.org/

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

ProfEclipse

  • Summoner
  • **
  • Posts: 49
    • View Profile
effects-buildings flag ?
« Reply #2 on: 16 September 2012, 04:43:40 »
Oh. Now It worked.
Thank u very much !!!!!!!!!! :D
« Last Edit: 16 September 2012, 05:10:46 by ProfEclipse »