Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a function to be used in editor to prepare positions for lucySpawnStaticInf #5

Merged
merged 1 commit into from Jun 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
66 changes: 14 additions & 52 deletions gdc_lib_main/config.cpp
Expand Up @@ -16,50 +16,23 @@ class CfgFunctions
class gdc_choppa
{
file = "\gdc_lib_main\functions\gdc_choppa";
class choppa
{

};
class choppaCall
{

};
class choppa {};
class choppaCall {};
};
class gdc_extra
{
file = "\gdc_lib_main\functions\gdc_extra";
class extra
{

};
class extraCall
{

};
class extraCancel
{

};
class extra {};
class extraCall {};
class extraCancel {};
};
class gdc_halo
{
file = "\gdc_lib_main\functions\gdc_halo";
class halo
{

};
class haloPos
{

};
class haloPlayer
{

};
class haloServer
{

};
class halo {};
class haloPos {};
class haloPlayer {};
class haloServer {};
};
class lucy
{
Expand Down Expand Up @@ -92,26 +65,15 @@ class CfgFunctions
class lucyGetNearestPlayer {};
class lucyGetRandomFormation {};
class lucyVehicleRemoveItems {};
class lucyPrepareSpawnStatic {};
};
class util
{
file = "\gdc_lib_main\functions\util";
class chooseSpawnPos
{

};
class chooseIAHelicoInsert
{

};
class inventoryBriefing
{

};
class rosterBriefing
{

};
class chooseSpawnPos {};
class chooseIAHelicoInsert {};
class inventoryBriefing {};
class rosterBriefing {};
};
};
};
28 changes: 17 additions & 11 deletions gdc_lib_main/functions/gdc_lucy/spawn/fn_lucySpawnStaticInf.sqf
Expand Up @@ -2,18 +2,24 @@
Author: Mystery

Description:
Spawn a static infantery
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;
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];
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
Expand All @@ -24,7 +30,7 @@
5 (optional): NUMBER - Unit skill level between 0 and 1 - If not set, no level is set (use the default level)

Returns:
nothing
nothing
*/

params ["_unit_type", "_unit_pos_dir", "_unit_side", ["_unit_weak", "UP"], ["_unit_ai_disable", ["NOTHING"]], ["_unit_skill", -1]];
Expand Down
@@ -0,0 +1,38 @@
/*
Author: Shinriel

Description:
Use in the debug console in the editor to generate in your clipboard all unit and type of the selected units.
Very useful to spawn unit with fn_lucySpawnStaticInf

["CUP_I_GUE_Soldier_AKM", [[10656.8,2423.74,5.99855,240.725]], east] call GDC_fnc_lucySpawnStaticInf;
["CUP_I_GUE_Soldier_MG", [[10043.4,2070.73,6.0013,71.0722]], east] call GDC_fnc_lucySpawnStaticInf;
["CUP_I_GUE_Sniper", [[10415.1,2366.27,10.75,193.479]], east] call GDC_fnc_lucySpawnStaticInf;


Parameter(s):
None

Returns:
nothing
*/

private ["_br", "_pos_by_unit"];

_br = toString [13,10];
_pos_by_unit = [];
{
_veh = _x;
_pos = getPosASL _veh;
_pos_dir = [_pos select 0, _pos select 1, _pos select 2, getDir _veh];
_class = typeOf _veh;
_side = side _veh;
_pos_by_unit find _class;

_pos_by_unit = _pos_by_unit + [str ([_class, [_pos_dir], _side]) + " call GDC_fnc_lucySpawnStaticInf;"];
_pos_by_unit = _pos_by_unit + [_br];

} foreach (get3DENSelected "object");

copyToClipboard str composeText _pos_by_unit;