weaponsfree 46 Posted July 19, 2016 Been looking around for some info on this, but have not found info specific to what I'm looking for.I want to add launchers on the ground, and load them with specific rockets. I know how to do this with a unit _unit addMagazine "ammo_type";_unit addWeapon "launcher_type". This ensures the weapon is loaded when added to the unit. But on the ground, I am not sure how to do this. The idea is a player has to reach a spot while under fire and quickly be able to shoot once the launcher is picked up.I'll be honest I haven't tried many solutions yet, and am at work looking through previous editing threads for a clue. Any help would be appreciated.Cheers Share this post Link to post Share on other sites
kylania 568 Posted July 19, 2016 RPG-7 wise this might be broken as today's dev branch change log says: Fixed: It was not possible to place a loaded RPG-7 in the editor Share this post Link to post Share on other sites
Grumpy Old Man 3546 Posted July 19, 2016 Use BIS_fnc_addWeapon. Since Launcher ammo takes quite an amount of inventory space the unit probably can't even carry one rocket with certain vests alone, so give him a backpack with enough space for some rockets. Cheers Share this post Link to post Share on other sites
weaponsfree 46 Posted July 19, 2016 RPG-7 wise this might be broken as today's dev branch change log says: That might be it actually, my first test was with RPG-7 Use BIS_fnc_addWeapon. Since Launcher ammo takes quite an amount of inventory space the unit probably can't even carry one rocket with certain vests alone, so give him a backpack with enough space for some rockets. Cheers Thanks, I am aware of the need for space in a unit's inventory, but this is for a rocket launcher placed on the ground, not on a unit. Share this post Link to post Share on other sites
ussrlongbow 116 Posted July 19, 2016 AFAIK, there was a way with spawning a gamelogic with loaded launcher then force this gamelogic to place that launcher in ground weapon holder Share this post Link to post Share on other sites
Grumpy Old Man 3546 Posted July 19, 2016 Ah, in a ground weapon holder? Nothing easier than that: _arpeegee = [] spawn { _pos = getposatl player; _weapon = "launch_RPG7_F"; _mag = (getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines")) select 0; _polizei = 3; _mags = random [1,2,_polizei]; _grp = createGroup civilian; _dummy = _grp createUnit ["B_Survivor_F", [0,0,0],[],0,"NONE"]; _dummy hideObject true; _dummy allowdamage false; _dummy addBackpack "B_Bergen_sgg"; sleep 5; [_dummy,_weapon,1] call BIS_fnc_addweapon; _groundWeaponHolder = "GroundWeaponHolder" createvehicle _pos; _groundWeaponHolder addMagazinecargo [_mag,_mags]; _dummy action ["DropWeapon", _groundWeaponHolder, _weapon]; sleep 5; deletevehicle _dummy; deleteGroup _grp; }; Sleep is necessary so the unit has time to drop the weapon. Cheers Share this post Link to post Share on other sites
weaponsfree 46 Posted July 19, 2016 Ah, in a ground weapon holder? Nothing easier than that: _arpeegee = [] spawn { _pos = getposatl player; _weapon = "launch_RPG7_F"; _mag = (getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines")) select 0; _polizei = 3; _mags = random [1,2,_polizei]; _grp = createGroup civilian; _dummy = _grp createUnit ["B_Survivor_F", [0,0,0],[],0,"NONE"]; _dummy hideObject true; _dummy allowdamage false; _dummy addBackpack "B_Bergen_sgg"; sleep 5; [_dummy,_weapon,1] call BIS_fnc_addweapon; _groundWeaponHolder = "GroundWeaponHolder" createvehicle _pos; _groundWeaponHolder addMagazinecargo [_mag,_mags]; _dummy action ["DropWeapon", _groundWeaponHolder, _weapon]; sleep 5; deletevehicle _dummy; deleteGroup _grp; }; Sleep is necessary so the unit has time to drop the weapon. Cheers Ah cool! Trying to mentally walk through what the script does, if I understand correctly, it creates an invisible unit that has the loaded launcher, he drops it, and is deleted. I assume that I can replace "_pos = getposatl player" with another item or location where I want the launcher to be? If the player is standing right next to where the weapon is spawned, will he see it being dropped? This is not a problem for me since the weapon will be placed away from where the player starts, but I'm just curious if there is a visual of a dropping/falling weapon, or if it immediately appears on the ground. Thanks for the help Old Man of the Grumpy kind. I'll be trying this tonight. Share this post Link to post Share on other sites
Grumpy Old Man 3546 Posted July 19, 2016 _pos is where you want the weaponholder. The player won't see it being dropped, there will suddenly be a loaded rpg7 with a few extra rounds on the floor, 10 seconds after using this snippet. Depending on the ground this can be hard to spot, tall grass etc. Cheers 1 Share this post Link to post Share on other sites