Jump to content

Teargas smoke


calamity

Recommended Posts

I haven't read this entire thread so Im not sure if this was pointed out, but using just the 

"SmokeShell"

class name will make every smoke grenade, regardless of color, have the exact same effect. You can't use a script that gives just SmokeShell an effect without also giving that to every other type of smoke grenade. You have to specify color.  I have a custom gas grenade script on my server that Matt started and Halvhjearne improved a couple of years ago and we ran into that exact problem. 

 

Also "G_40mm_SmokeGreen" is the correct classname for the 40mm smoke grenades. Basically any m203 smoke grenade firing weapon.

Link to comment
Share on other sites

How about this matt. Code may look familiar to ya, lol.  Wondering how to clear the massive amount of ammo that spawns with the usvehiclebox. I want to create an array it chooses from to fill the box. Hope you have the time. Thanks again man. If you come interstate 95 into NC i'll buy ya some lunch!!

Spoiler

                //MattL's carepackage script (edited by dgx) 
                _position = [((_playerpos select 0) + _cor_y),((_playerpos select 1) + _cor_x),200];
                waitUntil { (_aircraft distance _position < 50) };
                _aircraftpos = [_aircraft] call FNC_GetPos;
                _chute = createVehicle ["ParachuteMediumEast", _aircraftpos, [], 0, "FLY"];
                _chutePos = getPos _chute;
                _FlyingSupplyBox = createVehicle ["USVehicleBox", _chutePos, [], 0, "FLY"];
                _FlyingSupplyBox attachTo [_chute, [0,0,3]];
                _FlyingSupplyBox setVariable ["permaLoot",true];
                _FlyingSupplyBox setVariable ["ObjectID", ""];
                _FlyingSupplyBox addEventHandler ["handleDamage", {false}];
                _chute setVariable ["ObjectID", ""];
                _smoke = "SmokeShellYellow" createVehicle (getPos _FlyingSupplyBox);
                _smoke attachTo [_FlyingSupplyBox, [0,0,0]];
                //_flare = "F_40mm_white" createVehicle  (getPos _FlyingSupplyBox);
                //_flare attachTo [_FlyingSupplyBox, [0,0,0]];
                _var = floor((random 2) + 1);
 
 
 
                while {getPos _FlyingSupplyBox select 2 > 4} do
                {
                    _chute SetVelocity [0,0,-5];
                    uiSleep 0.1;
                };
                detach _FlyingSupplyBox;
                while {getPos _FlyingSupplyBox select 2 > 0} do {
                    _FlyingSupplyBox setPos [getPos _FlyingSupplyBox select 0, getPos _FlyingSupplyBox select 1, (getPos _FlyingSupplyBox select 2) - .25]
                };
                deleteVehicle _chute;
                _posATL = getPosATL _FlyingSupplyBox;
                deleteVehicle _FlyingSupplyBox;
                _SupplyBox = "USVehicleBox" createVehicle _posATL;
                _SupplyBox setVariable ["permaLoot",true];
                _SupplyBox enableSimulation false;
                //MattL's Carepackages script end
                
                //supply_drop.sqf code
                if (DZE_MissionLootTable) then {
                    dgx_itemTypes = [] + getArray (missionConfigFile >> "CfgBuildingLoot" >> "MassGrave" >> "lootType");
                    } else {
                    dgx_itemTypes = [] + getArray (configFile >> "CfgBuildingLoot" >> "MassGrave" >> "lootType");
                    };
                _CBLBase = dayz_CBLBase find (toLower("MassGrave"));
                _weights = dayz_CBLChances select _CBLBase;
                _cntWeights = count _weights;
                _num = (round(random 8)) + 4;
                for "_x" from 1 to _num do {
                //create loot
                _maxLootRadius = (random 4) + 4;
                _lootPos = [_posATL, _maxLootRadius, random 360] call BIS_fnc_relPos;
                _index1 = floor(random _cntWeights);
                _index2 = _weights select _index1;
                _itemType = dgx_itemTypes select _index2;
                [_itemType select 0, _itemType select 1, _lootPos, 5] call spawn_loot;
                };
 
                // ReammoBox is preferred parent class here, as WeaponHolder wouldn't match MedBox0 && other such items.
                _nearby = _position nearObjects ["ReammoBox", sizeOf("USVehicleBox")];
                {
                _x setVariable ["permaLoot",true];
                } count _nearBy;
                
                //supply_drop.sqf code end

Link to comment
Share on other sites

