;simple create script by -CrashnBurn- dwaters59@msn.com
;randomizes unit type, skill and rank.
;pass script using array [positiontocreate,groupname] exec "create.sqs"
;positiontocreate can be gamelogic, marker, object id# etc...
;groupname must already exist in editor, cannot be grpnull.
;-----------------------------------------------------------------------------
created = 0
#CREATE
_position = _this select 0
_group = _this select 1
;-----------------------------------------------------------------------------
;choose random unit type. Set your unit types here.
_UnitTypeArray = ["SoldierWB","SoldierWG","SoldierWLAW","SoldierWMedic","SoldierWB","SoldierWMG","SoldierWAT","SoldierWB","SoldierWG","OfficerW"]
_UnitType = _UnitTypeArray select (random 9)
;-----------------------------------------------------------------------------
;give unit a random brain.
_skillArray = [1,.9,.7,.8,1,.6]
_skill = _skillArray select (random 5)
;-----------------------------------------------------------------------------
;assign unit a random squad rank.
_rankArray = ["SERGEANT","CORPORAL","LIEUTENANT","PRIVATE"]
_rank = _rankArray select (random 3)
;-----------------------------------------------------------------------------
;and another virtual moron with a gun is born.
_UnitType CreateUnit [_position,_group,"",_skill,_rank]
;-----------------------------------------------------------------------------
;delay used to smooth creation a bit.
~1 + (random 1)
created = created + 1
;-----------------------------------------------------------------------------
;set number of units to create. Variable "created = 0" is at top of script.
;12 units is max number to be alive at one time for any group !!
? created >= 9: exit
goto "CREATE"