Object effects

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
User avatar
Chris NS
Posts: 475
Joined: May 6th, 2006, 3:22 pm
Location: Where the Queen lives

Object effects

Post by Chris NS »

Hello,

I'd like to include a couple of effects in an object:

1) The unit is automatically recalled in future scenarios. (Easiest way might be to change the unit's description whilst leaving user_description unaffected. Or can I assign a role to the unit?)

2) The unit gets an overlay marking the unit for future use.

Should I include this in the object WML or would it be easier to just have a moveto event for the same space?
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Object effects

Post by zookeeper »

Chris NS wrote:1) The unit is automatically recalled in future scenarios. (Easiest way might be to change the unit's description whilst leaving user_description unaffected. Or can I assign a role to the unit?)
Well, you can filter for whatever you want in a [recall] already...you could even give the auto-recall units some dummy [object] and have a [recall] like this:

Code: Select all

[recall]
    side=1

    [wml_filter]
        [modifications]
            [object]
                id=mydummyobject
            [/object]
        [modifications]
    [/wml_filter]
[/recall]
Chris NS wrote:Should I include this in the object WML or would it be easier to just have a moveto event for the same space?
I don't quite follow. Where are you giving the [object] if not in a moveto event? And if you already have a moveto event, then is there a problem with doing unit modifications in it without an the [object]? And you could just put your stuff in the [then] tag too if you want it enclosed within the [object] tag.
User avatar
Chris NS
Posts: 475
Joined: May 6th, 2006, 3:22 pm
Location: Where the Queen lives

Re: Object effects

Post by Chris NS »

Where are you giving the [object] if not in a moveto event?
The object is in a moveto event. However, there's a filter in the object restricting which units can take the object, so simply putting the effect in the [event] tag would be liable to apply the effect to a unit that can't take the object, which I don't want. Does that make sense?

Anyway, now that I know that you can auto-recall this unit without having to do anything complex in the [object] tag, that just leaves adding the overlay. I'll experiment with the [object][effect] tag first and see if this gives me the effect I want.
User avatar
Geos
Posts: 115
Joined: March 20th, 2008, 1:58 pm
Location: Italy

Re: Object effects

Post by Geos »

Take a look at the solution by zookeeper here
http://www.wesnoth.org/forum/viewtopic.php?f=21&t=21536
That's ridiculous, dragons have no windows...
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Object effects

Post by zookeeper »

Chris NS wrote:
Where are you giving the [object] if not in a moveto event?
The object is in a moveto event. However, there's a filter in the object restricting which units can take the object, so simply putting the effect in the [event] tag would be liable to apply the effect to a unit that can't take the object, which I don't want. Does that make sense?
Yes, but there's no reason you'd need to make it work like that, so it's not a problem.
Post Reply