Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (!isNil "ScifiSupportPlus_SM_dropPod" && {ScifiSupportPlus_SM_dropPod}) then {
- ["[Sci-Fi+] Warhammer 40K", "[TEST] Astartes Drop Pod",
- {
- params [["_pos", [0, 0, 0], [[]], 3], ["_logic", objNull, [objNull]]];
- _factionsFound = [];
- {
- // Get all factions but ignore story and virtual groups.
- if !(gettext (configFile >> "CfgEditorSubcategories" >> (gettext (_x >> "editorSubcategory")) >> "displayname") in ["Men (Story)", "Men (Virtual Reality)"]) then {
- _factionsFound pushBackUnique [
- getNumber (_x >> "side"),
- gettext (configFile >> "CfgfactionClasses" >> (gettext (_x >> "faction")) >> "displayname"),
- gettext (configFile >> "CfgEditorSubcategories" >> (gettext (_x >> "editorSubcategory")) >> "displayname"),
- gettext (_x >> "faction"),
- gettext (_x >> "editorSubcategory")
- ];
- };
- } forEach ("(configname _x isKindOf 'CAManBase') && (getNumber (_x >> 'side') in [0, 1, 2]) && getNumber(_x >> 'scope') == 2 && gettext (_x>>'faction') in ['TIOW_ChaosSpaceMarines', 'TIOW_SpaceMarines']" configClasses (configFile >> "Cfgvehicles"));
- _factionsFound sort true;
- _factionindex = 0;
- _factions = _factionsFound;
- _factionspretty=[];
- {
- _x params ["_side", "_factname", "_catname", "_factClass", "_catClass"];
- _factionspretty pushBack [_catname, _factname, "", switch (_side) do {
- case 0: {
- [255, 0, 0, 255]
- };
- case 1: {
- [0, 0, 255, 255]
- };
- case 2: {
- [0, 255, 0, 255]
- };
- case 3: {
- [255, 0, 255, 255]
- };
- default {
- [0, 0, 0, 255]
- };
- }];
- } forEach _factionsFound;
- ["spawn Pod", [
- ["sideS", ["Side select (ONLY ONE!)", "The side the dropped unit will be on."], [east]],
- ["COMBO", ["faction", ""], [_factions, _factionspretty, 0]]
- ], {
- params["_values", "_arguments"];
- _dropside=_values select 0;
- _selection=_values select 1;
- _pos=_arguments select 0;
- _pos= (ASLtoATL _pos);
- _spawnpos = _pos vectorAdd [random [-500, 0, 500], random [-500, 0, 500], 1500];
- _mainprojectile=createvehicle ["Sh_125mm_APFSDS", _spawnpos, [], 0, "NONE"];
- _mainprojectile setShotParents [player, player];
- _angle = [(_pos vectorFromTo _spawnpos)#0, (_pos vectorFromTo _spawnpos)#1, ((_pos vectorFromTo _spawnpos)#2)];
- _projectile = createvehicle [switch (_selection#4) do {
- case "EdSubcat_AlphaLegion": {
- "TIOW_drop_Pod_AL"
- };
- case "EdSubcat_BlackLegion": {
- "TIOW_drop_Pod_BL"
- };
- case "EdSubcat_DeathGuard": {
- "TIOW_drop_Pod_DG"
- };
- case "EdSubcat_EmperorsChildren": {
- "TIOW_drop_Pod_EC"
- };
- case "EdSubcat_IronWarriors": {
- "TIOW_drop_Pod_IW"
- };
- case "EdSubcat_NightLords": {
- "TIOW_drop_Pod_NL"
- };
- case "EdSubcat_ThousandSons": {
- "TIOW_drop_Pod_TS"
- };
- case "EdSubcat_WordBearers": {
- "TIOW_drop_Pod_WB"
- };
- case "EdSubcat_WorldEaters": {
- "TIOW_drop_Pod_WE"
- };
- case "EdSubcat_BlackTemplars": {
- "TIOW_drop_Pod_BT"
- };
- case "EdSubcat_BloodAngels": {
- "TIOW_drop_Pod_BA"
- };
- case "EdSubcat_BloodRavens": {
- "TIOW_drop_Pod_BR"
- };
- case "EdSubcat_DarkAngels": {
- "TIOW_drop_Pod_DA"
- };
- case "EdSubcat_ImperialFists": {
- "TIOW_drop_Pod_IF"
- };
- case "EdSubcat_IronHands": {
- "TIOW_drop_Pod_IH"
- };
- case "EdSubcat_RavenGuard": {
- "TIOW_drop_Pod_RG"
- };
- case "EdSubcat_Salamanders": {
- "TIOW_drop_Pod_SAL"
- };
- case "EdSubcat_SpaceWolves": {
- "TIOW_drop_Pod_SW"
- };
- case "EdSubcat_Ultramarines": {
- "TIOW_drop_Pod_UM"
- };
- case "EdSubcat_WhiteScars": {
- "TIOW_drop_Pod_WS"
- };
- default {
- "TIOW_drop_Pod_BT"
- };
- }, [0, 0, 0], [], 0, "NONE"];
- _randomDirNumber = (random 360);
- [_projectile, -90, 0] call BIS_fnc_setPitchBank;
- _projectile setPosATL (getPosATL _mainprojectile);
- [_projectile, _mainprojectile] call BIS_fnc_attachtorelative;
- _projectile allowdamage false;
- _mainprojectile setvectorDirAndUp [_angle, [0, 0, 1]];
- [_projectile] spawn {
- params ["_projectile"];
- _projectile say3D ["Cov_dropPod_Thruster", 2000, random [0.5, 1, 1.5]];
- // 3.5 default z
- _RayPos1 = _projectile modeltoWorld [0, 0, 5];
- [[_projectile, _RayPos1], {
- params ["_projectile", "_RayPos1"];
- private _ps1 = "#particlesource" createvehiclelocal _RayPos1;
- _ps1 setParticleParams [
- ["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 7, 16, 1], "", "Billboard",
- 1, 8, [0, 0, 0], [0, 0, 2.5], 0, 10, 7.9, 0.066, [4, 12, 20],
- [[0, 0, 0, 0], [0.05, 0.05, 0.05, 1], [0.05, 0.05, 0.05, 1], [0.05, 0.05, 0.05, 1], [0.1, 0.1, 0.1, 0.5], [0.125, 0.125, 0.125, 0]],
- [0.25], 1, 0, "", "", _ps1];
- _ps1 setParticleRandom [0, [0.25, 0.25, 0], [0.2, 0.2, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0];
- _ps1 setDropInterval 0.05;
- _ps1 attachTo [_projectile];
- [_ps1, _projectile] spawn {
- params ['_ps1', '_projectile'];
- waitUntil {
- (!alive _projectile) || ((getPosATL _projectile # 2) < 5)
- };
- deletevehicle _ps1;
- };
- private _ps2 = "#particlesource" createvehiclelocal _RayPos1;
- _ps2 setParticleParams [
- ["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 10, 32], "", "Billboard",
- 1, (random 5), [0, 0, 0], [0, 0, 0.5], 0, 1, 1, 3, [3, 8], // made it very big
- [[1, 1, 1, 0.4], [1, 1, 1, 0.2], [1, 1, 1, 0]],
- [0.25, 1], 1, 1, "", "", _ps2];
- _ps2 setParticleRandom [0.2, [0.5, 0.5, 0.25], [0.125, 0.125, 0.125], 0.2, 0.2, [0, 0, 0, 0], 0, 0];
- _ps2 setDropInterval 0.01;
- _ps2 attachTo [_projectile];
- [_ps2, _projectile] spawn {
- params ['_ps2', '_projectile'];
- waitUntil {
- (!alive _projectile) || ((getPosATL _projectile # 2) < 5)
- };
- deletevehicle _ps2;
- };
- }] remoteExec ["spawn"];
- };
- [_mainprojectile, _pos, _projectile] spawn {
- params ["_mainprojectile", "_pos", "_projectile"];
- while {alive _mainprojectile} do {
- _mainprojectile setvelocity ((_pos vectorFromTo (getPosATL _mainprojectile)) vectorMultiply -150);
- };
- };
- [_mainprojectile, _pos, _dropside, _projectile, _selection, _randomDirNumber] spawn {
- params ["_mainprojectile", "_pos", "_dropside", "_projectile", "_selection", "_randomDirNumber"];
- _factionsFound = [];
- {
- // Get all factions but ignore story and virtual groups.
- if !(gettext (configFile >> "CfgEditorSubcategories" >> (gettext (_x >> "editorSubcategory")) >> "displayname") in ["Men (Story)", "Men (Virtual Reality)"]) then {
- _factionsFound pushBack [
- getNumber (_x >> "side"),
- gettext (configFile >> "CfgfactionClasses" >> (gettext (_x >> "faction")) >> "displayname"),
- gettext (configFile >> "CfgEditorSubcategories" >> (gettext (_x >> "editorSubcategory")) >> "displayname"),
- gettext (_x >> "faction"),
- gettext (_x >> "editorSubcategory"),
- configname _x
- ];
- };
- } forEach ("(configname _x isKindOf 'CAManBase') && (getNumber (_x >> 'side') in [0, 1, 2]) && getNumber(_x >> 'scope') == 2 && gettext (_x>>'faction') in ['TIOW_ChaosSpaceMarines', 'TIOW_SpaceMarines']" configClasses (configFile >> "Cfgvehicles"));
- _factionsFound sort true;
- _side = (_dropside select 0);
- _list = _factionsFound select {
- (_x#2)==(_selection#2)
- };
- _listout=[];
- for "_i" from 1 to 5 do{
- _listout pushBack ((selectRandom _list)#5);
- };
- _unitArray = _listout;
- _filteredArray = _unitArray select {
- _unit = _x;
- _displayName = toLower (getText (configFile >> "CfgVehicles" >> _unit >> "displayName"));
- !((_displayName find "dreadnought" > -1) || (_displayName find "terminator" > -1))
- };
- // _filteredArray now contains only the units of which display name does not contain 'dreadnought' or 'terminator'
- _posATL = _pos;
- waitUntil {
- if (alive _mainprojectile) then {
- _posATL = getPosATL _mainprojectile;
- };
- !alive _mainprojectile;
- };
- _posATL = (getPosATL _projectile);
- // systemchat format ["_posATL = %1",_posATL];
- // systemchat format ["_pos = %1",_pos];
- [[_posATL,_projectile], {
- params ["_posATL","_projectile"];
- _dust = "#particlesource" createVehicleLocal _posATL;
- _dust attachto [_projectile,[0,0,0]];
- detach _dust;
- _dust setParticleClass "BombDust";
- _blast = "#particlesource" createVehicleLocal _posATL;
- _blast setParticleCircle [0, [0, 0, 0]];
- _blast setParticleRandom [0, [0, 0, 0], [0, 0, 0], 0, 0, [0, 0, 0, 0], 0, 0];
- _blast setParticleParams [["\A3\data_f\koule", 1, 0, 1], "", "SpaceObject", 1,1,[0,0,0],[0,0,1],3,10,7.9,0,[50,1000],[[1, 1, 1, 0.1], [1, 1, 1, 0]], [1], 1, 0, "", "", _this];
- _blast setDropInterval 50;
- [_posATL] spawn {
- params ["_posATL"];
- _aslLoc = _posATL;
- _rocks1 = "#particlesource" createVehicleLocal _aslLoc;
- _rocks1 setposasl _aslLoc;
- _rocks1 setParticleParams [["\A3\data_f\ParticleEffects\Universal\Mud.p3d", 1, 0, 1], "", "SpaceObject", 1, 12.5, [0, 0, 0], [0, 0, 15], 5, 100, 7.9, 1, [.45, .45], [[0.1, 0.1, 0.1, 1], [0.25, 0.25, 0.25, 0.5], [0.5, 0.5, 0.5, 0]], [0.08], 1, 0, "", "", _aslLoc,0,false,0.3];
- _rocks1 setParticleRandom [0, [1, 1, 0], [20, 20, 15], 3, 0.25, [0, 0, 0, 0.1], 0, 0];
- _rocks1 setDropInterval 0.01;
- _rocks1 setParticleCircle [0, [0, 0, 0]];
- _rocks2 = "#particlesource" createVehicleLocal _aslLoc;
- _rocks2 setposasl _aslLoc;
- _rocks2 setParticleParams [["\A3\data_f\ParticleEffects\Universal\Mud.p3d", 1, 0, 1], "", "SpaceObject", 1, 12.5, [0, 0, 0], [0, 0, 15], 5, 100, 7.9, 1, [.27, .27], [[0.1, 0.1, 0.1, 1], [0.25, 0.25, 0.25, 0.5], [0.5, 0.5, 0.5, 0]], [0.08], 1, 0, "", "", _aslLoc,0,false,0.3];
- _rocks2 setParticleRandom [0, [1, 1, 0], [25, 25, 15], 3, 0.25, [0, 0, 0, 0.1], 0, 0];
- _rocks2 setDropInterval 0.01;
- _rocks2 setParticleCircle [0, [0, 0, 0]];
- _rocks3 = "#particlesource" createVehicleLocal _aslLoc;
- _rocks3 setposasl _aslLoc;
- _rocks3 setParticleParams [["\A3\data_f\ParticleEffects\Universal\Mud.p3d", 1, 0, 1], "", "SpaceObject", 1, 12.5, [0, 0, 0], [0, 0, 15], 5, 100, 7.9, 1, [.09, .09], [[0.1, 0.1, 0.1, 1], [0.25, 0.25, 0.25, 0.5], [0.5, 0.5, 0.5, 0]], [0.08], 1, 0, "", "", _aslLoc,0,false,0.3];
- _rocks3 setParticleRandom [0, [1, 1, 0], [30, 30, 15], 3, 0.25, [0, 0, 0, 0.1], 0, 0];
- _rocks3 setDropInterval 0.01;
- _rocks3 setParticleCircle [0, [0, 0, 0]];
- _rocks = [_rocks1,_rocks2, _rocks3];
- sleep 0.2;
- {
- deletevehicle _x;
- } foreach _rocks;
- };
- sleep 7;
- deleteVehicle _dust;
- deleteVehicle _blast;
- }] remoteExec ["spawn", [0,-2] select isDedicated,false];
- _craterpos = _posATL;
- _craterpos set [2, 0];
- _projectile setDir _randomDirNumber;
- _projectile setPos getPos _projectile;
- _projectile setvectorUp surfaceNormal position _projectile;
- _projectile setPosATL [(_craterpos #0), ( _craterpos #1), 0];
- _projectile setvelocity [0, 0, 0];
- [_posATL, _side, _filteredArray, _projectile] spawn {
- params ["_spawn", "_side", "_filteredArray", "_projectile"];
- sleep 0.5;
- {
- _projectile animate [_x, 1];
- } forEach (animationnames _projectile);
- sleep 1.5;
- _EliteUnit = [_spawn, _side, _filteredArray] call BIS_fnc_spawngroup;
- {
- _x setPosATL (_spawn findEmptyposition [3, 10, typeOf _x]);
- sleep 0.2;
- _randomPosAroundplayer = [[[(getPosATL _projectile), 50]], []] call BIS_fnc_randomPos;
- _x domove (_randomPosAroundplayer);
- } forEach (units _EliteUnit);
- };
- };
- }, {}, [_pos]] call zen_dialog_fnc_create;
- }, "\PHAN_ScifiSupportPlus\data\SpacemarineDropod.paa"] call zen_custom_modules_fnc_register;
- };
Advertisement
Add Comment
Please, Sign In to add comment