object has no effect

The place to post your WML questions and answers.

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.
Post Reply
Jovycos
Posts: 59
Joined: October 12th, 2007, 4:15 pm
Location: Germany

object has no effect

Post by Jovycos »

Hi!

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'}}}
What could be the problem?

Regards
Jovycos
Full of Nerdiness...
silene
Posts: 1109
Joined: August 28th, 2004, 10:02 pm

Re: object has no effect

Post by silene »

Jovycos wrote:What could be the problem?
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
Posts: 59
Joined: October 12th, 2007, 4:15 pm
Location: Germany

Re: object has no effect

Post by Jovycos »

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?
Full of Nerdiness...
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: object has no effect

Post by Anonymissimus »

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 startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Jovycos
Posts: 59
Joined: October 12th, 2007, 4:15 pm
Location: Germany

Re: object has no effect

Post by Jovycos »

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...
User avatar
Elvish_Hunter
Posts: 1575
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: object has no effect

Post by Elvish_Hunter »

In the Sojournings of Grog, scenario Nemesis, I have this code:

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]
and it works. If you use

Code: Select all

[effect]
	apply_to=movement
	set=0
[/effect]
it should work as well, even if this isn't Lua. :)
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)
Post Reply