Locating the player's centre - Printable Version +- Comrades in Arms Discussion Board (http://forum.ciahome.net) +-- Forum: Comrades in Arms Life (http://forum.ciahome.net/forumdisplay.php?fid=3) +--- Forum: Mission Making (http://forum.ciahome.net/forumdisplay.php?fid=8) +--- Thread: Locating the player's centre (/showthread.php?tid=4070) |
Locating the player's centre - Mjolnir - 01-08-2021 Does anyone have, or know of a script that will locate the centre of mass of a group of players? I have an idea, but I need to be able to locate the centre point of a group of players to do it. RE: Locating the player's centre - Varanon - 01-08-2021 I use this in our framework: Code: /* Find a circle [center, radius] enclosing all given units It's not optimal (i.e. the circle could still be tighter), but it works for, for example, spawning stuff outside the player's bubble Locating the player's centre - Variable - 01-09-2021 Shouldn’t the title read players’ center? RE: Locating the player's centre - Mjolnir - 01-23-2021 Varanon Wrote:I use this in our framework: So I've come back to this, and you're going to have to explain how to use this to me like I'm 5 please, cause I dont know where to start RE: Locating the player's centre - Varanon - 01-25-2021 Mjolnir Wrote:So I've come back to this, and you're going to have to explain how to use this to me like I'm 5 please, cause I dont know where to start It finds the circle around the units, like this: _circle = [unit1, unit2, unit3, uint4] call compile preprocessFileLineNumbers "script.sqf"; _circle select 0 is then the center point, and _circle select 1 is the radius. If you want all player units, you need to get them first: Code: _playable = (if (isMultiplayer) then {playableUnits} else {switchableUnits}); If you are using the FHQ framework, you can simply do _circle = FHQ_PlayableUnits call FHQ_fnc_findBoundingCircle; |