Placing units on a terrain 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
User avatar
Crow_T
Posts: 851
Joined: February 24th, 2011, 4:20 am

Placing units on a terrain type

Post by Crow_T »

I would like to place units, more simply one type, more ideally random from a list, to multiple locations on a map. Basically there are several points that are being guarded, so I would like to place units via a few lines of code. Using a specific terrain type like in EI would work, I can't figure it out from the code, although it is nicely commented. This can all be done manually, but I'm curious if there is a more powerful way to do this. Thanks
ulfgur
Posts: 88
Joined: December 16th, 2008, 1:01 am

Re: Placing units on a terrain type

Post by ulfgur »

I am fairly sure there is a scenario in Descent Into Darkness where landing on a village spawns goblins. If I remember correctly, it is the second mission.
User avatar
TheScribe
Posts: 465
Joined: June 17th, 2012, 8:17 pm
Location: You won't know till it's too late

Re: Placing units on a terrain type

Post by TheScribe »

I think what he meant was more along the lines of this. If not sorry.

P.S. It's tested now, and it works.
Sorta on a break from the forums ATM, have been for a while. If I was doing something for/with you and I haven't recently, that's why, I will be back soon hopefully.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Placing units on a terrain type

Post by zookeeper »

Well, you should be able to use the SCATTER_UNITS macro to achieve that.
User avatar
Crow_T
Posts: 851
Joined: February 24th, 2011, 4:20 am

Re: Placing units on a terrain type

Post by Crow_T »

Thanks for the answers, I think the code snippet from TheScribe should do the trick.
Post Reply