forked from Bob-Murphy/A3-Antistasi-1.4
-
-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
readded debug functions second time (#3131)
* readed debug functions seccond time --------- Co-authored-by: targetingsnake <targetingsnake@users.noreply.github.com>
- Loading branch information
1 parent
6540b7c
commit 1df0da1
Showing
3 changed files
with
248 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/* | ||
Author: Targetingsnake | ||
Description: | ||
Spawns a vehicles from template around player | ||
Arguments: None | ||
Return Value: None | ||
Scope: Local | ||
Environment: Any | ||
Public: Yes | ||
Dependencies: | ||
Example: [] call A3A_fnc_debugSpawnVics; | ||
License: MIT License | ||
*/ | ||
|
||
#include "..\..\script_component.hpp" | ||
FIX_LINE_NUMBERS() | ||
private _factions = [A3A_faction_reb, A3A_faction_inv, A3A_faction_occ, A3A_faction_civ]; | ||
|
||
private _pos = getPos player; | ||
private _lines = 10; | ||
private _current_line = 0; | ||
private _start_y = _pos select 0; | ||
|
||
private _calcPos = { | ||
params ["_lpos", "_llines", "_currentLines", "_y_start"]; | ||
if (_currentLines >= (_llines - 1)) then { | ||
_lpos set [1, (_lpos#1 + 30 )]; | ||
_lpos set [0, _y_start]; | ||
_currentLines = 0; | ||
} else { | ||
_lpos set [0, (_lpos#0) + 30]; | ||
_currentLines = _currentLines + 1; | ||
}; | ||
[_lpos, _currentLines] | ||
}; | ||
|
||
private _debugOutput = { | ||
params["_type"]; | ||
if (typeName _type != "STRING") then { | ||
_type = str _type; | ||
}; | ||
private _string = "Spawning: " + _type; | ||
Info(_string); | ||
}; | ||
|
||
Info("Start spawning vehicles"); | ||
{ | ||
Info("Spawning next Faction"); | ||
private _fn = _x get "name"; | ||
_fn = "Spawning " + _fn ; | ||
Info(_fn); | ||
private _faction = _x; | ||
private _keys = keys _x; | ||
{ | ||
private _key = _x; | ||
if (typeName _key == "STRING") then { | ||
private _value = _faction get _key; | ||
if (["vehicle", _x] call BIS_fnc_inString || (["static", _x] call BIS_fnc_inString | ||
&& (!(["unit", _x] call BIS_fnc_inString)) && (!(["Mag", _x] call BIS_fnc_inString))) ) then { | ||
if (typeName _value == "ARRAY" ) then { | ||
{ | ||
if (typeName _x == "STRING") then { | ||
_ar = [_pos, _lines, _current_line, _start_y] call _calcPos; | ||
_pos = _ar#0; | ||
_current_line = _ar#1; | ||
[_x] call _debugOutput; | ||
createVehicle [_x, _pos, [], 0, "CAN_COLLIDE"]; | ||
}; | ||
} forEach _value; | ||
}; | ||
if (typeName _value == "STRING" ) then { | ||
_ar = [_pos, _lines, _current_line, _start_y] call _calcPos; | ||
_pos = _ar#0; | ||
_current_line = _ar#1; | ||
[_value] call _debugOutput; | ||
createVehicle [_value, _pos, [], 0, "CAN_COLLIDE"]; | ||
}; | ||
}; | ||
}; | ||
} forEach _keys; | ||
_pos set [1, ((_pos#1) + 100)]; | ||
_pos set [0, (_start_y - 30)]; | ||
_current_line = _lines; | ||
} forEach _factions; | ||
Info("End spawning vehicles"); |
156 changes: 156 additions & 0 deletions
156
A3A/addons/core/functions/Debug/fn_spawnSelectedTemplateAI.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
/* | ||
Author: Targetingsnake, Bob, Laze | ||
Description: | ||
Spawns a couple of AI Units to check template | ||
Arguments: None | ||
Return Value: None | ||
Scope: Local | ||
Environment: Any | ||
Public: Yes | ||
Dependencies: | ||
Example: [] call A3A_fnc_spawnSelectedTemplateAI; | ||
License: MIT License | ||
*/ | ||
#include "..\..\script_component.hpp" | ||
FIX_LINE_NUMBERS() | ||
|
||
Info("Start spawning units"); | ||
|
||
//All Loadouts with 15 meters in between with NatoInit | ||
private _returnpos = getpos (player); | ||
private _westGrp = createGroup west; | ||
private _eastGrp = createGroup east; | ||
|
||
//All Loadouts with 15 meters in between | ||
_returnpos = getpos (player); | ||
//SF | ||
[_westGrp, "loadouts_occ_SF_SquadLeader", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_SF_Rifleman", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_SF_Medic", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_SF_Engineer", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_SF_ExplosivesExpert", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_SF_Grenadier", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_SF_LAT", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_SF_AT", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_SF_AA", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_SF_MachineGunner", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_SF_Marksman", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_SF_Sniper", getpos (player)] call A3A_fnc_createUnit; | ||
player setPos (getPos player vectorAdd [15,0,0]); | ||
//Military | ||
[_westGrp, "loadouts_occ_military_SquadLeader", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_military_Rifleman", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_military_Medic", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_military_Engineer", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_military_ExplosivesExpert", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_military_Grenadier", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_military_LAT", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_military_AT", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_military_AA", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_military_MachineGunner", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_military_Marksman", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_military_Sniper", getpos (player)] call A3A_fnc_createUnit; | ||
player setPos (getPos player vectorAdd [15,0,0]); | ||
//Militia | ||
[_westGrp, "loadouts_occ_militia_SquadLeader", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_militia_Rifleman", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_militia_Medic", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_militia_Engineer", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_militia_ExplosivesExpert", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_militia_Grenadier", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_militia_LAT", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_militia_AT", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_militia_AA", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_militia_MachineGunner", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_militia_Marksman", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_militia_Sniper", getpos (player)] call A3A_fnc_createUnit; | ||
player setPos (getPos player vectorAdd [15,0,0]); | ||
//Other Loadouts | ||
[_westGrp, "loadouts_occ_police_SquadLeader", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_police_Standard", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_other_Official", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_other_Traitor", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_other_Crew", getpos (player)] call A3A_fnc_createUnit; | ||
[_westGrp, "loadouts_occ_other_Pilot", getpos (player)] call A3A_fnc_createUnit; | ||
player setpos _returnpos; | ||
player setPos (getPos player vectorAdd [0,10,0]); | ||
//Safety west | ||
_westGrp setCombatMode "BLUE"; | ||
_westGrp setBehaviourStrong "CARELESS"; | ||
{ | ||
_x disableAI "TARGET"; | ||
_x disableAI "AUTOTARGET"; | ||
_x stop true; | ||
_x setCaptive true; | ||
} forEach units _westGrp; | ||
{[_x] call A3A_fnc_NATOinit} forEach units _westGrp; | ||
//All INV Loadouts | ||
//SF | ||
[_eastGrp, "loadouts_inv_SF_SquadLeader", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_SF_Rifleman", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_SF_Medic", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_SF_Engineer", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_SF_ExplosivesExpert", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_SF_Grenadier", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_SF_LAT", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_SF_AT", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_SF_AA", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_SF_MachineGunner", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_SF_Marksman", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_SF_Sniper", getpos (player)] call A3A_fnc_createUnit; | ||
player setPos (getPos player vectorAdd [15,0,0]); | ||
//Military | ||
[_eastGrp, "loadouts_inv_military_SquadLeader", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_military_Rifleman", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_military_Medic", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_military_Engineer", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_military_ExplosivesExpert", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_military_Grenadier", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_military_LAT", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_military_AT", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_military_AA", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_military_MachineGunner", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_military_Marksman", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_military_Sniper", getpos (player)] call A3A_fnc_createUnit; | ||
player setPos (getPos player vectorAdd [15,0,0]); | ||
//Militia | ||
[_eastGrp, "loadouts_inv_militia_SquadLeader", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_militia_Rifleman", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_militia_Medic", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_militia_Engineer", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_militia_ExplosivesExpert", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_militia_Grenadier", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_militia_LAT", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_militia_AT", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_militia_AA", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_militia_MachineGunner", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_militia_Marksman", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_militia_Sniper", getpos (player)] call A3A_fnc_createUnit; | ||
player setPos (getPos player vectorAdd [15,0,0]); | ||
//Other Loadouts | ||
[_eastGrp, "loadouts_inv_police_SquadLeader", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_police_Standard", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_other_Official", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_other_Traitor", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_other_Crew", getpos (player)] call A3A_fnc_createUnit; | ||
[_eastGrp, "loadouts_inv_other_Pilot", getpos (player)] call A3A_fnc_createUnit; | ||
|
||
|
||
//Safety east | ||
_eastGrp setCombatMode "BLUE"; | ||
_eastGrp setBehaviourStrong "CARELESS"; | ||
{ | ||
_x disableAI "TARGET"; | ||
_x disableAI "AUTOTARGET"; | ||
_x stop true; | ||
_x setCaptive true; | ||
} forEach units _eastGrp; | ||
{[_x] call A3A_fnc_NATOinit} forEach units _eastGrp; | ||
player setpos _returnpos; | ||
|
||
Info("End spawning units"); |