Lucy Spawn functions - GdC-Framework/GdC_lib GitHub Wiki

GDC_fnc_lucySpawnGroupInf

Exemple

inf_group1 = [getMarkerPos "mkr_group_inf", UNIT_SIDE, ["CUP_O_TK_INS_Commander", "CUP_O_TK_INS_Commander"]] call GDC_fnc_lucySpawnGroupInf;
	Description:
	Spawn an infantery group

	Parameter(s):
		0 : ARRAY - position where to spawn the group
        1 : STRING - units side
        2 : ARRAY - Array of string classname of soldiers (First unit is group leader)
        3 (optional): NUMBER - Units skill level between 0 and 1 - If not set, no level is set (use the default level)

	Returns:
	the new group created

GDC_fnc_lucySpawnVehicle

/!\ Important : Lucy utilise une position temporaire de spawn définie par un marker. Le marker par défaut est "mkr_spawn_static_unit" (voir init). Or si ce marker n'est pas défini dans votre mission (ou écrasé par le votre) Arma retourne la position [0, 0, 0] par défaut ce qui correspond, pour la plupart des cartes, à apparaître au dessus de la mer (Altis par exemple). Votre véhicule a donc une chance d'avoir le moteur détruit par l'eau et de ne pas démarrer. Pensez donc à définir ce marker.

_veh = [
	getMarkerPos "mkr_group_vehicle",
	west, 
	"rhs_btr80_msv", 
	["rhs_msv_armoredcrew","rhs_msv_armoredcrew","rhs_msv_armoredcrew"],
	0,
	["NONE", 0, 0],
	-1
] call GDC_fnc_lucySpawnVehicle;
	Author: Mystery, Sparfell

	Description:
	Spawn a vehicle manned by AI

	Parameter(s):
		0 : ARRAY - Spawn position
		1 : STRING - Group Side (WEST, EAST, INDEPENDENT, CIVILIAN)
		2 : STRING - type of vehicle (Vehicle will spawn empty)
		3 : ARRAY of STRINGs - Vehicle crew classnames
		4 (optional): NUMBER - Vehicles direction (Azimuth 0 - 360) - Default is 0
		5 (optional): ARRAY - Array flying parameters [Special(NONE, FLY, FORM), Altitude(m) , Speed (m/s)] - Default is ["NONE", 0, 0] - Use them only for aerial vehicles
		6 (optional): NUMBER - Units skill level between 0 and 1 - If not set, no level is set (use the default level)

	Returns:
	An array which contains: [New group created, New vehicle created]

GDC_fnc_lucySpawnWithoutCollision

Cette fonction spawn un véhicule en évitant la collision avec un véhicule déjà présent. Utile pour faire apparaître une série de véhicule sans qu'il explosent les uns sur les autres. Pour un bon fonctionnement, définissez plusieurs points de spawn. Résumé du fonctionnement : La fonction choisit aléatoirement un des points de spawn, si celui si est occupé elle refait une sélection aléatoire. Le MM doit donc veiller à ce que les points de spawn soient dégagés pour éviter une boucle infinie.

_veh =  [
	[marker_0, [100,500,0], unit_0, group_0],
	[west, "rhs_btr80_msv", ["rhs_msv_armoredcrew","rhs_msv_armoredcrew","rhs_msv_armoredcrew"]],
	30
] call GDC_fnc_lucySpawnWithoutCollision;
/**
 * @brief Function spawning AI vehicules with Lucy functions without collisions.
 *
 * @param {Array} _positions, elements can be Arrays, Objects, Groups, Locations and Strings. (see BIS_fnc_position)
 * @param {Array} [_param_to_lucy] - list of the parameters of GDC_fnc_lucySpawnVehicle function (use the order of lucySpawnVehicle function).
 * @param {number} [_safe_zone = 10] -  radius of the safe zone around the spawn waypoint where the function check for other vehicle.
 *
 * @returns {Array} - #0 unit group, #1 vehicle.
 * @author Migoyan
 *
 * @note GDC_fnc_lucySpawnVehicle eat [position, side, "classname", crew, orientation], reduce the array to [side, "classname", crew, orientation] for this function to work
 * or give a dummy param.
 */

GDC_fnc_lucySpawnStaticInf

["CUP_O_TK_INS_Commander", [[22956.5,18882.3,8.84036,33.027],[22965,18876.1,8.83073,33.027],[22959.9,18873.4,5.32645,199.545]], EAST] call GDC_fnc_lucySpawnStaticInf;

Pour avoir les positions, posez vos unités dans l'éditeur. Sélectionnez plusieurs unités et lancez le script suivant dans la console de debug de l'éditeur. Vous n'aurez plus qu'à copier les positions qui seront mis dans votre presse papier directement.

