[SOLVED] moveto micro ai seemingly doesn't work

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
Anagkai
Posts: 58
Joined: February 12th, 2012, 10:05 am

[SOLVED] moveto micro ai seemingly doesn't work

Post by Anagkai »

I'm using a micro ai to have red mages move to villages. I'm not sure, though that it does anything, if a red mage moves onto a village which happens from time to time it seems rather random.

This is the code used, which is inside the prestart event:

Code: Select all

        [micro_ai]
			side=2
			type=Red Mage
            ai_type=goto
            action=add
            ca_id=burningvillages

            [filter]
                id=burningvillages
            [/filter]
            [filter_location]
				terrain=Gs^Vh, Ss^Vhs, Hh^Vhh
            [/filter_location]
            ca_score=350000
        [/micro_ai]
Last edited by Anagkai on September 16th, 2018, 1:52 pm, edited 1 time in total.
My campaigns: Princess Nilwyn (available) & Home of the Undead (available)
mattsc
Inactive Developer
Posts: 1217
Joined: October 13th, 2010, 6:14 pm

Re: moveto micro ai seemingly doesn't work

Post by mattsc »

You have the syntax mixed up, at least if you are trying to do what I think you want to do. Your current setup will try to move a unit with id 'burningvillages' to the terrain given in the location filter. You need to move the type=Red Mage line into the [filter] tag (and delete the id inside the tag, of course).
enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

Re: moveto micro ai seemingly doesn't work

Post by enclave »

mattsc wrote: September 14th, 2018, 8:31 pm You have the syntax mixed up, at least if you are trying to do what I think you want to do. Your current setup will try to move a unit with id 'burningvillages' to the terrain given in the location filter. You need to move the type=Red Mage line into the [filter] tag (and delete the id inside the tag, of course).
in short it probably means something like this:

Code: Select all

        [micro_ai]
	    side=2
	    ai_type=goto
            action=add
            ca_id=burningvillages

            [filter]
              type=Red Mage
            [/filter]
            [filter_location]
				terrain=Gs^Vh, Ss^Vhs, Hh^Vhh
            [/filter_location]
            ca_score=350000
        [/micro_ai]
what this supposed to do if everything is right, - all red mages will go to Gs^Vh, Ss^Vhs, Hh^Vhh

given that your [micro_ai] is in the right place as well.. or that you dont have same filter doing other stuff with higher priority. Let us know if it still not works.
Anagkai
Posts: 58
Joined: February 12th, 2012, 10:05 am

Re: moveto micro ai seemingly doesn't work

Post by Anagkai »

It does work now. Thanks.
My campaigns: Princess Nilwyn (available) & Home of the Undead (available)
Post Reply