PDA

View Full Version : Placing Random count of enemys in the Marker.



R34P3R
Jun 10 2009, 22:58
Hi there.

is there anyway to create a random count of enemys on ma Marker ? So i have a Marker over a City and now i whant that my Script Spawns Random 1 - 5 BMPs and 10 - 20 infanterie. But.. they must createt on right places.. not on a Rooftop or in a house.

Thanks for help.

R34P3R
Jun 11 2009, 21:00
Ok now i know how i create a Unit on script. But how can i set a random Spawnposition in the Marker coordination ?

Przemek_kondor
Jun 12 2009, 06:07
_markerWidth = ...
_markerHeight = ...
_pos = getMarkerPos "markername";
_randomPos = [(_pos select 0) + (random (2*_markerWidth) - _markerWidth), (_pos select 1) + (random (2*_markerHeight) - _markerHeight)]

R34P3R
Jun 12 2009, 20:14
thx a lot