_PosDirArray = [];
    { 
    _veh = _x; 
    _pos_dir = [(getPosASL  _veh select 0), (getPosASL _veh select 1), getPosASL _veh select 2, getDir _veh]; 
    _PosDirArray = [_pos_dir] + _PosDirArray;
    } foreach (get3DENSelected "object"); 
    copyToClipboard str _PosDirArray;
	Author: Mystery

	Description:
        Spawn a static infantary, you have to method to get position from your units on the missions
        Don't forget to set the presence to 0%

        1)
            call GDC_fnc_lucyPrepareSpawnStatic;

        2)
            Use the following command to get ASL position and azimuth in the debug console. Then, paste to your script and change unit type and side.
            _PosDirArray = [];
            {
            _veh = _x;
            _pos_dir = [(getPosASL _veh select 0), (getPosASL _veh select 1), getPosASL _veh select 2, getDir _veh];
            _PosDirArray = [_pos_dir] + _PosDirArray;
            } foreach (get3DENSelected "object");
            copyToClipboard str _PosDirArray;

    # Old version...
        copyToClipboard format["static_unit_x = [SOLDAT, [[%1, %2, %3]], [%4], UNIT_SIDE] call GDC_fnc_lucySpawnStaticInf;", (getPosASL player select 0), getPosASL player select 1, getPosASL player select 2, getDir player];

	Parameter(s):
		0 : STRING - unit class name
        1 : ARRAY - Array of units positions + azimuths
        2 : STRING - unit side (WEST, EAST, INDEPENDENT, CIVILIAN)
        3 (optional): STRING - Unit specific position - Values : DOWN, MIDDLE, UP, AUTO - Default is UP
        4 (optional): ARRAY - Unit disableAI utility, array of values: Values : TARGET, AUTOTARGET, MOVE, ANIM, FSM, AIMINGERROR, SUPPRESSION - Default is ["NOTHING"]
        5 (optional): NUMBER - Unit skill level between 0 and 1 - If not set, no level is set (use the default level)
        6 (optional): STRING - Script to execute on the unit's INIT, use "this" in the script to call the current unit

	Returns:
        An array which contains all spawned units

GDC_fnc_lucySpawnGroupInfParadrop

_group = [
	[7922.06,8749.33,0],[7918.08,10156,0],[7898.99,13329.8,0],
	blufor,["B_T_VTOL_01_infantry_F","B_T_Helipilot_F",300],
	["B_Soldier_TL_F","B_Soldier_F","B_Soldier_F","B_soldier_AR_F","B_soldier_LAT_F"],
	"NORMAL"
] call GDC_fnc_lucySpawnGroupInfParadrop;
	Author: Mystery
	Description:
	Spawn plane with a group of infantry for paradrop
	Parameter(s):
		0 : ARRAY - Position or array of positions, plane will spawn on first position
		1 : ARRAY - Position to start the paradrop
		2 : ARRAY - Position or array of positions after launch paradrop, vehicule will be send far far away from the last point to be destroyed
		3 : SIDE - Side (WEST, EAST, INDEPENDENT, CIVILIAN)
		4 : ARRAY - Config for the plane ["plane class name", "pilot class name", "plane altitude (m)", "plane speed (m/s)" (optional)]
		5 : ARRAY - Array of infantry soldiers (the group which will be paradropped)
		6 (optional) : STRING - Speed mode of the vehicle - LIMITED, NORMAL, FULL (Default "LIMITED")
	Returns:
	[The group which will be paradropped, the plane group]

GDC_fnc_lucySpawnRandomPatrols

_group = [
	["mkr_patrol"],
	["water"],
	12,
	[4, 7, 13],
	east,
	"CUP_O_INS_Soldier",
	["MOVE", "UNCHANGED", "SAFE", "YELLOW", "COLUMN"]
] call GDC_fnc_lucySpawnRandomPatrols;
/**
 * @brief Fully randomized spawns and group size of patrols inside given positions using Lucy. Randomize loadouts inside <*.sqf> loaded into Lucy
 * for complete randomization.
 *
 * @param {Array} _positions, elements can be Arrays, Objects, Groups, Locations and Strings. (see BIS_fnc_position).
 * @param {Array} [_blacklist = ["water"]], blacklisted position. (see BIS_fnc_position)
 * @param {Number} [_numbers = 10], number of patrol
 * @param {Arrays} [_size = [4, 8, 13]], Random sizes of patrols, Array [min,mid,max] (Gaussian distribution). Max is excluded (floored result).
 * @param {Side} [_side = east], side of patrols.
 * @param {String} [_classname = "O_Soldier_F"], Classname of units spawned.
 * @param {Array} [_patrol_params = ["MOVE", "UNCHANGED", "SAFE", "NO CHANGE", "COLUMN"]], parameters of the patrols. (see GDC_fnc_lucyGroupRandomPatrol)
 *
 * @returns {Array} - All groups spawned.
 * @author Migoyan
 */
⚠️ **GitHub.com Fallback** ⚠️