Probability when using unit variations

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
TheLoyalist
Posts: 3
Joined: December 26th, 2017, 7:22 pm

Probability when using unit variations

Post by TheLoyalist »

So I have this Era I am making with a friend of mine, and when I am finished I intend for a certain unit in it to have a large pool of visual variations to select from when they spawn in. I found the [variation tag] and intend to use it to this end, but there doesn’t seem to be an easy way to make some sprites more likely to show up. Will I have to make repeats of the [variation]s in the list that I want to make more likely to show?
Shiki
Developer
Posts: 348
Joined: July 13th, 2015, 9:53 pm
Location: Germany

Re: Probability when using unit variations

Post by Shiki »

How do you spawn them? One cannot recruit variations directly, only the base unit. But one can write an prerecruit or unit placed event to set the variation. Have a look at the RECRUIT_UNIT_VARIATIONS macro.
If you want to spawn them another way or write your own event, have a look at the RANDOM macro in the same file.
Try out the dark board theme.
TheLoyalist
Posts: 3
Joined: December 26th, 2017, 7:22 pm

Re: Probability when using unit variations

Post by TheLoyalist »

I had just planned to set up the variations for recruiting. Like, if I were to recruit a unit, it could have one of multiple different appearances. Is there no easy way to just write that into the units in the era? This is the my first era, and I was hoping to keep it simple, which I assumed it would be because the base game already seems to do the exact same thing with the male and female variations of a unit.
Post Reply