Creating a New Unit on AMLA

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
Nerdanel
Posts: 43
Joined: January 21st, 2006, 12:03 pm
Location: Finland

Creating a New Unit on AMLA

Post by Nerdanel »

I had this idea for my faction that there would be an unit that starts as a level 0 Small Tsesk, levels normally to level 1 Tsesk, after which when it amlas it produces a Small Tsesk on a nearby open hex. (The justification is that the critter in question breeds by division.)

The following advancement code produces no error messages but no new units either.

Code: Select all

[advancement]
    max_times=100
    [unit]
    type=Small Tsesk
    x=x1
    y=y1
    upkeep=full
    [/unit]
[/advancement]
I just learning WML and have been trying to use the wiki as a source. Is my idea even doable with the current WML?
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

As the wiki says, [effect]s are the only tags that can go inside an [advancement] tag. So you can only modify the leveling unit as an AMLA (and modify only to the extent [effect] allows).

However, I think there is code currently in the works that would allow units to have [event]s written directly inside their unit definitions, so you could write this spawning as a normal name=post_advance event inside your Small Tsesk unit .cfg. I'm not sure when the feature is ready, though, or even if it would make it to the next release.

Of course you can do this now in a campaign or a custom MP scenario.
Nerdanel
Posts: 43
Joined: January 21st, 2006, 12:03 pm
Location: Finland

Post by Nerdanel »

I was indeed starting to fear that I was attempting the impossible. Well, my era is apparently becoming a lot less interesting than it was supposed to be...

(It's also looking very much like you can't make your own ability like leadership but different. I think there isn't even a need to start a thread on this subject.)
Post Reply