ACE3/addons/csw/functions/fnc_assemble_pickupWeapon.sqf

105 lines
5.0 KiB
Plaintext
Raw Normal View History

#include "..\script_component.hpp"
Adds Crew Served Static Weapons (#5652) * Initial Commit * Got rid of unneeded translation values * Updated Strings * "Fixed" issue where when you deploy the tripid and weapon on slope it freaked out. * Fixed locality issues. Added timers to relavent functions. * Added weights to all magazines/tripod. Weights to weapons coming soon when I transfer them to the launcher slot * Fixed bug regarding localized strings. Created new tripod model * Added timers for deploying/picking up the tripod. Changed ammo-box model from custom to one already in ARMA. Changed gun-bag model for a more generic one. Created a texture for the tripod and gunbag * Removed ability to disassemble weapons via the addAction. Added ACE Action to get in due to a memory point issue. Changed from a static deploy/dismount time to one based in the weapon configs * Created forward-compatability. Made it so I can define a base plate for any weapon if I ever want to expand from the generic M3 Tripod. * Fixed bug where tripod wouldn't deploy with the correct times. Fixed bug where if you moved the tripod into the ground it would go flying. * Added mortar compatability. Will probably shift whole mortar ammo loading to CSW one day * Added icons to each relavent item * Added README, possibly fixed bug where if you are in a weapon others cant load/unload ammo. Changed distance you can interact with weapons * Added checks for when deploying the gun as well as unloading ammo to prevent duplication/deletion of items. * Added documentation * Added order to doc * Explained why things are the way they are * Remove temp files * Removed redundant files * Converted tabs->spaces. Added newlines at end of all files. Changed broken line in fnc_tripodDeploy.sqf. * 100% newlines at end of file * Added newlines to files that didnt get the change. Fixed README. Changed from GVAR(cswOptions) to GVAR(options). Changed from tabs to spaces in wiki * Fixed issue with UAV assembling with enableWeaponDisassembling. Fixed bug where game would crash if you disassembled static weapon with more than 1 magazine * Tabs->Spaces * Added CSW options to base StaticWeapon class to allow for easier additions. Switched default mortar away from CSW system due to incompatabilities * Lazy Evaluations and macros to describe how things work. * Added newlines to script_component. Fix no-texture issue on tripod. "Fix" 20mm HE saying 40mm HE. Add custom icons to all weapons. Move "Check Ammo" to CSW menu * abc * Revert "abc" This reverts commit bcb4214bd99bba3fec692efa4dca950323da582d. * Update to current commit * Revert changes to fortify.md * Updated UI Icon to Crew Served Ammo branch UI * Added Pabst's CrewServedAmmo to handle ammo loading/unloading instead of my solution * Fixed bug where currentWeaponTurret returned a blank string when a player hasent entered hte weapon to select the current weapon * Re-added ammo loading time * Tabs->Spaces * Newline at end of files * Removed replaced functions * Remove redundant strings. Move ammo handling to appropiate section * Tabs->Spaces * Update wiki * Updated to fix crash with default weapons and disable CSW ability on default static weapons * Added editor attributes to enable/disable CSW at edit time * Change how ammo is removed from the CSW. Uses math instead of iteration * Fix bug where assembled weapon did not get rid of default actions * Added support for multiple types of ammo in one CSW * Add tracer magazines for .50 cal * Fix bug where you could load ammo even if the gun couldnt take any more * Disable debug and enable compile cache * Changed weapon deploy/pickup time. Removed custom Titan missiles. Using ACE Dragging now. Added progress bar check for pickupTripod. Updated documentation * Removed check if CSW is full to unload ammo * Fix bug where items would spawn underneath other items on wepaon dismount * Change some things * Configure base statics, improve returnAmmo * Add mortar baseplate * Remove explicit inheritance * Fix bug where unloading ammo would duplicate it if you had room in your person. * Tab->Space * Player couldnt pickup tripod due to legacy code * Fix GMG_01_base_F inheritce * Port of ACE 2 tripod + ACE 2 CSW Bag * Move ACE 2 Data to APL folder * Adjust weights to make them more accurate to how ARMA uses it and the real life equivalents * Fix bug where error was thrown on esc from picking up tripod. Tripod rotated 180 * Fix bug where if you called ace_common_claim the weapon could be set to be disassembled even though it may not be wanted via CSW * Added ability to toggle ammo handling when weaponAssembly is disabled. * Add Proxy Weapons for all Vanilla static weapons. These serve as a way to allow for realistic ammo reload times without having to modify base classes if you want feautres turned off. Adjusted reload and mount times to be more "realistic" * Fix Shadow RPT Spam * Update wiki * Change order of setDir and setPos * Change all setDir/setPos orientations. Remove redundant check. Ensure that weapon locked state reflects it with the "getIn" command. Add a way to pass in a specific classname for the weapon assemble type. Add a callback function onDisassemble if user wants to set the state of the new tripod using the old weapon as a reference * Actually check for the carryWeaponClassname in the deployWeapon check * Ai Compatiblity * Add stringtable entries * Formatting fixes * Stringtables for settings, fix setMagazineTurretAmmo * inherit ammo for mags, reorder stringtable displays correct ammo and descriptionShort * don't require ace_javelin * Tweaks, cleanup, localzation, ace_reload changes change weapon tag to [CSW] tweak localization strings minor cleanup simplify some ace_reload funcs * delete moved dev func * Hopefully fix issue where to-be deleted tripod intersects with newly created weapon and vice versa. Remove PBOPREFIX newline * cleanup/proxyWeapon/mk6 compat
2019-06-08 04:47:39 +00:00
/*
2023-08-16 23:18:01 +00:00
* Author:tcvm
Adds Crew Served Static Weapons (#5652) * Initial Commit * Got rid of unneeded translation values * Updated Strings * "Fixed" issue where when you deploy the tripid and weapon on slope it freaked out. * Fixed locality issues. Added timers to relavent functions. * Added weights to all magazines/tripod. Weights to weapons coming soon when I transfer them to the launcher slot * Fixed bug regarding localized strings. Created new tripod model * Added timers for deploying/picking up the tripod. Changed ammo-box model from custom to one already in ARMA. Changed gun-bag model for a more generic one. Created a texture for the tripod and gunbag * Removed ability to disassemble weapons via the addAction. Added ACE Action to get in due to a memory point issue. Changed from a static deploy/dismount time to one based in the weapon configs * Created forward-compatability. Made it so I can define a base plate for any weapon if I ever want to expand from the generic M3 Tripod. * Fixed bug where tripod wouldn't deploy with the correct times. Fixed bug where if you moved the tripod into the ground it would go flying. * Added mortar compatability. Will probably shift whole mortar ammo loading to CSW one day * Added icons to each relavent item * Added README, possibly fixed bug where if you are in a weapon others cant load/unload ammo. Changed distance you can interact with weapons * Added checks for when deploying the gun as well as unloading ammo to prevent duplication/deletion of items. * Added documentation * Added order to doc * Explained why things are the way they are * Remove temp files * Removed redundant files * Converted tabs->spaces. Added newlines at end of all files. Changed broken line in fnc_tripodDeploy.sqf. * 100% newlines at end of file * Added newlines to files that didnt get the change. Fixed README. Changed from GVAR(cswOptions) to GVAR(options). Changed from tabs to spaces in wiki * Fixed issue with UAV assembling with enableWeaponDisassembling. Fixed bug where game would crash if you disassembled static weapon with more than 1 magazine * Tabs->Spaces * Added CSW options to base StaticWeapon class to allow for easier additions. Switched default mortar away from CSW system due to incompatabilities * Lazy Evaluations and macros to describe how things work. * Added newlines to script_component. Fix no-texture issue on tripod. "Fix" 20mm HE saying 40mm HE. Add custom icons to all weapons. Move "Check Ammo" to CSW menu * abc * Revert "abc" This reverts commit bcb4214bd99bba3fec692efa4dca950323da582d. * Update to current commit * Revert changes to fortify.md * Updated UI Icon to Crew Served Ammo branch UI * Added Pabst's CrewServedAmmo to handle ammo loading/unloading instead of my solution * Fixed bug where currentWeaponTurret returned a blank string when a player hasent entered hte weapon to select the current weapon * Re-added ammo loading time * Tabs->Spaces * Newline at end of files * Removed replaced functions * Remove redundant strings. Move ammo handling to appropiate section * Tabs->Spaces * Update wiki * Updated to fix crash with default weapons and disable CSW ability on default static weapons * Added editor attributes to enable/disable CSW at edit time * Change how ammo is removed from the CSW. Uses math instead of iteration * Fix bug where assembled weapon did not get rid of default actions * Added support for multiple types of ammo in one CSW * Add tracer magazines for .50 cal * Fix bug where you could load ammo even if the gun couldnt take any more * Disable debug and enable compile cache * Changed weapon deploy/pickup time. Removed custom Titan missiles. Using ACE Dragging now. Added progress bar check for pickupTripod. Updated documentation * Removed check if CSW is full to unload ammo * Fix bug where items would spawn underneath other items on wepaon dismount * Change some things * Configure base statics, improve returnAmmo * Add mortar baseplate * Remove explicit inheritance * Fix bug where unloading ammo would duplicate it if you had room in your person. * Tab->Space * Player couldnt pickup tripod due to legacy code * Fix GMG_01_base_F inheritce * Port of ACE 2 tripod + ACE 2 CSW Bag * Move ACE 2 Data to APL folder * Adjust weights to make them more accurate to how ARMA uses it and the real life equivalents * Fix bug where error was thrown on esc from picking up tripod. Tripod rotated 180 * Fix bug where if you called ace_common_claim the weapon could be set to be disassembled even though it may not be wanted via CSW * Added ability to toggle ammo handling when weaponAssembly is disabled. * Add Proxy Weapons for all Vanilla static weapons. These serve as a way to allow for realistic ammo reload times without having to modify base classes if you want feautres turned off. Adjusted reload and mount times to be more "realistic" * Fix Shadow RPT Spam * Update wiki * Change order of setDir and setPos * Change all setDir/setPos orientations. Remove redundant check. Ensure that weapon locked state reflects it with the "getIn" command. Add a way to pass in a specific classname for the weapon assemble type. Add a callback function onDisassemble if user wants to set the state of the new tripod using the old weapon as a reference * Actually check for the carryWeaponClassname in the deployWeapon check * Ai Compatiblity * Add stringtable entries * Formatting fixes * Stringtables for settings, fix setMagazineTurretAmmo * inherit ammo for mags, reorder stringtable displays correct ammo and descriptionShort * don't require ace_javelin * Tweaks, cleanup, localzation, ace_reload changes change weapon tag to [CSW] tweak localization strings minor cleanup simplify some ace_reload funcs * delete moved dev func * Hopefully fix issue where to-be deleted tripod intersects with newly created weapon and vice versa. Remove PBOPREFIX newline * cleanup/proxyWeapon/mk6 compat
2019-06-08 04:47:39 +00:00
* Dismounts the weapon from the tripod and drops its backpack beside
*
* Arguments:
* 0: Static Weapon <OBJECT>
*
* Return Value:
* None
*
* Example:
* [weapon] call ace_csw_fnc_assemble_pickupWeapon
*
* Public: No
*/
[{
params ["_staticWeapon", "_player"];
TRACE_2("assemble_pickupWeapon",_staticWeapon,_player);
private _onDisassembleFunc = getText(configOf _staticWeapon >> QUOTE(ADDON) >> "disassembleFunc");
private _carryWeaponClassname = getText(configOf _staticWeapon >> QUOTE(ADDON) >> "disassembleWeapon");
private _turretClassname = getText(configOf _staticWeapon >> QUOTE(ADDON) >> "disassembleTurret");
Adds Crew Served Static Weapons (#5652) * Initial Commit * Got rid of unneeded translation values * Updated Strings * "Fixed" issue where when you deploy the tripid and weapon on slope it freaked out. * Fixed locality issues. Added timers to relavent functions. * Added weights to all magazines/tripod. Weights to weapons coming soon when I transfer them to the launcher slot * Fixed bug regarding localized strings. Created new tripod model * Added timers for deploying/picking up the tripod. Changed ammo-box model from custom to one already in ARMA. Changed gun-bag model for a more generic one. Created a texture for the tripod and gunbag * Removed ability to disassemble weapons via the addAction. Added ACE Action to get in due to a memory point issue. Changed from a static deploy/dismount time to one based in the weapon configs * Created forward-compatability. Made it so I can define a base plate for any weapon if I ever want to expand from the generic M3 Tripod. * Fixed bug where tripod wouldn't deploy with the correct times. Fixed bug where if you moved the tripod into the ground it would go flying. * Added mortar compatability. Will probably shift whole mortar ammo loading to CSW one day * Added icons to each relavent item * Added README, possibly fixed bug where if you are in a weapon others cant load/unload ammo. Changed distance you can interact with weapons * Added checks for when deploying the gun as well as unloading ammo to prevent duplication/deletion of items. * Added documentation * Added order to doc * Explained why things are the way they are * Remove temp files * Removed redundant files * Converted tabs->spaces. Added newlines at end of all files. Changed broken line in fnc_tripodDeploy.sqf. * 100% newlines at end of file * Added newlines to files that didnt get the change. Fixed README. Changed from GVAR(cswOptions) to GVAR(options). Changed from tabs to spaces in wiki * Fixed issue with UAV assembling with enableWeaponDisassembling. Fixed bug where game would crash if you disassembled static weapon with more than 1 magazine * Tabs->Spaces * Added CSW options to base StaticWeapon class to allow for easier additions. Switched default mortar away from CSW system due to incompatabilities * Lazy Evaluations and macros to describe how things work. * Added newlines to script_component. Fix no-texture issue on tripod. "Fix" 20mm HE saying 40mm HE. Add custom icons to all weapons. Move "Check Ammo" to CSW menu * abc * Revert "abc" This reverts commit bcb4214bd99bba3fec692efa4dca950323da582d. * Update to current commit * Revert changes to fortify.md * Updated UI Icon to Crew Served Ammo branch UI * Added Pabst's CrewServedAmmo to handle ammo loading/unloading instead of my solution * Fixed bug where currentWeaponTurret returned a blank string when a player hasent entered hte weapon to select the current weapon * Re-added ammo loading time * Tabs->Spaces * Newline at end of files * Removed replaced functions * Remove redundant strings. Move ammo handling to appropiate section * Tabs->Spaces * Update wiki * Updated to fix crash with default weapons and disable CSW ability on default static weapons * Added editor attributes to enable/disable CSW at edit time * Change how ammo is removed from the CSW. Uses math instead of iteration * Fix bug where assembled weapon did not get rid of default actions * Added support for multiple types of ammo in one CSW * Add tracer magazines for .50 cal * Fix bug where you could load ammo even if the gun couldnt take any more * Disable debug and enable compile cache * Changed weapon deploy/pickup time. Removed custom Titan missiles. Using ACE Dragging now. Added progress bar check for pickupTripod. Updated documentation * Removed check if CSW is full to unload ammo * Fix bug where items would spawn underneath other items on wepaon dismount * Change some things * Configure base statics, improve returnAmmo * Add mortar baseplate * Remove explicit inheritance * Fix bug where unloading ammo would duplicate it if you had room in your person. * Tab->Space * Player couldnt pickup tripod due to legacy code * Fix GMG_01_base_F inheritce * Port of ACE 2 tripod + ACE 2 CSW Bag * Move ACE 2 Data to APL folder * Adjust weights to make them more accurate to how ARMA uses it and the real life equivalents * Fix bug where error was thrown on esc from picking up tripod. Tripod rotated 180 * Fix bug where if you called ace_common_claim the weapon could be set to be disassembled even though it may not be wanted via CSW * Added ability to toggle ammo handling when weaponAssembly is disabled. * Add Proxy Weapons for all Vanilla static weapons. These serve as a way to allow for realistic ammo reload times without having to modify base classes if you want feautres turned off. Adjusted reload and mount times to be more "realistic" * Fix Shadow RPT Spam * Update wiki * Change order of setDir and setPos * Change all setDir/setPos orientations. Remove redundant check. Ensure that weapon locked state reflects it with the "getIn" command. Add a way to pass in a specific classname for the weapon assemble type. Add a callback function onDisassemble if user wants to set the state of the new tripod using the old weapon as a reference * Actually check for the carryWeaponClassname in the deployWeapon check * Ai Compatiblity * Add stringtable entries * Formatting fixes * Stringtables for settings, fix setMagazineTurretAmmo * inherit ammo for mags, reorder stringtable displays correct ammo and descriptionShort * don't require ace_javelin * Tweaks, cleanup, localzation, ace_reload changes change weapon tag to [CSW] tweak localization strings minor cleanup simplify some ace_reload funcs * delete moved dev func * Hopefully fix issue where to-be deleted tripod intersects with newly created weapon and vice versa. Remove PBOPREFIX newline * cleanup/proxyWeapon/mk6 compat
2019-06-08 04:47:39 +00:00
private _pickupTime = getNumber(configFile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON) >> "pickupTime");
TRACE_4("",typeOf _staticWeapon,_carryWeaponClassname,_turretClassname,_pickupTime);
if (!isClass (configFile >> "CfgWeapons" >> _carryWeaponClassname)) exitWith {ERROR_1("bad weapon classname [%1]",_carryWeaponClassname);};
RHS CSW compatability (#7082) * Initial Commit * Got rid of unneeded translation values * Updated Strings * "Fixed" issue where when you deploy the tripid and weapon on slope it freaked out. * Fixed locality issues. Added timers to relavent functions. * Added weights to all magazines/tripod. Weights to weapons coming soon when I transfer them to the launcher slot * Fixed bug regarding localized strings. Created new tripod model * Added timers for deploying/picking up the tripod. Changed ammo-box model from custom to one already in ARMA. Changed gun-bag model for a more generic one. Created a texture for the tripod and gunbag * Removed ability to disassemble weapons via the addAction. Added ACE Action to get in due to a memory point issue. Changed from a static deploy/dismount time to one based in the weapon configs * Created forward-compatability. Made it so I can define a base plate for any weapon if I ever want to expand from the generic M3 Tripod. * Fixed bug where tripod wouldn't deploy with the correct times. Fixed bug where if you moved the tripod into the ground it would go flying. * Added mortar compatability. Will probably shift whole mortar ammo loading to CSW one day * Added icons to each relavent item * Added README, possibly fixed bug where if you are in a weapon others cant load/unload ammo. Changed distance you can interact with weapons * Added checks for when deploying the gun as well as unloading ammo to prevent duplication/deletion of items. * Added documentation * Added order to doc * Explained why things are the way they are * Remove temp files * Removed redundant files * Converted tabs->spaces. Added newlines at end of all files. Changed broken line in fnc_tripodDeploy.sqf. * 100% newlines at end of file * Added newlines to files that didnt get the change. Fixed README. Changed from GVAR(cswOptions) to GVAR(options). Changed from tabs to spaces in wiki * Fixed issue with UAV assembling with enableWeaponDisassembling. Fixed bug where game would crash if you disassembled static weapon with more than 1 magazine * Tabs->Spaces * Added CSW options to base StaticWeapon class to allow for easier additions. Switched default mortar away from CSW system due to incompatabilities * Lazy Evaluations and macros to describe how things work. * Added newlines to script_component. Fix no-texture issue on tripod. "Fix" 20mm HE saying 40mm HE. Add custom icons to all weapons. Move "Check Ammo" to CSW menu * abc * Revert "abc" This reverts commit bcb4214bd99bba3fec692efa4dca950323da582d. * Update to current commit * Revert changes to fortify.md * Updated UI Icon to Crew Served Ammo branch UI * Added Pabst's CrewServedAmmo to handle ammo loading/unloading instead of my solution * Fixed bug where currentWeaponTurret returned a blank string when a player hasent entered hte weapon to select the current weapon * Re-added ammo loading time * Tabs->Spaces * Newline at end of files * Removed replaced functions * Remove redundant strings. Move ammo handling to appropiate section * Tabs->Spaces * Update wiki * Updated to fix crash with default weapons and disable CSW ability on default static weapons * Added editor attributes to enable/disable CSW at edit time * Change how ammo is removed from the CSW. Uses math instead of iteration * Fix bug where assembled weapon did not get rid of default actions * Added support for multiple types of ammo in one CSW * Add tracer magazines for .50 cal * Fix bug where you could load ammo even if the gun couldnt take any more * Disable debug and enable compile cache * Changed weapon deploy/pickup time. Removed custom Titan missiles. Using ACE Dragging now. Added progress bar check for pickupTripod. Updated documentation * Removed check if CSW is full to unload ammo * Fix bug where items would spawn underneath other items on wepaon dismount * Change some things * Configure base statics, improve returnAmmo * Add mortar baseplate * Remove explicit inheritance * Fix bug where unloading ammo would duplicate it if you had room in your person. * Tab->Space * Player couldnt pickup tripod due to legacy code * Fix GMG_01_base_F inheritce * Port of ACE 2 tripod + ACE 2 CSW Bag * Move ACE 2 Data to APL folder * Adjust weights to make them more accurate to how ARMA uses it and the real life equivalents * Fix bug where error was thrown on esc from picking up tripod. Tripod rotated 180 * Fix bug where if you called ace_common_claim the weapon could be set to be disassembled even though it may not be wanted via CSW * Added ability to toggle ammo handling when weaponAssembly is disabled. * Add Proxy Weapons for all Vanilla static weapons. These serve as a way to allow for realistic ammo reload times without having to modify base classes if you want feautres turned off. Adjusted reload and mount times to be more "realistic" * Fix Shadow RPT Spam * Update wiki * Change order of setDir and setPos * Change all setDir/setPos orientations. Remove redundant check. Ensure that weapon locked state reflects it with the "getIn" command. Add a way to pass in a specific classname for the weapon assemble type. Add a callback function onDisassemble if user wants to set the state of the new tripod using the old weapon as a reference * Actually check for the carryWeaponClassname in the deployWeapon check * Ai Compatiblity * Add stringtable entries * Formatting fixes * Stringtables for settings, fix setMagazineTurretAmmo * inherit ammo for mags, reorder stringtable displays correct ammo and descriptionShort * don't require ace_javelin * Tweaks, cleanup, localzation, ace_reload changes change weapon tag to [CSW] tweak localization strings minor cleanup simplify some ace_reload funcs * delete moved dev func * Hopefully fix issue where to-be deleted tripod intersects with newly created weapon and vice versa. Remove PBOPREFIX newline * cleanup/proxyWeapon/mk6 compat * RHS compatability * Modified all tripod p3ds to have [0,0,0] at the mount. Ported AGS-30, Kord, M220, and SPG-9 tripods to APL And added them to CSW. Changed RHS compats to use new ported tripods. Changed strings to reflect real names. * Change from M224 Mortar Bag -> Mk6 Mortar bag * Add named propert (Autocenter) to make P3D [0,0,0] the center of the object instead of engine calculated * oh no tabs * remove some more evil tabs * fix changes lost in merge * fix bad merge pt2 * Fix UBC
2019-07-04 22:56:49 +00:00
// Turret classname can equal nothing if the deploy bag is the "whole" weapon. e.g Kornet, Metis, other ATGMs
if ((_turretClassname isNotEqualTo "") && {!isClass (configFile >> "CfgVehicles" >> _turretClassname)}) exitWith {ERROR_1("bad turret classname [%1]",_turretClassname);};
Adds Crew Served Static Weapons (#5652) * Initial Commit * Got rid of unneeded translation values * Updated Strings * "Fixed" issue where when you deploy the tripid and weapon on slope it freaked out. * Fixed locality issues. Added timers to relavent functions. * Added weights to all magazines/tripod. Weights to weapons coming soon when I transfer them to the launcher slot * Fixed bug regarding localized strings. Created new tripod model * Added timers for deploying/picking up the tripod. Changed ammo-box model from custom to one already in ARMA. Changed gun-bag model for a more generic one. Created a texture for the tripod and gunbag * Removed ability to disassemble weapons via the addAction. Added ACE Action to get in due to a memory point issue. Changed from a static deploy/dismount time to one based in the weapon configs * Created forward-compatability. Made it so I can define a base plate for any weapon if I ever want to expand from the generic M3 Tripod. * Fixed bug where tripod wouldn't deploy with the correct times. Fixed bug where if you moved the tripod into the ground it would go flying. * Added mortar compatability. Will probably shift whole mortar ammo loading to CSW one day * Added icons to each relavent item * Added README, possibly fixed bug where if you are in a weapon others cant load/unload ammo. Changed distance you can interact with weapons * Added checks for when deploying the gun as well as unloading ammo to prevent duplication/deletion of items. * Added documentation * Added order to doc * Explained why things are the way they are * Remove temp files * Removed redundant files * Converted tabs->spaces. Added newlines at end of all files. Changed broken line in fnc_tripodDeploy.sqf. * 100% newlines at end of file * Added newlines to files that didnt get the change. Fixed README. Changed from GVAR(cswOptions) to GVAR(options). Changed from tabs to spaces in wiki * Fixed issue with UAV assembling with enableWeaponDisassembling. Fixed bug where game would crash if you disassembled static weapon with more than 1 magazine * Tabs->Spaces * Added CSW options to base StaticWeapon class to allow for easier additions. Switched default mortar away from CSW system due to incompatabilities * Lazy Evaluations and macros to describe how things work. * Added newlines to script_component. Fix no-texture issue on tripod. "Fix" 20mm HE saying 40mm HE. Add custom icons to all weapons. Move "Check Ammo" to CSW menu * abc * Revert "abc" This reverts commit bcb4214bd99bba3fec692efa4dca950323da582d. * Update to current commit * Revert changes to fortify.md * Updated UI Icon to Crew Served Ammo branch UI * Added Pabst's CrewServedAmmo to handle ammo loading/unloading instead of my solution * Fixed bug where currentWeaponTurret returned a blank string when a player hasent entered hte weapon to select the current weapon * Re-added ammo loading time * Tabs->Spaces * Newline at end of files * Removed replaced functions * Remove redundant strings. Move ammo handling to appropiate section * Tabs->Spaces * Update wiki * Updated to fix crash with default weapons and disable CSW ability on default static weapons * Added editor attributes to enable/disable CSW at edit time * Change how ammo is removed from the CSW. Uses math instead of iteration * Fix bug where assembled weapon did not get rid of default actions * Added support for multiple types of ammo in one CSW * Add tracer magazines for .50 cal * Fix bug where you could load ammo even if the gun couldnt take any more * Disable debug and enable compile cache * Changed weapon deploy/pickup time. Removed custom Titan missiles. Using ACE Dragging now. Added progress bar check for pickupTripod. Updated documentation * Removed check if CSW is full to unload ammo * Fix bug where items would spawn underneath other items on wepaon dismount * Change some things * Configure base statics, improve returnAmmo * Add mortar baseplate * Remove explicit inheritance * Fix bug where unloading ammo would duplicate it if you had room in your person. * Tab->Space * Player couldnt pickup tripod due to legacy code * Fix GMG_01_base_F inheritce * Port of ACE 2 tripod + ACE 2 CSW Bag * Move ACE 2 Data to APL folder * Adjust weights to make them more accurate to how ARMA uses it and the real life equivalents * Fix bug where error was thrown on esc from picking up tripod. Tripod rotated 180 * Fix bug where if you called ace_common_claim the weapon could be set to be disassembled even though it may not be wanted via CSW * Added ability to toggle ammo handling when weaponAssembly is disabled. * Add Proxy Weapons for all Vanilla static weapons. These serve as a way to allow for realistic ammo reload times without having to modify base classes if you want feautres turned off. Adjusted reload and mount times to be more "realistic" * Fix Shadow RPT Spam * Update wiki * Change order of setDir and setPos * Change all setDir/setPos orientations. Remove redundant check. Ensure that weapon locked state reflects it with the "getIn" command. Add a way to pass in a specific classname for the weapon assemble type. Add a callback function onDisassemble if user wants to set the state of the new tripod using the old weapon as a reference * Actually check for the carryWeaponClassname in the deployWeapon check * Ai Compatiblity * Add stringtable entries * Formatting fixes * Stringtables for settings, fix setMagazineTurretAmmo * inherit ammo for mags, reorder stringtable displays correct ammo and descriptionShort * don't require ace_javelin * Tweaks, cleanup, localzation, ace_reload changes change weapon tag to [CSW] tweak localization strings minor cleanup simplify some ace_reload funcs * delete moved dev func * Hopefully fix issue where to-be deleted tripod intersects with newly created weapon and vice versa. Remove PBOPREFIX newline * cleanup/proxyWeapon/mk6 compat
2019-06-08 04:47:39 +00:00
private _onFinish = {
params ["_args"];
_args params ["_staticWeapon", "_player", "_carryWeaponClassname", "_turretClassname", "_onDisassembleFunc"];
TRACE_4("disassemble finish",_staticWeapon,_player,_carryWeaponClassname,_turretClassname);
private _weaponPos = getPosATL _staticWeapon;
_weaponPos set [2, (_weaponPos select 2) + 0.1];
private _weaponDir = getDir _staticWeapon;
private _carryWeaponMag = "";
private _carryWeaponMags = getArray (configFile >> "CfgWeapons" >> _carryWeaponClassname >> "magazines") apply {toLower _x};
Adds Crew Served Static Weapons (#5652) * Initial Commit * Got rid of unneeded translation values * Updated Strings * "Fixed" issue where when you deploy the tripid and weapon on slope it freaked out. * Fixed locality issues. Added timers to relavent functions. * Added weights to all magazines/tripod. Weights to weapons coming soon when I transfer them to the launcher slot * Fixed bug regarding localized strings. Created new tripod model * Added timers for deploying/picking up the tripod. Changed ammo-box model from custom to one already in ARMA. Changed gun-bag model for a more generic one. Created a texture for the tripod and gunbag * Removed ability to disassemble weapons via the addAction. Added ACE Action to get in due to a memory point issue. Changed from a static deploy/dismount time to one based in the weapon configs * Created forward-compatability. Made it so I can define a base plate for any weapon if I ever want to expand from the generic M3 Tripod. * Fixed bug where tripod wouldn't deploy with the correct times. Fixed bug where if you moved the tripod into the ground it would go flying. * Added mortar compatability. Will probably shift whole mortar ammo loading to CSW one day * Added icons to each relavent item * Added README, possibly fixed bug where if you are in a weapon others cant load/unload ammo. Changed distance you can interact with weapons * Added checks for when deploying the gun as well as unloading ammo to prevent duplication/deletion of items. * Added documentation * Added order to doc * Explained why things are the way they are * Remove temp files * Removed redundant files * Converted tabs->spaces. Added newlines at end of all files. Changed broken line in fnc_tripodDeploy.sqf. * 100% newlines at end of file * Added newlines to files that didnt get the change. Fixed README. Changed from GVAR(cswOptions) to GVAR(options). Changed from tabs to spaces in wiki * Fixed issue with UAV assembling with enableWeaponDisassembling. Fixed bug where game would crash if you disassembled static weapon with more than 1 magazine * Tabs->Spaces * Added CSW options to base StaticWeapon class to allow for easier additions. Switched default mortar away from CSW system due to incompatabilities * Lazy Evaluations and macros to describe how things work. * Added newlines to script_component. Fix no-texture issue on tripod. "Fix" 20mm HE saying 40mm HE. Add custom icons to all weapons. Move "Check Ammo" to CSW menu * abc * Revert "abc" This reverts commit bcb4214bd99bba3fec692efa4dca950323da582d. * Update to current commit * Revert changes to fortify.md * Updated UI Icon to Crew Served Ammo branch UI * Added Pabst's CrewServedAmmo to handle ammo loading/unloading instead of my solution * Fixed bug where currentWeaponTurret returned a blank string when a player hasent entered hte weapon to select the current weapon * Re-added ammo loading time * Tabs->Spaces * Newline at end of files * Removed replaced functions * Remove redundant strings. Move ammo handling to appropiate section * Tabs->Spaces * Update wiki * Updated to fix crash with default weapons and disable CSW ability on default static weapons * Added editor attributes to enable/disable CSW at edit time * Change how ammo is removed from the CSW. Uses math instead of iteration * Fix bug where assembled weapon did not get rid of default actions * Added support for multiple types of ammo in one CSW * Add tracer magazines for .50 cal * Fix bug where you could load ammo even if the gun couldnt take any more * Disable debug and enable compile cache * Changed weapon deploy/pickup time. Removed custom Titan missiles. Using ACE Dragging now. Added progress bar check for pickupTripod. Updated documentation * Removed check if CSW is full to unload ammo * Fix bug where items would spawn underneath other items on wepaon dismount * Change some things * Configure base statics, improve returnAmmo * Add mortar baseplate * Remove explicit inheritance * Fix bug where unloading ammo would duplicate it if you had room in your person. * Tab->Space * Player couldnt pickup tripod due to legacy code * Fix GMG_01_base_F inheritce * Port of ACE 2 tripod + ACE 2 CSW Bag * Move ACE 2 Data to APL folder * Adjust weights to make them more accurate to how ARMA uses it and the real life equivalents * Fix bug where error was thrown on esc from picking up tripod. Tripod rotated 180 * Fix bug where if you called ace_common_claim the weapon could be set to be disassembled even though it may not be wanted via CSW * Added ability to toggle ammo handling when weaponAssembly is disabled. * Add Proxy Weapons for all Vanilla static weapons. These serve as a way to allow for realistic ammo reload times without having to modify base classes if you want feautres turned off. Adjusted reload and mount times to be more "realistic" * Fix Shadow RPT Spam * Update wiki * Change order of setDir and setPos * Change all setDir/setPos orientations. Remove redundant check. Ensure that weapon locked state reflects it with the "getIn" command. Add a way to pass in a specific classname for the weapon assemble type. Add a callback function onDisassemble if user wants to set the state of the new tripod using the old weapon as a reference * Actually check for the carryWeaponClassname in the deployWeapon check * Ai Compatiblity * Add stringtable entries * Formatting fixes * Stringtables for settings, fix setMagazineTurretAmmo * inherit ammo for mags, reorder stringtable displays correct ammo and descriptionShort * don't require ace_javelin * Tweaks, cleanup, localzation, ace_reload changes change weapon tag to [CSW] tweak localization strings minor cleanup simplify some ace_reload funcs * delete moved dev func * Hopefully fix issue where to-be deleted tripod intersects with newly created weapon and vice versa. Remove PBOPREFIX newline * cleanup/proxyWeapon/mk6 compat
2019-06-08 04:47:39 +00:00
LOG("remove ammo");
{
_x params ["_xMag", "", "_xAmmo"];
if (_xAmmo == 0) then {continue};
Adds Crew Served Static Weapons (#5652) * Initial Commit * Got rid of unneeded translation values * Updated Strings * "Fixed" issue where when you deploy the tripid and weapon on slope it freaked out. * Fixed locality issues. Added timers to relavent functions. * Added weights to all magazines/tripod. Weights to weapons coming soon when I transfer them to the launcher slot * Fixed bug regarding localized strings. Created new tripod model * Added timers for deploying/picking up the tripod. Changed ammo-box model from custom to one already in ARMA. Changed gun-bag model for a more generic one. Created a texture for the tripod and gunbag * Removed ability to disassemble weapons via the addAction. Added ACE Action to get in due to a memory point issue. Changed from a static deploy/dismount time to one based in the weapon configs * Created forward-compatability. Made it so I can define a base plate for any weapon if I ever want to expand from the generic M3 Tripod. * Fixed bug where tripod wouldn't deploy with the correct times. Fixed bug where if you moved the tripod into the ground it would go flying. * Added mortar compatability. Will probably shift whole mortar ammo loading to CSW one day * Added icons to each relavent item * Added README, possibly fixed bug where if you are in a weapon others cant load/unload ammo. Changed distance you can interact with weapons * Added checks for when deploying the gun as well as unloading ammo to prevent duplication/deletion of items. * Added documentation * Added order to doc * Explained why things are the way they are * Remove temp files * Removed redundant files * Converted tabs->spaces. Added newlines at end of all files. Changed broken line in fnc_tripodDeploy.sqf. * 100% newlines at end of file * Added newlines to files that didnt get the change. Fixed README. Changed from GVAR(cswOptions) to GVAR(options). Changed from tabs to spaces in wiki * Fixed issue with UAV assembling with enableWeaponDisassembling. Fixed bug where game would crash if you disassembled static weapon with more than 1 magazine * Tabs->Spaces * Added CSW options to base StaticWeapon class to allow for easier additions. Switched default mortar away from CSW system due to incompatabilities * Lazy Evaluations and macros to describe how things work. * Added newlines to script_component. Fix no-texture issue on tripod. "Fix" 20mm HE saying 40mm HE. Add custom icons to all weapons. Move "Check Ammo" to CSW menu * abc * Revert "abc" This reverts commit bcb4214bd99bba3fec692efa4dca950323da582d. * Update to current commit * Revert changes to fortify.md * Updated UI Icon to Crew Served Ammo branch UI * Added Pabst's CrewServedAmmo to handle ammo loading/unloading instead of my solution * Fixed bug where currentWeaponTurret returned a blank string when a player hasent entered hte weapon to select the current weapon * Re-added ammo loading time * Tabs->Spaces * Newline at end of files * Removed replaced functions * Remove redundant strings. Move ammo handling to appropiate section * Tabs->Spaces * Update wiki * Updated to fix crash with default weapons and disable CSW ability on default static weapons * Added editor attributes to enable/disable CSW at edit time * Change how ammo is removed from the CSW. Uses math instead of iteration * Fix bug where assembled weapon did not get rid of default actions * Added support for multiple types of ammo in one CSW * Add tracer magazines for .50 cal * Fix bug where you could load ammo even if the gun couldnt take any more * Disable debug and enable compile cache * Changed weapon deploy/pickup time. Removed custom Titan missiles. Using ACE Dragging now. Added progress bar check for pickupTripod. Updated documentation * Removed check if CSW is full to unload ammo * Fix bug where items would spawn underneath other items on wepaon dismount * Change some things * Configure base statics, improve returnAmmo * Add mortar baseplate * Remove explicit inheritance * Fix bug where unloading ammo would duplicate it if you had room in your person. * Tab->Space * Player couldnt pickup tripod due to legacy code * Fix GMG_01_base_F inheritce * Port of ACE 2 tripod + ACE 2 CSW Bag * Move ACE 2 Data to APL folder * Adjust weights to make them more accurate to how ARMA uses it and the real life equivalents * Fix bug where error was thrown on esc from picking up tripod. Tripod rotated 180 * Fix bug where if you called ace_common_claim the weapon could be set to be disassembled even though it may not be wanted via CSW * Added ability to toggle ammo handling when weaponAssembly is disabled. * Add Proxy Weapons for all Vanilla static weapons. These serve as a way to allow for realistic ammo reload times without having to modify base classes if you want feautres turned off. Adjusted reload and mount times to be more "realistic" * Fix Shadow RPT Spam * Update wiki * Change order of setDir and setPos * Change all setDir/setPos orientations. Remove redundant check. Ensure that weapon locked state reflects it with the "getIn" command. Add a way to pass in a specific classname for the weapon assemble type. Add a callback function onDisassemble if user wants to set the state of the new tripod using the old weapon as a reference * Actually check for the carryWeaponClassname in the deployWeapon check * Ai Compatiblity * Add stringtable entries * Formatting fixes * Stringtables for settings, fix setMagazineTurretAmmo * inherit ammo for mags, reorder stringtable displays correct ammo and descriptionShort * don't require ace_javelin * Tweaks, cleanup, localzation, ace_reload changes change weapon tag to [CSW] tweak localization strings minor cleanup simplify some ace_reload funcs * delete moved dev func * Hopefully fix issue where to-be deleted tripod intersects with newly created weapon and vice versa. Remove PBOPREFIX newline * cleanup/proxyWeapon/mk6 compat
2019-06-08 04:47:39 +00:00
private _carryMag = _xMag call FUNC(getCarryMagazine);
if (_carryWeaponMag isEqualTo "" && {toLower _carryMag in _carryWeaponMags}) then {
TRACE_3("Adding mag to secondary weapon",_xMag,_xAmmo,_carryMag);
_carryWeaponMag = _carryMag;
DEC(_xAmmo);
};
Adds Crew Served Static Weapons (#5652) * Initial Commit * Got rid of unneeded translation values * Updated Strings * "Fixed" issue where when you deploy the tripid and weapon on slope it freaked out. * Fixed locality issues. Added timers to relavent functions. * Added weights to all magazines/tripod. Weights to weapons coming soon when I transfer them to the launcher slot * Fixed bug regarding localized strings. Created new tripod model * Added timers for deploying/picking up the tripod. Changed ammo-box model from custom to one already in ARMA. Changed gun-bag model for a more generic one. Created a texture for the tripod and gunbag * Removed ability to disassemble weapons via the addAction. Added ACE Action to get in due to a memory point issue. Changed from a static deploy/dismount time to one based in the weapon configs * Created forward-compatability. Made it so I can define a base plate for any weapon if I ever want to expand from the generic M3 Tripod. * Fixed bug where tripod wouldn't deploy with the correct times. Fixed bug where if you moved the tripod into the ground it would go flying. * Added mortar compatability. Will probably shift whole mortar ammo loading to CSW one day * Added icons to each relavent item * Added README, possibly fixed bug where if you are in a weapon others cant load/unload ammo. Changed distance you can interact with weapons * Added checks for when deploying the gun as well as unloading ammo to prevent duplication/deletion of items. * Added documentation * Added order to doc * Explained why things are the way they are * Remove temp files * Removed redundant files * Converted tabs->spaces. Added newlines at end of all files. Changed broken line in fnc_tripodDeploy.sqf. * 100% newlines at end of file * Added newlines to files that didnt get the change. Fixed README. Changed from GVAR(cswOptions) to GVAR(options). Changed from tabs to spaces in wiki * Fixed issue with UAV assembling with enableWeaponDisassembling. Fixed bug where game would crash if you disassembled static weapon with more than 1 magazine * Tabs->Spaces * Added CSW options to base StaticWeapon class to allow for easier additions. Switched default mortar away from CSW system due to incompatabilities * Lazy Evaluations and macros to describe how things work. * Added newlines to script_component. Fix no-texture issue on tripod. "Fix" 20mm HE saying 40mm HE. Add custom icons to all weapons. Move "Check Ammo" to CSW menu * abc * Revert "abc" This reverts commit bcb4214bd99bba3fec692efa4dca950323da582d. * Update to current commit * Revert changes to fortify.md * Updated UI Icon to Crew Served Ammo branch UI * Added Pabst's CrewServedAmmo to handle ammo loading/unloading instead of my solution * Fixed bug where currentWeaponTurret returned a blank string when a player hasent entered hte weapon to select the current weapon * Re-added ammo loading time * Tabs->Spaces * Newline at end of files * Removed replaced functions * Remove redundant strings. Move ammo handling to appropiate section * Tabs->Spaces * Update wiki * Updated to fix crash with default weapons and disable CSW ability on default static weapons * Added editor attributes to enable/disable CSW at edit time * Change how ammo is removed from the CSW. Uses math instead of iteration * Fix bug where assembled weapon did not get rid of default actions * Added support for multiple types of ammo in one CSW * Add tracer magazines for .50 cal * Fix bug where you could load ammo even if the gun couldnt take any more * Disable debug and enable compile cache * Changed weapon deploy/pickup time. Removed custom Titan missiles. Using ACE Dragging now. Added progress bar check for pickupTripod. Updated documentation * Removed check if CSW is full to unload ammo * Fix bug where items would spawn underneath other items on wepaon dismount * Change some things * Configure base statics, improve returnAmmo * Add mortar baseplate * Remove explicit inheritance * Fix bug where unloading ammo would duplicate it if you had room in your person. * Tab->Space * Player couldnt pickup tripod due to legacy code * Fix GMG_01_base_F inheritce * Port of ACE 2 tripod + ACE 2 CSW Bag * Move ACE 2 Data to APL folder * Adjust weights to make them more accurate to how ARMA uses it and the real life equivalents * Fix bug where error was thrown on esc from picking up tripod. Tripod rotated 180 * Fix bug where if you called ace_common_claim the weapon could be set to be disassembled even though it may not be wanted via CSW * Added ability to toggle ammo handling when weaponAssembly is disabled. * Add Proxy Weapons for all Vanilla static weapons. These serve as a way to allow for realistic ammo reload times without having to modify base classes if you want feautres turned off. Adjusted reload and mount times to be more "realistic" * Fix Shadow RPT Spam * Update wiki * Change order of setDir and setPos * Change all setDir/setPos orientations. Remove redundant check. Ensure that weapon locked state reflects it with the "getIn" command. Add a way to pass in a specific classname for the weapon assemble type. Add a callback function onDisassemble if user wants to set the state of the new tripod using the old weapon as a reference * Actually check for the carryWeaponClassname in the deployWeapon check * Ai Compatiblity * Add stringtable entries * Formatting fixes * Stringtables for settings, fix setMagazineTurretAmmo * inherit ammo for mags, reorder stringtable displays correct ammo and descriptionShort * don't require ace_javelin * Tweaks, cleanup, localzation, ace_reload changes change weapon tag to [CSW] tweak localization strings minor cleanup simplify some ace_reload funcs * delete moved dev func * Hopefully fix issue where to-be deleted tripod intersects with newly created weapon and vice versa. Remove PBOPREFIX newline * cleanup/proxyWeapon/mk6 compat
2019-06-08 04:47:39 +00:00
if ((_xAmmo > 0) && {_carryMag != ""}) then {
TRACE_2("Removing ammo",_xMag,_carryMag);
[_player, _carryMag, _xAmmo] call FUNC(reload_handleReturnAmmo);
};
} forEach (magazinesAllTurrets _staticWeapon);
if (_turretClassname isNotEqualTo "") then {
RHS CSW compatability (#7082) * Initial Commit * Got rid of unneeded translation values * Updated Strings * "Fixed" issue where when you deploy the tripid and weapon on slope it freaked out. * Fixed locality issues. Added timers to relavent functions. * Added weights to all magazines/tripod. Weights to weapons coming soon when I transfer them to the launcher slot * Fixed bug regarding localized strings. Created new tripod model * Added timers for deploying/picking up the tripod. Changed ammo-box model from custom to one already in ARMA. Changed gun-bag model for a more generic one. Created a texture for the tripod and gunbag * Removed ability to disassemble weapons via the addAction. Added ACE Action to get in due to a memory point issue. Changed from a static deploy/dismount time to one based in the weapon configs * Created forward-compatability. Made it so I can define a base plate for any weapon if I ever want to expand from the generic M3 Tripod. * Fixed bug where tripod wouldn't deploy with the correct times. Fixed bug where if you moved the tripod into the ground it would go flying. * Added mortar compatability. Will probably shift whole mortar ammo loading to CSW one day * Added icons to each relavent item * Added README, possibly fixed bug where if you are in a weapon others cant load/unload ammo. Changed distance you can interact with weapons * Added checks for when deploying the gun as well as unloading ammo to prevent duplication/deletion of items. * Added documentation * Added order to doc * Explained why things are the way they are * Remove temp files * Removed redundant files * Converted tabs->spaces. Added newlines at end of all files. Changed broken line in fnc_tripodDeploy.sqf. * 100% newlines at end of file * Added newlines to files that didnt get the change. Fixed README. Changed from GVAR(cswOptions) to GVAR(options). Changed from tabs to spaces in wiki * Fixed issue with UAV assembling with enableWeaponDisassembling. Fixed bug where game would crash if you disassembled static weapon with more than 1 magazine * Tabs->Spaces * Added CSW options to base StaticWeapon class to allow for easier additions. Switched default mortar away from CSW system due to incompatabilities * Lazy Evaluations and macros to describe how things work. * Added newlines to script_component. Fix no-texture issue on tripod. "Fix" 20mm HE saying 40mm HE. Add custom icons to all weapons. Move "Check Ammo" to CSW menu * abc * Revert "abc" This reverts commit bcb4214bd99bba3fec692efa4dca950323da582d. * Update to current commit * Revert changes to fortify.md * Updated UI Icon to Crew Served Ammo branch UI * Added Pabst's CrewServedAmmo to handle ammo loading/unloading instead of my solution * Fixed bug where currentWeaponTurret returned a blank string when a player hasent entered hte weapon to select the current weapon * Re-added ammo loading time * Tabs->Spaces * Newline at end of files * Removed replaced functions * Remove redundant strings. Move ammo handling to appropiate section * Tabs->Spaces * Update wiki * Updated to fix crash with default weapons and disable CSW ability on default static weapons * Added editor attributes to enable/disable CSW at edit time * Change how ammo is removed from the CSW. Uses math instead of iteration * Fix bug where assembled weapon did not get rid of default actions * Added support for multiple types of ammo in one CSW * Add tracer magazines for .50 cal * Fix bug where you could load ammo even if the gun couldnt take any more * Disable debug and enable compile cache * Changed weapon deploy/pickup time. Removed custom Titan missiles. Using ACE Dragging now. Added progress bar check for pickupTripod. Updated documentation * Removed check if CSW is full to unload ammo * Fix bug where items would spawn underneath other items on wepaon dismount * Change some things * Configure base statics, improve returnAmmo * Add mortar baseplate * Remove explicit inheritance * Fix bug where unloading ammo would duplicate it if you had room in your person. * Tab->Space * Player couldnt pickup tripod due to legacy code * Fix GMG_01_base_F inheritce * Port of ACE 2 tripod + ACE 2 CSW Bag * Move ACE 2 Data to APL folder * Adjust weights to make them more accurate to how ARMA uses it and the real life equivalents * Fix bug where error was thrown on esc from picking up tripod. Tripod rotated 180 * Fix bug where if you called ace_common_claim the weapon could be set to be disassembled even though it may not be wanted via CSW * Added ability to toggle ammo handling when weaponAssembly is disabled. * Add Proxy Weapons for all Vanilla static weapons. These serve as a way to allow for realistic ammo reload times without having to modify base classes if you want feautres turned off. Adjusted reload and mount times to be more "realistic" * Fix Shadow RPT Spam * Update wiki * Change order of setDir and setPos * Change all setDir/setPos orientations. Remove redundant check. Ensure that weapon locked state reflects it with the "getIn" command. Add a way to pass in a specific classname for the weapon assemble type. Add a callback function onDisassemble if user wants to set the state of the new tripod using the old weapon as a reference * Actually check for the carryWeaponClassname in the deployWeapon check * Ai Compatiblity * Add stringtable entries * Formatting fixes * Stringtables for settings, fix setMagazineTurretAmmo * inherit ammo for mags, reorder stringtable displays correct ammo and descriptionShort * don't require ace_javelin * Tweaks, cleanup, localzation, ace_reload changes change weapon tag to [CSW] tweak localization strings minor cleanup simplify some ace_reload funcs * delete moved dev func * Hopefully fix issue where to-be deleted tripod intersects with newly created weapon and vice versa. Remove PBOPREFIX newline * cleanup/proxyWeapon/mk6 compat * RHS compatability * Modified all tripod p3ds to have [0,0,0] at the mount. Ported AGS-30, Kord, M220, and SPG-9 tripods to APL And added them to CSW. Changed RHS compats to use new ported tripods. Changed strings to reflect real names. * Change from M224 Mortar Bag -> Mk6 Mortar bag * Add named propert (Autocenter) to make P3D [0,0,0] the center of the object instead of engine calculated * oh no tabs * remove some more evil tabs * fix changes lost in merge * fix bad merge pt2 * Fix UBC
2019-07-04 22:56:49 +00:00
private _cswTripod = createVehicle [_turretClassname, [0, 0, 0], [], 0, "NONE"];
// Delay a frame so weapon has a chance to be deleted
[{
params ["_cswTripod", "_weaponDir", "_weaponPos"];
_cswTripod setDir _weaponDir;
_cswTripod setPosATL _weaponPos;
_cswTripod setVelocity [0, 0, -0.05];
_cswTripod setVectorUp (surfaceNormal _weaponPos);
}, [_cswTripod, _weaponDir, _weaponPos]] call CBA_fnc_execNextFrame;
[_cswTripod, _staticWeapon] call (missionNamespace getVariable _onDisassembleFunc);
};
Adds Crew Served Static Weapons (#5652) * Initial Commit * Got rid of unneeded translation values * Updated Strings * "Fixed" issue where when you deploy the tripid and weapon on slope it freaked out. * Fixed locality issues. Added timers to relavent functions. * Added weights to all magazines/tripod. Weights to weapons coming soon when I transfer them to the launcher slot * Fixed bug regarding localized strings. Created new tripod model * Added timers for deploying/picking up the tripod. Changed ammo-box model from custom to one already in ARMA. Changed gun-bag model for a more generic one. Created a texture for the tripod and gunbag * Removed ability to disassemble weapons via the addAction. Added ACE Action to get in due to a memory point issue. Changed from a static deploy/dismount time to one based in the weapon configs * Created forward-compatability. Made it so I can define a base plate for any weapon if I ever want to expand from the generic M3 Tripod. * Fixed bug where tripod wouldn't deploy with the correct times. Fixed bug where if you moved the tripod into the ground it would go flying. * Added mortar compatability. Will probably shift whole mortar ammo loading to CSW one day * Added icons to each relavent item * Added README, possibly fixed bug where if you are in a weapon others cant load/unload ammo. Changed distance you can interact with weapons * Added checks for when deploying the gun as well as unloading ammo to prevent duplication/deletion of items. * Added documentation * Added order to doc * Explained why things are the way they are * Remove temp files * Removed redundant files * Converted tabs->spaces. Added newlines at end of all files. Changed broken line in fnc_tripodDeploy.sqf. * 100% newlines at end of file * Added newlines to files that didnt get the change. Fixed README. Changed from GVAR(cswOptions) to GVAR(options). Changed from tabs to spaces in wiki * Fixed issue with UAV assembling with enableWeaponDisassembling. Fixed bug where game would crash if you disassembled static weapon with more than 1 magazine * Tabs->Spaces * Added CSW options to base StaticWeapon class to allow for easier additions. Switched default mortar away from CSW system due to incompatabilities * Lazy Evaluations and macros to describe how things work. * Added newlines to script_component. Fix no-texture issue on tripod. "Fix" 20mm HE saying 40mm HE. Add custom icons to all weapons. Move "Check Ammo" to CSW menu * abc * Revert "abc" This reverts commit bcb4214bd99bba3fec692efa4dca950323da582d. * Update to current commit * Revert changes to fortify.md * Updated UI Icon to Crew Served Ammo branch UI * Added Pabst's CrewServedAmmo to handle ammo loading/unloading instead of my solution * Fixed bug where currentWeaponTurret returned a blank string when a player hasent entered hte weapon to select the current weapon * Re-added ammo loading time * Tabs->Spaces * Newline at end of files * Removed replaced functions * Remove redundant strings. Move ammo handling to appropiate section * Tabs->Spaces * Update wiki * Updated to fix crash with default weapons and disable CSW ability on default static weapons * Added editor attributes to enable/disable CSW at edit time * Change how ammo is removed from the CSW. Uses math instead of iteration * Fix bug where assembled weapon did not get rid of default actions * Added support for multiple types of ammo in one CSW * Add tracer magazines for .50 cal * Fix bug where you could load ammo even if the gun couldnt take any more * Disable debug and enable compile cache * Changed weapon deploy/pickup time. Removed custom Titan missiles. Using ACE Dragging now. Added progress bar check for pickupTripod. Updated documentation * Removed check if CSW is full to unload ammo * Fix bug where items would spawn underneath other items on wepaon dismount * Change some things * Configure base statics, improve returnAmmo * Add mortar baseplate * Remove explicit inheritance * Fix bug where unloading ammo would duplicate it if you had room in your person. * Tab->Space * Player couldnt pickup tripod due to legacy code * Fix GMG_01_base_F inheritce * Port of ACE 2 tripod + ACE 2 CSW Bag * Move ACE 2 Data to APL folder * Adjust weights to make them more accurate to how ARMA uses it and the real life equivalents * Fix bug where error was thrown on esc from picking up tripod. Tripod rotated 180 * Fix bug where if you called ace_common_claim the weapon could be set to be disassembled even though it may not be wanted via CSW * Added ability to toggle ammo handling when weaponAssembly is disabled. * Add Proxy Weapons for all Vanilla static weapons. These serve as a way to allow for realistic ammo reload times without having to modify base classes if you want feautres turned off. Adjusted reload and mount times to be more "realistic" * Fix Shadow RPT Spam * Update wiki * Change order of setDir and setPos * Change all setDir/setPos orientations. Remove redundant check. Ensure that weapon locked state reflects it with the "getIn" command. Add a way to pass in a specific classname for the weapon assemble type. Add a callback function onDisassemble if user wants to set the state of the new tripod using the old weapon as a reference * Actually check for the carryWeaponClassname in the deployWeapon check * Ai Compatiblity * Add stringtable entries * Formatting fixes * Stringtables for settings, fix setMagazineTurretAmmo * inherit ammo for mags, reorder stringtable displays correct ammo and descriptionShort * don't require ace_javelin * Tweaks, cleanup, localzation, ace_reload changes change weapon tag to [CSW] tweak localization strings minor cleanup simplify some ace_reload funcs * delete moved dev func * Hopefully fix issue where to-be deleted tripod intersects with newly created weapon and vice versa. Remove PBOPREFIX newline * cleanup/proxyWeapon/mk6 compat
2019-06-08 04:47:39 +00:00
[{
params ["_player", "_weaponPos", "_carryWeaponClassname", "_carryWeaponMag"];
Adds Crew Served Static Weapons (#5652) * Initial Commit * Got rid of unneeded translation values * Updated Strings * "Fixed" issue where when you deploy the tripid and weapon on slope it freaked out. * Fixed locality issues. Added timers to relavent functions. * Added weights to all magazines/tripod. Weights to weapons coming soon when I transfer them to the launcher slot * Fixed bug regarding localized strings. Created new tripod model * Added timers for deploying/picking up the tripod. Changed ammo-box model from custom to one already in ARMA. Changed gun-bag model for a more generic one. Created a texture for the tripod and gunbag * Removed ability to disassemble weapons via the addAction. Added ACE Action to get in due to a memory point issue. Changed from a static deploy/dismount time to one based in the weapon configs * Created forward-compatability. Made it so I can define a base plate for any weapon if I ever want to expand from the generic M3 Tripod. * Fixed bug where tripod wouldn't deploy with the correct times. Fixed bug where if you moved the tripod into the ground it would go flying. * Added mortar compatability. Will probably shift whole mortar ammo loading to CSW one day * Added icons to each relavent item * Added README, possibly fixed bug where if you are in a weapon others cant load/unload ammo. Changed distance you can interact with weapons * Added checks for when deploying the gun as well as unloading ammo to prevent duplication/deletion of items. * Added documentation * Added order to doc * Explained why things are the way they are * Remove temp files * Removed redundant files * Converted tabs->spaces. Added newlines at end of all files. Changed broken line in fnc_tripodDeploy.sqf. * 100% newlines at end of file * Added newlines to files that didnt get the change. Fixed README. Changed from GVAR(cswOptions) to GVAR(options). Changed from tabs to spaces in wiki * Fixed issue with UAV assembling with enableWeaponDisassembling. Fixed bug where game would crash if you disassembled static weapon with more than 1 magazine * Tabs->Spaces * Added CSW options to base StaticWeapon class to allow for easier additions. Switched default mortar away from CSW system due to incompatabilities * Lazy Evaluations and macros to describe how things work. * Added newlines to script_component. Fix no-texture issue on tripod. "Fix" 20mm HE saying 40mm HE. Add custom icons to all weapons. Move "Check Ammo" to CSW menu * abc * Revert "abc" This reverts commit bcb4214bd99bba3fec692efa4dca950323da582d. * Update to current commit * Revert changes to fortify.md * Updated UI Icon to Crew Served Ammo branch UI * Added Pabst's CrewServedAmmo to handle ammo loading/unloading instead of my solution * Fixed bug where currentWeaponTurret returned a blank string when a player hasent entered hte weapon to select the current weapon * Re-added ammo loading time * Tabs->Spaces * Newline at end of files * Removed replaced functions * Remove redundant strings. Move ammo handling to appropiate section * Tabs->Spaces * Update wiki * Updated to fix crash with default weapons and disable CSW ability on default static weapons * Added editor attributes to enable/disable CSW at edit time * Change how ammo is removed from the CSW. Uses math instead of iteration * Fix bug where assembled weapon did not get rid of default actions * Added support for multiple types of ammo in one CSW * Add tracer magazines for .50 cal * Fix bug where you could load ammo even if the gun couldnt take any more * Disable debug and enable compile cache * Changed weapon deploy/pickup time. Removed custom Titan missiles. Using ACE Dragging now. Added progress bar check for pickupTripod. Updated documentation * Removed check if CSW is full to unload ammo * Fix bug where items would spawn underneath other items on wepaon dismount * Change some things * Configure base statics, improve returnAmmo * Add mortar baseplate * Remove explicit inheritance * Fix bug where unloading ammo would duplicate it if you had room in your person. * Tab->Space * Player couldnt pickup tripod due to legacy code * Fix GMG_01_base_F inheritce * Port of ACE 2 tripod + ACE 2 CSW Bag * Move ACE 2 Data to APL folder * Adjust weights to make them more accurate to how ARMA uses it and the real life equivalents * Fix bug where error was thrown on esc from picking up tripod. Tripod rotated 180 * Fix bug where if you called ace_common_claim the weapon could be set to be disassembled even though it may not be wanted via CSW * Added ability to toggle ammo handling when weaponAssembly is disabled. * Add Proxy Weapons for all Vanilla static weapons. These serve as a way to allow for realistic ammo reload times without having to modify base classes if you want feautres turned off. Adjusted reload and mount times to be more "realistic" * Fix Shadow RPT Spam * Update wiki * Change order of setDir and setPos * Change all setDir/setPos orientations. Remove redundant check. Ensure that weapon locked state reflects it with the "getIn" command. Add a way to pass in a specific classname for the weapon assemble type. Add a callback function onDisassemble if user wants to set the state of the new tripod using the old weapon as a reference * Actually check for the carryWeaponClassname in the deployWeapon check * Ai Compatiblity * Add stringtable entries * Formatting fixes * Stringtables for settings, fix setMagazineTurretAmmo * inherit ammo for mags, reorder stringtable displays correct ammo and descriptionShort * don't require ace_javelin * Tweaks, cleanup, localzation, ace_reload changes change weapon tag to [CSW] tweak localization strings minor cleanup simplify some ace_reload funcs * delete moved dev func * Hopefully fix issue where to-be deleted tripod intersects with newly created weapon and vice versa. Remove PBOPREFIX newline * cleanup/proxyWeapon/mk6 compat
2019-06-08 04:47:39 +00:00
if ((alive _player) && {(secondaryWeapon _player) == ""}) exitWith {
_player addWeapon _carryWeaponClassname;
if (_carryWeaponMag isNotEqualTo "") then {
_player addWeaponItem [_carryWeaponClassname, _carryWeaponMag, true];
};
Adds Crew Served Static Weapons (#5652) * Initial Commit * Got rid of unneeded translation values * Updated Strings * "Fixed" issue where when you deploy the tripid and weapon on slope it freaked out. * Fixed locality issues. Added timers to relavent functions. * Added weights to all magazines/tripod. Weights to weapons coming soon when I transfer them to the launcher slot * Fixed bug regarding localized strings. Created new tripod model * Added timers for deploying/picking up the tripod. Changed ammo-box model from custom to one already in ARMA. Changed gun-bag model for a more generic one. Created a texture for the tripod and gunbag * Removed ability to disassemble weapons via the addAction. Added ACE Action to get in due to a memory point issue. Changed from a static deploy/dismount time to one based in the weapon configs * Created forward-compatability. Made it so I can define a base plate for any weapon if I ever want to expand from the generic M3 Tripod. * Fixed bug where tripod wouldn't deploy with the correct times. Fixed bug where if you moved the tripod into the ground it would go flying. * Added mortar compatability. Will probably shift whole mortar ammo loading to CSW one day * Added icons to each relavent item * Added README, possibly fixed bug where if you are in a weapon others cant load/unload ammo. Changed distance you can interact with weapons * Added checks for when deploying the gun as well as unloading ammo to prevent duplication/deletion of items. * Added documentation * Added order to doc * Explained why things are the way they are * Remove temp files * Removed redundant files * Converted tabs->spaces. Added newlines at end of all files. Changed broken line in fnc_tripodDeploy.sqf. * 100% newlines at end of file * Added newlines to files that didnt get the change. Fixed README. Changed from GVAR(cswOptions) to GVAR(options). Changed from tabs to spaces in wiki * Fixed issue with UAV assembling with enableWeaponDisassembling. Fixed bug where game would crash if you disassembled static weapon with more than 1 magazine * Tabs->Spaces * Added CSW options to base StaticWeapon class to allow for easier additions. Switched default mortar away from CSW system due to incompatabilities * Lazy Evaluations and macros to describe how things work. * Added newlines to script_component. Fix no-texture issue on tripod. "Fix" 20mm HE saying 40mm HE. Add custom icons to all weapons. Move "Check Ammo" to CSW menu * abc * Revert "abc" This reverts commit bcb4214bd99bba3fec692efa4dca950323da582d. * Update to current commit * Revert changes to fortify.md * Updated UI Icon to Crew Served Ammo branch UI * Added Pabst's CrewServedAmmo to handle ammo loading/unloading instead of my solution * Fixed bug where currentWeaponTurret returned a blank string when a player hasent entered hte weapon to select the current weapon * Re-added ammo loading time * Tabs->Spaces * Newline at end of files * Removed replaced functions * Remove redundant strings. Move ammo handling to appropiate section * Tabs->Spaces * Update wiki * Updated to fix crash with default weapons and disable CSW ability on default static weapons * Added editor attributes to enable/disable CSW at edit time * Change how ammo is removed from the CSW. Uses math instead of iteration * Fix bug where assembled weapon did not get rid of default actions * Added support for multiple types of ammo in one CSW * Add tracer magazines for .50 cal * Fix bug where you could load ammo even if the gun couldnt take any more * Disable debug and enable compile cache * Changed weapon deploy/pickup time. Removed custom Titan missiles. Using ACE Dragging now. Added progress bar check for pickupTripod. Updated documentation * Removed check if CSW is full to unload ammo * Fix bug where items would spawn underneath other items on wepaon dismount * Change some things * Configure base statics, improve returnAmmo * Add mortar baseplate * Remove explicit inheritance * Fix bug where unloading ammo would duplicate it if you had room in your person. * Tab->Space * Player couldnt pickup tripod due to legacy code * Fix GMG_01_base_F inheritce * Port of ACE 2 tripod + ACE 2 CSW Bag * Move ACE 2 Data to APL folder * Adjust weights to make them more accurate to how ARMA uses it and the real life equivalents * Fix bug where error was thrown on esc from picking up tripod. Tripod rotated 180 * Fix bug where if you called ace_common_claim the weapon could be set to be disassembled even though it may not be wanted via CSW * Added ability to toggle ammo handling when weaponAssembly is disabled. * Add Proxy Weapons for all Vanilla static weapons. These serve as a way to allow for realistic ammo reload times without having to modify base classes if you want feautres turned off. Adjusted reload and mount times to be more "realistic" * Fix Shadow RPT Spam * Update wiki * Change order of setDir and setPos * Change all setDir/setPos orientations. Remove redundant check. Ensure that weapon locked state reflects it with the "getIn" command. Add a way to pass in a specific classname for the weapon assemble type. Add a callback function onDisassemble if user wants to set the state of the new tripod using the old weapon as a reference * Actually check for the carryWeaponClassname in the deployWeapon check * Ai Compatiblity * Add stringtable entries * Formatting fixes * Stringtables for settings, fix setMagazineTurretAmmo * inherit ammo for mags, reorder stringtable displays correct ammo and descriptionShort * don't require ace_javelin * Tweaks, cleanup, localzation, ace_reload changes change weapon tag to [CSW] tweak localization strings minor cleanup simplify some ace_reload funcs * delete moved dev func * Hopefully fix issue where to-be deleted tripod intersects with newly created weapon and vice versa. Remove PBOPREFIX newline * cleanup/proxyWeapon/mk6 compat
2019-06-08 04:47:39 +00:00
};
RHS CSW compatability (#7082) * Initial Commit * Got rid of unneeded translation values * Updated Strings * "Fixed" issue where when you deploy the tripid and weapon on slope it freaked out. * Fixed locality issues. Added timers to relavent functions. * Added weights to all magazines/tripod. Weights to weapons coming soon when I transfer them to the launcher slot * Fixed bug regarding localized strings. Created new tripod model * Added timers for deploying/picking up the tripod. Changed ammo-box model from custom to one already in ARMA. Changed gun-bag model for a more generic one. Created a texture for the tripod and gunbag * Removed ability to disassemble weapons via the addAction. Added ACE Action to get in due to a memory point issue. Changed from a static deploy/dismount time to one based in the weapon configs * Created forward-compatability. Made it so I can define a base plate for any weapon if I ever want to expand from the generic M3 Tripod. * Fixed bug where tripod wouldn't deploy with the correct times. Fixed bug where if you moved the tripod into the ground it would go flying. * Added mortar compatability. Will probably shift whole mortar ammo loading to CSW one day * Added icons to each relavent item * Added README, possibly fixed bug where if you are in a weapon others cant load/unload ammo. Changed distance you can interact with weapons * Added checks for when deploying the gun as well as unloading ammo to prevent duplication/deletion of items. * Added documentation * Added order to doc * Explained why things are the way they are * Remove temp files * Removed redundant files * Converted tabs->spaces. Added newlines at end of all files. Changed broken line in fnc_tripodDeploy.sqf. * 100% newlines at end of file * Added newlines to files that didnt get the change. Fixed README. Changed from GVAR(cswOptions) to GVAR(options). Changed from tabs to spaces in wiki * Fixed issue with UAV assembling with enableWeaponDisassembling. Fixed bug where game would crash if you disassembled static weapon with more than 1 magazine * Tabs->Spaces * Added CSW options to base StaticWeapon class to allow for easier additions. Switched default mortar away from CSW system due to incompatabilities * Lazy Evaluations and macros to describe how things work. * Added newlines to script_component. Fix no-texture issue on tripod. "Fix" 20mm HE saying 40mm HE. Add custom icons to all weapons. Move "Check Ammo" to CSW menu * abc * Revert "abc" This reverts commit bcb4214bd99bba3fec692efa4dca950323da582d. * Update to current commit * Revert changes to fortify.md * Updated UI Icon to Crew Served Ammo branch UI * Added Pabst's CrewServedAmmo to handle ammo loading/unloading instead of my solution * Fixed bug where currentWeaponTurret returned a blank string when a player hasent entered hte weapon to select the current weapon * Re-added ammo loading time * Tabs->Spaces * Newline at end of files * Removed replaced functions * Remove redundant strings. Move ammo handling to appropiate section * Tabs->Spaces * Update wiki * Updated to fix crash with default weapons and disable CSW ability on default static weapons * Added editor attributes to enable/disable CSW at edit time * Change how ammo is removed from the CSW. Uses math instead of iteration * Fix bug where assembled weapon did not get rid of default actions * Added support for multiple types of ammo in one CSW * Add tracer magazines for .50 cal * Fix bug where you could load ammo even if the gun couldnt take any more * Disable debug and enable compile cache * Changed weapon deploy/pickup time. Removed custom Titan missiles. Using ACE Dragging now. Added progress bar check for pickupTripod. Updated documentation * Removed check if CSW is full to unload ammo * Fix bug where items would spawn underneath other items on wepaon dismount * Change some things * Configure base statics, improve returnAmmo * Add mortar baseplate * Remove explicit inheritance * Fix bug where unloading ammo would duplicate it if you had room in your person. * Tab->Space * Player couldnt pickup tripod due to legacy code * Fix GMG_01_base_F inheritce * Port of ACE 2 tripod + ACE 2 CSW Bag * Move ACE 2 Data to APL folder * Adjust weights to make them more accurate to how ARMA uses it and the real life equivalents * Fix bug where error was thrown on esc from picking up tripod. Tripod rotated 180 * Fix bug where if you called ace_common_claim the weapon could be set to be disassembled even though it may not be wanted via CSW * Added ability to toggle ammo handling when weaponAssembly is disabled. * Add Proxy Weapons for all Vanilla static weapons. These serve as a way to allow for realistic ammo reload times without having to modify base classes if you want feautres turned off. Adjusted reload and mount times to be more "realistic" * Fix Shadow RPT Spam * Update wiki * Change order of setDir and setPos * Change all setDir/setPos orientations. Remove redundant check. Ensure that weapon locked state reflects it with the "getIn" command. Add a way to pass in a specific classname for the weapon assemble type. Add a callback function onDisassemble if user wants to set the state of the new tripod using the old weapon as a reference * Actually check for the carryWeaponClassname in the deployWeapon check * Ai Compatiblity * Add stringtable entries * Formatting fixes * Stringtables for settings, fix setMagazineTurretAmmo * inherit ammo for mags, reorder stringtable displays correct ammo and descriptionShort * don't require ace_javelin * Tweaks, cleanup, localzation, ace_reload changes change weapon tag to [CSW] tweak localization strings minor cleanup simplify some ace_reload funcs * delete moved dev func * Hopefully fix issue where to-be deleted tripod intersects with newly created weapon and vice versa. Remove PBOPREFIX newline * cleanup/proxyWeapon/mk6 compat * RHS compatability * Modified all tripod p3ds to have [0,0,0] at the mount. Ported AGS-30, Kord, M220, and SPG-9 tripods to APL And added them to CSW. Changed RHS compats to use new ported tripods. Changed strings to reflect real names. * Change from M224 Mortar Bag -> Mk6 Mortar bag * Add named propert (Autocenter) to make P3D [0,0,0] the center of the object instead of engine calculated * oh no tabs * remove some more evil tabs * fix changes lost in merge * fix bad merge pt2 * Fix UBC
2019-07-04 22:56:49 +00:00
private _weaponRelPos = _weaponPos getPos RELATIVE_DIRECTION(90);
Adds Crew Served Static Weapons (#5652) * Initial Commit * Got rid of unneeded translation values * Updated Strings * "Fixed" issue where when you deploy the tripid and weapon on slope it freaked out. * Fixed locality issues. Added timers to relavent functions. * Added weights to all magazines/tripod. Weights to weapons coming soon when I transfer them to the launcher slot * Fixed bug regarding localized strings. Created new tripod model * Added timers for deploying/picking up the tripod. Changed ammo-box model from custom to one already in ARMA. Changed gun-bag model for a more generic one. Created a texture for the tripod and gunbag * Removed ability to disassemble weapons via the addAction. Added ACE Action to get in due to a memory point issue. Changed from a static deploy/dismount time to one based in the weapon configs * Created forward-compatability. Made it so I can define a base plate for any weapon if I ever want to expand from the generic M3 Tripod. * Fixed bug where tripod wouldn't deploy with the correct times. Fixed bug where if you moved the tripod into the ground it would go flying. * Added mortar compatability. Will probably shift whole mortar ammo loading to CSW one day * Added icons to each relavent item * Added README, possibly fixed bug where if you are in a weapon others cant load/unload ammo. Changed distance you can interact with weapons * Added checks for when deploying the gun as well as unloading ammo to prevent duplication/deletion of items. * Added documentation * Added order to doc * Explained why things are the way they are * Remove temp files * Removed redundant files * Converted tabs->spaces. Added newlines at end of all files. Changed broken line in fnc_tripodDeploy.sqf. * 100% newlines at end of file * Added newlines to files that didnt get the change. Fixed README. Changed from GVAR(cswOptions) to GVAR(options). Changed from tabs to spaces in wiki * Fixed issue with UAV assembling with enableWeaponDisassembling. Fixed bug where game would crash if you disassembled static weapon with more than 1 magazine * Tabs->Spaces * Added CSW options to base StaticWeapon class to allow for easier additions. Switched default mortar away from CSW system due to incompatabilities * Lazy Evaluations and macros to describe how things work. * Added newlines to script_component. Fix no-texture issue on tripod. "Fix" 20mm HE saying 40mm HE. Add custom icons to all weapons. Move "Check Ammo" to CSW menu * abc * Revert "abc" This reverts commit bcb4214bd99bba3fec692efa4dca950323da582d. * Update to current commit * Revert changes to fortify.md * Updated UI Icon to Crew Served Ammo branch UI * Added Pabst's CrewServedAmmo to handle ammo loading/unloading instead of my solution * Fixed bug where currentWeaponTurret returned a blank string when a player hasent entered hte weapon to select the current weapon * Re-added ammo loading time * Tabs->Spaces * Newline at end of files * Removed replaced functions * Remove redundant strings. Move ammo handling to appropiate section * Tabs->Spaces * Update wiki * Updated to fix crash with default weapons and disable CSW ability on default static weapons * Added editor attributes to enable/disable CSW at edit time * Change how ammo is removed from the CSW. Uses math instead of iteration * Fix bug where assembled weapon did not get rid of default actions * Added support for multiple types of ammo in one CSW * Add tracer magazines for .50 cal * Fix bug where you could load ammo even if the gun couldnt take any more * Disable debug and enable compile cache * Changed weapon deploy/pickup time. Removed custom Titan missiles. Using ACE Dragging now. Added progress bar check for pickupTripod. Updated documentation * Removed check if CSW is full to unload ammo * Fix bug where items would spawn underneath other items on wepaon dismount * Change some things * Configure base statics, improve returnAmmo * Add mortar baseplate * Remove explicit inheritance * Fix bug where unloading ammo would duplicate it if you had room in your person. * Tab->Space * Player couldnt pickup tripod due to legacy code * Fix GMG_01_base_F inheritce * Port of ACE 2 tripod + ACE 2 CSW Bag * Move ACE 2 Data to APL folder * Adjust weights to make them more accurate to how ARMA uses it and the real life equivalents * Fix bug where error was thrown on esc from picking up tripod. Tripod rotated 180 * Fix bug where if you called ace_common_claim the weapon could be set to be disassembled even though it may not be wanted via CSW * Added ability to toggle ammo handling when weaponAssembly is disabled. * Add Proxy Weapons for all Vanilla static weapons. These serve as a way to allow for realistic ammo reload times without having to modify base classes if you want feautres turned off. Adjusted reload and mount times to be more "realistic" * Fix Shadow RPT Spam * Update wiki * Change order of setDir and setPos * Change all setDir/setPos orientations. Remove redundant check. Ensure that weapon locked state reflects it with the "getIn" command. Add a way to pass in a specific classname for the weapon assemble type. Add a callback function onDisassemble if user wants to set the state of the new tripod using the old weapon as a reference * Actually check for the carryWeaponClassname in the deployWeapon check * Ai Compatiblity * Add stringtable entries * Formatting fixes * Stringtables for settings, fix setMagazineTurretAmmo * inherit ammo for mags, reorder stringtable displays correct ammo and descriptionShort * don't require ace_javelin * Tweaks, cleanup, localzation, ace_reload changes change weapon tag to [CSW] tweak localization strings minor cleanup simplify some ace_reload funcs * delete moved dev func * Hopefully fix issue where to-be deleted tripod intersects with newly created weapon and vice versa. Remove PBOPREFIX newline * cleanup/proxyWeapon/mk6 compat
2019-06-08 04:47:39 +00:00
private _weaponHolder = createVehicle ["groundWeaponHolder", [0, 0, 0], [], 0, "NONE"];
_weaponHolder setDir random [0, 180, 360];
_weaponHolder setPosATL [_weaponRelPos select 0, _weaponRelPos select 1, _weaponPos select 2];
if (_carryWeaponMag isEqualTo "") then {
_weaponHolder addWeaponCargoGlobal [_carryWeaponClassname, 1];
} else {
_weaponHolder addWeaponWithAttachmentsCargoGlobal [[_carryWeaponClassname, "", "", "", [_carryWeaponMag, 1], [], ""], 1];
};
}, [_player, _weaponPos, _carryWeaponClassname, _carryWeaponMag]] call CBA_fnc_execNextFrame;
RHS CSW compatability (#7082) * Initial Commit * Got rid of unneeded translation values * Updated Strings * "Fixed" issue where when you deploy the tripid and weapon on slope it freaked out. * Fixed locality issues. Added timers to relavent functions. * Added weights to all magazines/tripod. Weights to weapons coming soon when I transfer them to the launcher slot * Fixed bug regarding localized strings. Created new tripod model * Added timers for deploying/picking up the tripod. Changed ammo-box model from custom to one already in ARMA. Changed gun-bag model for a more generic one. Created a texture for the tripod and gunbag * Removed ability to disassemble weapons via the addAction. Added ACE Action to get in due to a memory point issue. Changed from a static deploy/dismount time to one based in the weapon configs * Created forward-compatability. Made it so I can define a base plate for any weapon if I ever want to expand from the generic M3 Tripod. * Fixed bug where tripod wouldn't deploy with the correct times. Fixed bug where if you moved the tripod into the ground it would go flying. * Added mortar compatability. Will probably shift whole mortar ammo loading to CSW one day * Added icons to each relavent item * Added README, possibly fixed bug where if you are in a weapon others cant load/unload ammo. Changed distance you can interact with weapons * Added checks for when deploying the gun as well as unloading ammo to prevent duplication/deletion of items. * Added documentation * Added order to doc * Explained why things are the way they are * Remove temp files * Removed redundant files * Converted tabs->spaces. Added newlines at end of all files. Changed broken line in fnc_tripodDeploy.sqf. * 100% newlines at end of file * Added newlines to files that didnt get the change. Fixed README. Changed from GVAR(cswOptions) to GVAR(options). Changed from tabs to spaces in wiki * Fixed issue with UAV assembling with enableWeaponDisassembling. Fixed bug where game would crash if you disassembled static weapon with more than 1 magazine * Tabs->Spaces * Added CSW options to base StaticWeapon class to allow for easier additions. Switched default mortar away from CSW system due to incompatabilities * Lazy Evaluations and macros to describe how things work. * Added newlines to script_component. Fix no-texture issue on tripod. "Fix" 20mm HE saying 40mm HE. Add custom icons to all weapons. Move "Check Ammo" to CSW menu * abc * Revert "abc" This reverts commit bcb4214bd99bba3fec692efa4dca950323da582d. * Update to current commit * Revert changes to fortify.md * Updated UI Icon to Crew Served Ammo branch UI * Added Pabst's CrewServedAmmo to handle ammo loading/unloading instead of my solution * Fixed bug where currentWeaponTurret returned a blank string when a player hasent entered hte weapon to select the current weapon * Re-added ammo loading time * Tabs->Spaces * Newline at end of files * Removed replaced functions * Remove redundant strings. Move ammo handling to appropiate section * Tabs->Spaces * Update wiki * Updated to fix crash with default weapons and disable CSW ability on default static weapons * Added editor attributes to enable/disable CSW at edit time * Change how ammo is removed from the CSW. Uses math instead of iteration * Fix bug where assembled weapon did not get rid of default actions * Added support for multiple types of ammo in one CSW * Add tracer magazines for .50 cal * Fix bug where you could load ammo even if the gun couldnt take any more * Disable debug and enable compile cache * Changed weapon deploy/pickup time. Removed custom Titan missiles. Using ACE Dragging now. Added progress bar check for pickupTripod. Updated documentation * Removed check if CSW is full to unload ammo * Fix bug where items would spawn underneath other items on wepaon dismount * Change some things * Configure base statics, improve returnAmmo * Add mortar baseplate * Remove explicit inheritance * Fix bug where unloading ammo would duplicate it if you had room in your person. * Tab->Space * Player couldnt pickup tripod due to legacy code * Fix GMG_01_base_F inheritce * Port of ACE 2 tripod + ACE 2 CSW Bag * Move ACE 2 Data to APL folder * Adjust weights to make them more accurate to how ARMA uses it and the real life equivalents * Fix bug where error was thrown on esc from picking up tripod. Tripod rotated 180 * Fix bug where if you called ace_common_claim the weapon could be set to be disassembled even though it may not be wanted via CSW * Added ability to toggle ammo handling when weaponAssembly is disabled. * Add Proxy Weapons for all Vanilla static weapons. These serve as a way to allow for realistic ammo reload times without having to modify base classes if you want feautres turned off. Adjusted reload and mount times to be more "realistic" * Fix Shadow RPT Spam * Update wiki * Change order of setDir and setPos * Change all setDir/setPos orientations. Remove redundant check. Ensure that weapon locked state reflects it with the "getIn" command. Add a way to pass in a specific classname for the weapon assemble type. Add a callback function onDisassemble if user wants to set the state of the new tripod using the old weapon as a reference * Actually check for the carryWeaponClassname in the deployWeapon check * Ai Compatiblity * Add stringtable entries * Formatting fixes * Stringtables for settings, fix setMagazineTurretAmmo * inherit ammo for mags, reorder stringtable displays correct ammo and descriptionShort * don't require ace_javelin * Tweaks, cleanup, localzation, ace_reload changes change weapon tag to [CSW] tweak localization strings minor cleanup simplify some ace_reload funcs * delete moved dev func * Hopefully fix issue where to-be deleted tripod intersects with newly created weapon and vice versa. Remove PBOPREFIX newline * cleanup/proxyWeapon/mk6 compat * RHS compatability * Modified all tripod p3ds to have [0,0,0] at the mount. Ported AGS-30, Kord, M220, and SPG-9 tripods to APL And added them to CSW. Changed RHS compats to use new ported tripods. Changed strings to reflect real names. * Change from M224 Mortar Bag -> Mk6 Mortar bag * Add named propert (Autocenter) to make P3D [0,0,0] the center of the object instead of engine calculated * oh no tabs * remove some more evil tabs * fix changes lost in merge * fix bad merge pt2 * Fix UBC
2019-07-04 22:56:49 +00:00
LOG("delete weapon");
deleteVehicle _staticWeapon;
Adds Crew Served Static Weapons (#5652) * Initial Commit * Got rid of unneeded translation values * Updated Strings * "Fixed" issue where when you deploy the tripid and weapon on slope it freaked out. * Fixed locality issues. Added timers to relavent functions. * Added weights to all magazines/tripod. Weights to weapons coming soon when I transfer them to the launcher slot * Fixed bug regarding localized strings. Created new tripod model * Added timers for deploying/picking up the tripod. Changed ammo-box model from custom to one already in ARMA. Changed gun-bag model for a more generic one. Created a texture for the tripod and gunbag * Removed ability to disassemble weapons via the addAction. Added ACE Action to get in due to a memory point issue. Changed from a static deploy/dismount time to one based in the weapon configs * Created forward-compatability. Made it so I can define a base plate for any weapon if I ever want to expand from the generic M3 Tripod. * Fixed bug where tripod wouldn't deploy with the correct times. Fixed bug where if you moved the tripod into the ground it would go flying. * Added mortar compatability. Will probably shift whole mortar ammo loading to CSW one day * Added icons to each relavent item * Added README, possibly fixed bug where if you are in a weapon others cant load/unload ammo. Changed distance you can interact with weapons * Added checks for when deploying the gun as well as unloading ammo to prevent duplication/deletion of items. * Added documentation * Added order to doc * Explained why things are the way they are * Remove temp files * Removed redundant files * Converted tabs->spaces. Added newlines at end of all files. Changed broken line in fnc_tripodDeploy.sqf. * 100% newlines at end of file * Added newlines to files that didnt get the change. Fixed README. Changed from GVAR(cswOptions) to GVAR(options). Changed from tabs to spaces in wiki * Fixed issue with UAV assembling with enableWeaponDisassembling. Fixed bug where game would crash if you disassembled static weapon with more than 1 magazine * Tabs->Spaces * Added CSW options to base StaticWeapon class to allow for easier additions. Switched default mortar away from CSW system due to incompatabilities * Lazy Evaluations and macros to describe how things work. * Added newlines to script_component. Fix no-texture issue on tripod. "Fix" 20mm HE saying 40mm HE. Add custom icons to all weapons. Move "Check Ammo" to CSW menu * abc * Revert "abc" This reverts commit bcb4214bd99bba3fec692efa4dca950323da582d. * Update to current commit * Revert changes to fortify.md * Updated UI Icon to Crew Served Ammo branch UI * Added Pabst's CrewServedAmmo to handle ammo loading/unloading instead of my solution * Fixed bug where currentWeaponTurret returned a blank string when a player hasent entered hte weapon to select the current weapon * Re-added ammo loading time * Tabs->Spaces * Newline at end of files * Removed replaced functions * Remove redundant strings. Move ammo handling to appropiate section * Tabs->Spaces * Update wiki * Updated to fix crash with default weapons and disable CSW ability on default static weapons * Added editor attributes to enable/disable CSW at edit time * Change how ammo is removed from the CSW. Uses math instead of iteration * Fix bug where assembled weapon did not get rid of default actions * Added support for multiple types of ammo in one CSW * Add tracer magazines for .50 cal * Fix bug where you could load ammo even if the gun couldnt take any more * Disable debug and enable compile cache * Changed weapon deploy/pickup time. Removed custom Titan missiles. Using ACE Dragging now. Added progress bar check for pickupTripod. Updated documentation * Removed check if CSW is full to unload ammo * Fix bug where items would spawn underneath other items on wepaon dismount * Change some things * Configure base statics, improve returnAmmo * Add mortar baseplate * Remove explicit inheritance * Fix bug where unloading ammo would duplicate it if you had room in your person. * Tab->Space * Player couldnt pickup tripod due to legacy code * Fix GMG_01_base_F inheritce * Port of ACE 2 tripod + ACE 2 CSW Bag * Move ACE 2 Data to APL folder * Adjust weights to make them more accurate to how ARMA uses it and the real life equivalents * Fix bug where error was thrown on esc from picking up tripod. Tripod rotated 180 * Fix bug where if you called ace_common_claim the weapon could be set to be disassembled even though it may not be wanted via CSW * Added ability to toggle ammo handling when weaponAssembly is disabled. * Add Proxy Weapons for all Vanilla static weapons. These serve as a way to allow for realistic ammo reload times without having to modify base classes if you want feautres turned off. Adjusted reload and mount times to be more "realistic" * Fix Shadow RPT Spam * Update wiki * Change order of setDir and setPos * Change all setDir/setPos orientations. Remove redundant check. Ensure that weapon locked state reflects it with the "getIn" command. Add a way to pass in a specific classname for the weapon assemble type. Add a callback function onDisassemble if user wants to set the state of the new tripod using the old weapon as a reference * Actually check for the carryWeaponClassname in the deployWeapon check * Ai Compatiblity * Add stringtable entries * Formatting fixes * Stringtables for settings, fix setMagazineTurretAmmo * inherit ammo for mags, reorder stringtable displays correct ammo and descriptionShort * don't require ace_javelin * Tweaks, cleanup, localzation, ace_reload changes change weapon tag to [CSW] tweak localization strings minor cleanup simplify some ace_reload funcs * delete moved dev func * Hopefully fix issue where to-be deleted tripod intersects with newly created weapon and vice versa. Remove PBOPREFIX newline * cleanup/proxyWeapon/mk6 compat
2019-06-08 04:47:39 +00:00
LOG("end");
};
private _condition = {
params ["_args"];
_args params ["_staticWeapon"];
((crew _staticWeapon) isEqualTo []) && (alive _staticWeapon)
};
[TIME_PROGRESSBAR(_pickupTime), [_staticWeapon, _player, _carryWeaponClassname, _turretClassname, _onDisassembleFunc], _onFinish, {}, localize LSTRING(DisassembleCSW_progressBar), _condition] call EFUNC(common,progressBar);
}, _this] call CBA_fnc_execNextFrame;