Jump to content
Sign in to follow this  
BlackbirdSD

Is placement within a rectangle possible?

Recommended Posts

If i remember correctly in Operation Flashpoint you used to have a choice to place men or objects randomly with rectangle or circle (like the trigger shape).  This would be so useful to randomly place men or objects within a rectangle instead of a circle.  Is this possible some how?

 

Thanks

Share this post


Link to post
Share on other sites

Same function I mentioned before, but a bit more in-depth: https://community.bistudio.com/wiki/BIS_fnc_randomPos
Check the example for a whitelisted array with - [center, [a, b, angle, rect]]

 

Not sure there's a simple way to do it through the editor, unless one of the 3den mods does it.

 

Here's an example anyway. Put this in the leader's init:

_randomPos = [[[_position, [_xAxis,_yAxis,_rotation,_rectangle]]],_blacklist] call BIS_fnc_randomPos;

So:
_randomPos = [[[getPos this,[100,100,0,true]]]] call BIS_fnc_randomPos;

 

  • Like 3

Share this post


Link to post
Share on other sites

Place a trigger on the map.  Set the dimensions of the trigger to create the rectangle you are looking for.

 

In the editor is a marker named "System Empty".   I like it because, when working in the editor, this marker is visible. When playing the game, this marker is invisible 

 

Place a System Empty Marker in 3 of the corners of your rectangle.  Place yourself in the 4th corner.

 

Right click on yourself and select  Connect - Set Random Start.  Draw a line to the first marker. Do it again and draw a line to the second marker. Do it again and draw a line to the third marker.

 

When you start the mission, you will start at one of 4 places at random. That is at your starting place or one of the 3 markers.

 

For the purposes of book keeping, I colour these markers blue as they represent the starting places of Blueforce.  For Opforce I colour them red.

 

Now you have 3 markers but you are going to start at 4 places at random.  If you come back to edit this in a few months time, you might be confused.  To stop confusion, I place a 4th marker in that 4th corner. The marker is coloured blue and the marker is not connected to anything.  Now I name all the markers, Blue_Start01, Blue_Start02, Blue_Start03, Blue_Start04.

 

Now that you are finished, remove the trigger.  It is not actually used for anything so remove it to stop confusion when you come back in a few months to edit the mission.

.

.

 

 

 

 

 

 

 

 

  • Like 2

Share this post


Link to post
Share on other sites
2 hours ago, beno_83au said:

Same function I mentioned before, but a bit more in-depth: https://community.bistudio.com/wiki/BIS_fnc_randomPos
Check the example for a whitelisted array with - [center, [a, b, angle, rect]]

 

Not sure there's a simple way to do it through the editor, unless one of the 3den mods does it.

 

Here's an example anyway. Put this in the leader's init:


_randomPos = [[[_position, [_xAxis,_yAxis,_rotation,_rectangle]]],_blacklist] call BIS_fnc_randomPos;

So:
_randomPos = [[[getPos this,[100,100,0,true]]]] call BIS_fnc_randomPos;

 

Thanks Ill try it

Share this post


Link to post
Share on other sites
2 hours ago, Joe98 said:

Place a trigger on the map.  Set the dimensions of the trigger to create the rectangle you are looking for.

 

In the editor is a marker named "System Empty".   I like it because, when working in the editor, this marker is visible. When playing the game, this marker is invisible 

 

Place a System Empty Marker in 3 of the corners of your rectangle.  Place yourself in the 4th corner.

 

Right click on yourself and select  Connect - Set Random Start.  Draw a line to the first marker. Do it again and draw a line to the second marker. Do it again and draw a line to the third marker.

 

When you start the mission, you will start at one of 4 places at random. That is at your starting place or one of the 3 markers.

 

For the purposes of book keeping, I colour these markers blue as they represent the starting places of Blueforce.  For Opforce I colour them red.

 

Now you have 3 markers but you are going to start at 4 places at random.  If you come back to edit this in a few months time, you might be confused.  To stop confusion, I place a 4th marker in that 4th corner. The marker is coloured blue and the marker is not connected to anything.  Now I name all the markers, Blue_Start01, Blue_Start02, Blue_Start03, Blue_Start04.

 

Now that you are finished, remove the trigger.  It is not actually used for anything so remove it to stop confusion when you come back in a few months to edit the mission.

.

.

 

 

 

 

 

 

 

 

That did what I want.  This opens up a whole new world of possibilities for me.  I can have many different start points exactly where I want them and they start at random.  Thanks so much

  • Like 2

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  

×