Jump to content
Sign in to follow this  
fasterthanlight

Point of presence for several objects?

Recommended Posts

How would I go about making a vehicle spawn with objects around it in a random area.

For instance. I want an M1 to spawn in an area. I can tell the POP 50 and it will give me a radius that it will spawn each time. How do I make a fortification spawn WITH the tank in a random 50 meter area?

Share this post


Link to post
Share on other sites

try condition of presence of your fortification with alive tank instead of true.

Share this post


Link to post
Share on other sites

Can't give you an area, but here is a radius and random direction :D (red is radius, change as you please)

As .sqf:

_center = "tankhere"; //marker
_tank = "tankname";
_fort = "fortname";
_dir = random 359;

_tank setPos (getMarkerPos _center)[color="SeaGreen"](_dir)[/color]; // Put tank at desired position

_fort setPos [(getPos _tank select 0)-[color="Red"]25[/color]*sin(_dir),(getPos _tank select 1)-[color="Red"]25[/color]*cos(_dir)]; // put fortification within 25m radius of tank, facing same direction

Not tested, but should work. The only part that may not work is the green, if it doesn't you'll get an error, just remove it from the script.

Edit: Oh. You wanted to SPAWN the tank there. Well this will move the pre-created tank and fort there. :P Gotta drive my brother to a friends house, then I'll fix it up for ya.

Edit2: This will spawn the tank and fort. Fill in the classnames.

_center = "tankhere"; //marker
_fort = "fortname";
_dir = random 359;

_spawntank = "m1a1classname" createVehicle (getMarkerPos _center)[color="SeaGreen"](_dir)[/color]; // Put tank at desired position

_spawnfort = "fortclassname" createVehicle [(getPos _spawntank select 0)-[color="Red"]25[/color]*sin(_dir),(getPos _spawntank select 1)-[color="Red"]25[/color]*cos(_dir)]; // put fortification within 25m radius of tank, facing same direction

Again, not tested.

Edited by Grimes [3rd ID]

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×