[solved] Adding "loyal" via object/effect
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
[solved] Adding "loyal" via object/effect
With the following, my unit gains the "illuminates" ability correctly, but it doesn't gain "loyal".
On the effectWML page, it implies that apply_to can take 'loyal' as a value, and it says that there are no associated keys for loyal. But apparently this isn't working--any ideas?
Code: Select all
[object]
silent=yes
name=_ "the Phial of Orocia"
description= _ "unit gains loyalty and illuminates the surrounding area"
[effect]
apply_to=new_ability
[abilities]
{ABILITY_ILLUMINATES}
[/abilities]
[/effect]
[effect]
apply_to=loyal
[/effect]
[/object]
Last edited by Dovolente on June 13th, 2012, 2:44 pm, edited 1 time in total.
Re: Adding "loyal" via object/effect
The first thing I would try is to check whether the unit really isn't loyal, because only the loyal trait is explicitly visible.
But I suppose you have done that. Then, I would suggest to do this:It stores the unit, first makes it loyal, then adds the trait that makes sure that the loyal trait will persist when it advances and to make it show up and then unstores it.
Use the object with the ability before or after.
But I suppose you have done that. Then, I would suggest to do this:
Code: Select all
[store_unit]
[filter]
x,y=$x1,$y1 #IMPORTANT NOTE: Make sure this will filter your unit, you may use id=his_name or something similar instead
[/filter]
variable=new_loyal
kill=no
[/store_unit]
{VARIABLE new_loyal.upkeep loyal}
{VARIABLE i $new_loyal.modifications.trait.length}
{VARIABLE new_loyal.modifications.trait[$i].id loyal}
{VARIABLE new_loyal.modifications.trait[$i].male_name loyal}
{VARIABLE new_loyal.modifications.trait[$i].female_name ("female^loyal")}
{VARIABLE new_loyal.modifications.trait[$i].description ("Zero upkeep")}
{VARIABLE new_loyal.modifications.trait[$i].effect.apply_to loyal}
{CLEAR_VARIABLE i}
[unstore_unit]
variable=new_loyal
find_vacant=no
[/unstore_unit]
Use the object with the ability before or after.
Re: Adding "loyal" via object/effect
apply_to=loyal only makes the upkeep zero, it doesn't do anything else. Just use [modify_unit] to make the unit appear with an icon and edit traits.
Formerly known as the creator of Era of Chaos and maintainer of The Aragwaithi and the Era of Myths.
Re: Adding "loyal" via object/effect
Thanks, both answers were instructive. Problem solved.