Random Placement of Units

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
User avatar
vettim89
Posts: 3668
Joined: Fri Jul 13, 2007 11:38 pm
Location: Toledo, Ohio

Random Placement of Units

Post by vettim89 »

I am working on a scenario where I want one side to have randomly place units. I think it will be best to have this as a function because I will want to use it repeatedly.

I want to set a series of boxes (let's call them 'zones") around an objective. On an irregular schedule I want units to spawn in these zones. I want the zones to be random and the units to be randomly placed within the zones.

For example: there are four zones called 'zone A', 'zone B', 'zone C', and 'zone D'. I will want the function to randomly select one of the zones then randomly place the desired units within the map reference points defined for the selected zone.

I have some ideas on how to do this but as I am not a programmer by trade I thought I would throw this out for the board.
"We have met the enemy and they are ours" - Commodore O.H. Perry
Post Reply

Return to “Lua Legion”