Jump to content
  • 0

formula required


siriuz

Question

4 answers to this question

Recommended Posts

  • 0

Hello,

i need a formula for this, vehicles should only spawn in the B-area, not in A.

Someone has an idea?

thx

aP4X6hk.jpg

 

Lets say radius of A is 50 and B is 100.

You would check the distance from the center and make sure it is >= A and <= B.

_dist = _center distance _pos;
_dist >= 50 && {_dist <= 100}
Link to comment
Share on other sites

  • 0

first: spawn vehicles in circle b, second: delete all vehicles in cirle a, or split it up in small spawnareas

Not a very good solution.

From Mikeeeyy is better, but now using this, fits my imagination.

 

_radius     = 100;
_pos        = getPosATL _target;
_step     = 20;

for '_i' from 0 to 360 step (_step) do {
    _vehicle = createVehicle ["kamaz", [(_pos select 0) + ((cos _i) * _radius), (_pos select 1) + ((sin _i) * _radius),_pos select 2], [], 0, "CAN_COLLIDE"];
};

TY all!

Link to comment
Share on other sites

  • 0

Not a very good solution.

From Mikeeeyy is better, but now using this, fits my imagination.

 

_radius     = 100;
_pos        = getPosATL _target;
_step     = 20;

for '_i' from 0 to 360 step (_step) do {
    _vehicle = createVehicle ["kamaz", [(_pos select 0) + ((cos _i) * _radius), (_pos select 1) + ((sin _i) * _radius),_pos select 2], [], 0, "CAN_COLLIDE"];
};

TY all!

 

Ahh, I thought you meant you wanted to spawn the vehicles within the green and red line.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...