Is movement_type inextricably married to type?

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
voris
Posts: 68
Joined: August 27th, 2008, 5:42 pm

Is movement_type inextricably married to type?

Post by voris »

This doesn't work:

Code: Select all

    [unit]
        side=6
        type=Yeti
        x=5
        y=17
        movement_type=smallfoot
    [/unit]
But this does:

Code: Select all

    [unit]
        side=6
        type=Yeti
        x=5
        y=17
        level=0
    [/unit]
So I know I wasn't taking crazy pills when I thought the general concept of overriding a key in the unit should work...just not movement_type? The only thing I can think of is there is some unbreakable bond between type and movement_type which is a shame if true. I even tried storing the unit, clearing stored_unit.movement_type and then assigning it a new value. Am I missing something obvious here?
User avatar
Mist
Inactive Developer
Posts: 753
Joined: February 15th, 2007, 8:44 am
Location: Milton Keynes, UK

Re: Is movement_type inextricably married to type?

Post by Mist »

Yes you are. It's called [modifications], [object] and [effect]. The concept of overriding [unit_type] keys directly never worked, some of them could be changed via storing-unstoring, but preffered approach was and still is [object] [effect] pair inside an [event] or [modifications] tag.
Somewhere, between the sacred silence and sleep.
Disorder.
User avatar
Ken_Oh
Moderator Emeritus
Posts: 2178
Joined: February 6th, 2006, 4:03 am
Location: Baltimore, Maryland, USA

Re: Is movement_type inextricably married to type?

Post by Ken_Oh »

You made up "movement_type." According to http://www.wesnoth.org/wiki/UnitWML , it's "movetype."

Storing and unstoring also wouldn't work. At that point you'd have to alter the [resistance]s and [movement_cost]s directly.
voris
Posts: 68
Joined: August 27th, 2008, 5:42 pm

Re: Is movement_type inextricably married to type?

Post by voris »

Ken_Oh wrote:You made up "movement_type." According to http://www.wesnoth.org/wiki/UnitWML , it's "movetype."
So it does. That's odd, though, considering it's stored as movement_type in the save file and it's movement_type that i set when defining a unit using the unit_type tag.
voris
Posts: 68
Joined: August 27th, 2008, 5:42 pm

Re: Is movement_type inextricably married to type?

Post by voris »

Mist wrote:Yes you are. It's called [modifications], [object] and [effect]. The concept of overriding [unit_type] keys directly never worked, some of them could be changed via storing-unstoring, but preffered approach was and still is [object] [effect] pair inside an [event] or [modifications] tag.
Well I know about that but there is no way to modify the movement_type value using that from what I can tell.
User avatar
Ken_Oh
Moderator Emeritus
Posts: 2178
Joined: February 6th, 2006, 4:03 am
Location: Baltimore, Maryland, USA

Re: Is movement_type inextricably married to type?

Post by Ken_Oh »

voris wrote:
Ken_Oh wrote:You made up "movement_type." According to http://www.wesnoth.org/wiki/UnitWML , it's "movetype."
So it does. That's odd, though, considering it's stored as movement_type in the save file and it's movement_type that i set when defining a unit using the unit_type tag.
Hah, so maybe you didn't grab the term out of thin air.

Just another irregularity in Wesnoth system of not directly modifying units. ;)
Post Reply