object has no 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.
object has no effect
Hi!
When I add this Object to the modifications-list of a unit from Lua nothing happens:
What could be the problem?
Regards
Jovycos
When I add this Object to the modifications-list of a unit from Lua nothing happens:
Code: Select all
{'object',
{'effect', {apply_to='movement', set='0'}}}
Regards
Jovycos
Full of Nerdiness...
Re: object has no effect
Objects in WML have an effect only if applied through the [object] action or when leveling a unit. Any other usage is ignored (until the next leveling). So you can either use the action or apply the effect by hand.Jovycos wrote:What could be the problem?
Re: object has no effect
And the effect won’t be updated regularly? But an ability should work, right?
Btw: Where can I see the image of the object in the game?
Btw: Where can I see the image of the object in the game?
Full of Nerdiness...
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: object has no effect
You could set the unit's max_moves=0 via store_unit (or get_units in lua).
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Re: object has no effect
No, the real world is more complicate, I have got a filter and it has to be updated regularly, at least for specials that is the case, that is why I’m asking for abilities…
Full of Nerdiness...
- Elvish_Hunter
- Posts: 1576
- Joined: September 4th, 2009, 2:39 pm
- Location: Lintanir Forest...
Re: object has no effect
In the Sojournings of Grog, scenario Nemesis, I have this code:and it works. If you useit should work as well, even if this isn't Lua.
Code: Select all
[unit]
type=White Mage
side=1
id=Ormron
name= _ "Ormron"
experience=26
hitpoints=21
x=11
y=7
[modifications]
{TRAIT_FEARLESS}
{TRAIT_RESILIENT}
{TRAIT_LOYAL}
[object]
silent=yes
[effect]
apply_to=image_mod
add=RC(magenta>red)
[/effect]
#gived 1 more MP to help the player keeping Ormron alive.
#not used the quick trait to avoid HP penalty. Elvish_Hunter
[effect]
apply_to=movement
increase=1
[/effect]
[/object]
[/modifications]
{IS_HERO}
[/unit]
Code: Select all
[effect]
apply_to=movement
set=0
[/effect]
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)