This is a space platform map, so there are 'holes' of space around my map. I am needing to spawn units between 6 different points, but only once.I need to be able to spawn units between points 1 and 2 OR 2 and 3 OR 3 and 4 OR 4 and 5 OR 5 and 6. I've tried nesting 'random points between points' and it's not working out correctly as I am getting the units spawning in the holes around my map.
Rollback Post to RevisionRollBack
The Team - TnTProductions
TnTProductions latest Project - Docking Bay 13
TnTProductions Epic RPG in the making - Psionics: Chaos Rising
Check out our website on wixx! http://bulletbutter.wix.com/tntproductions
Get the angle and distance between 2 points, then do a polar offset from point 1 towards point 2 with the angle you got and random distance between 0 and the distance between the points.
If you want a minimum distance to both points you can easily check the random value of distance and get a new value if its not right or:
1) substract 2 * mindistance from distance between points
2) get random value between 0 and new distance between points
3) add mindistance
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
This is a space platform map, so there are 'holes' of space around my map. I am needing to spawn units between 6 different points, but only once.I need to be able to spawn units between points 1 and 2 OR 2 and 3 OR 3 and 4 OR 4 and 5 OR 5 and 6. I've tried nesting 'random points between points' and it's not working out correctly as I am getting the units spawning in the holes around my map.
Get the angle and distance between 2 points, then do a polar offset from point 1 towards point 2 with the angle you got and random distance between 0 and the distance between the points.
If you want a minimum distance to both points you can easily check the random value of distance and get a new value if its not right or:
1) substract 2 * mindistance from distance between points
2) get random value between 0 and new distance between points
3) add mindistance