Recall to recall

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
rmj
Posts: 281
Joined: July 4th, 2010, 5:21 am

Recall to recall

Post by rmj »

Can someone provide the code for moving ogres from the recall list to the recall list of side 3. Thanks.
rmj
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Re: Recall to recall

Post by vghetto »

Code: Select all

        [store_unit]
            [filter]
                side=1
                x,y=recall,recall
                race=ogre
            [/filter]
            variable=recall_store
            mode=always_clear
            kill=yes
        [/store_unit]
        [for]
            array=recall_store
            reverse=yes
            [do]
                {VARIABLE recall_store[$i].side 3}
                [unstore_unit]
                    variable=recall_store[$i]
                    x,y=recall,recall  
                [/unstore_unit]
            [/do]
        [/for]
        {CLEAR_VARIABLE recall_store}
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Re: Recall to recall

Post by vghetto »

Wiki says [modify_unit] should work as well.
Try both of them and see which works best for you.

Code: Select all

[modify_unit]
        [filter]                        
                side=1
                x,y=recall,recall
                race=ogre
        [/filter]                       
        side=3
[/modify_unit]      
User avatar
rmj
Posts: 281
Joined: July 4th, 2010, 5:21 am

Re: Recall to recall

Post by rmj »

The first worked. The shorter code made ogres side 3, but left them in the side 1 recall list.

Thanks.
rmj
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Re: Recall to recall

Post by vghetto »

Interesting. I wonder if that makes it a wesnoth bug.
Post Reply