29 minutes ago, chi said:

How about this matt. Code may look familiar to ya, lol.  Wondering how to clear the massive amount of ammo that spawns with the usvehiclebox. I want to create an array it chooses from to fill the box. Hope you have the time. Thanks again man. If you come interstate 95 into NC i'll buy ya some lunch!!

  Reveal hidden contents

                //MattL's carepackage script (edited by dgx) 
                _position = [((_playerpos select 0) + _cor_y),((_playerpos select 1) + _cor_x),200];
                waitUntil { (_aircraft distance _position < 50) };
                _aircraftpos = [_aircraft] call FNC_GetPos;
                _chute = createVehicle ["ParachuteMediumEast", _aircraftpos, [], 0, "FLY"];
                _chutePos = getPos _chute;
                _FlyingSupplyBox = createVehicle ["USVehicleBox", _chutePos, [], 0, "FLY"];
                _FlyingSupplyBox attachTo [_chute, [0,0,3]];
                _FlyingSupplyBox setVariable ["permaLoot",true];
                _FlyingSupplyBox setVariable ["ObjectID", ""];
                _FlyingSupplyBox addEventHandler ["handleDamage", {false}];
                _chute setVariable ["ObjectID", ""];
                _smoke = "SmokeShellYellow" createVehicle (getPos _FlyingSupplyBox);
                _smoke attachTo [_FlyingSupplyBox, [0,0,0]];
                //_flare = "F_40mm_white" createVehicle  (getPos _FlyingSupplyBox);
                //_flare attachTo [_FlyingSupplyBox, [0,0,0]];
                _var = floor((random 2) + 1);
 
 
 
                while {getPos _FlyingSupplyBox select 2 > 4} do
                {
                    _chute SetVelocity [0,0,-5];
                    uiSleep 0.1;
                };
                detach _FlyingSupplyBox;
                while {getPos _FlyingSupplyBox select 2 > 0} do {
                    _FlyingSupplyBox setPos [getPos _FlyingSupplyBox select 0, getPos _FlyingSupplyBox select 1, (getPos _FlyingSupplyBox select 2) - .25]
                };
                deleteVehicle _chute;
                _posATL = getPosATL _FlyingSupplyBox;
                deleteVehicle _FlyingSupplyBox;
                _SupplyBox = "USVehicleBox" createVehicle _posATL;
                _SupplyBox setVariable ["permaLoot",true];
                _SupplyBox enableSimulation false;
                //MattL's Carepackages script end
                
                //supply_drop.sqf code
                if (DZE_MissionLootTable) then {
                    dgx_itemTypes = [] + getArray (missionConfigFile >> "CfgBuildingLoot" >> "MassGrave" >> "lootType");
                    } else {
                    dgx_itemTypes = [] + getArray (configFile >> "CfgBuildingLoot" >> "MassGrave" >> "lootType");
                    };
                _CBLBase = dayz_CBLBase find (toLower("MassGrave"));
                _weights = dayz_CBLChances select _CBLBase;
                _cntWeights = count _weights;
                _num = (round(random 8)) + 4;
                for "_x" from 1 to _num do {
                //create loot
                _maxLootRadius = (random 4) + 4;
                _lootPos = [_posATL, _maxLootRadius, random 360] call BIS_fnc_relPos;
                _index1 = floor(random _cntWeights);
                _index2 = _weights select _index1;
                _itemType = dgx_itemTypes select _index2;
                [_itemType select 0, _itemType select 1, _lootPos, 5] call spawn_loot;
                };
 
                // ReammoBox is preferred parent class here, as WeaponHolder wouldn't match MedBox0 && other such items.
                _nearby = _position nearObjects ["ReammoBox", sizeOf("USVehicleBox")];
                {
                _x setVariable ["permaLoot",true];
                } count _nearBy;
                
                //supply_drop.sqf code end

I was in pasquotank county earlier today. After you spawn the box you should be able to use like clearvehiclecargo or something like that. I havnt actually sat down and looked at code since I joined the navy so it would take me a hot minute to get the right variables and commands but what you want can be done 

Link to comment
Share on other sites

8 minutes ago, chi said:

Roger that. Doing good things by joining the navy. o7 Thanks!

Yeah so a few lines with removeWeapons removeMagazines and removeItems or some such should be sufficient enough to clear it out. I'm on my phone so I can't really do much to help other than help research and answer questions. And yeah man, I love it so far. I'm a corpsman up at MCB Quantico, it's a load of fun.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×
×
  • Create New...