StickyCharges Addon - Bomb direction

StickyCharges Addon - Bomb direction

« posted: Jun 26, 2017, 07:07 AM »
Hi,

Long time lurker - first time poster. A big thanks for an excellent game mode.

I'm having trouble getting my head around the stickyCharges addon, what i'm trying to do is re-enact mad max and give players the ability to strap claymores to the bumpers of their vehicles and have at it.

I've got the claymores placeable on vehicles, but all placed bomb directions face up rather that the desired outwards. i've played around with hard setting setVectorDirAndUp and setVectorUp in both pvarVecDirUp.sqf and initVecDirUp.sqf but dont really understand how the "pvar_A3W_stickyCharges_vecDirUp" is defined, went through the BIS wiki on setVectorDirAndUp. Any help or pointers in the right "direction" would be greatly appreciated.

Code: [Select]
// ****************************************************************************************
// * This addon is licensed under the GNU Lesser GPL v3. Copyright © 2016 A3Wasteland.com *
// ****************************************************************************************
// @file Name: initVecDirUp.sqf
// @file Author: AgentRev

#include "defines.sqf"

{
_vecDirUp = _x getVariable ["A3W_stickyCharges_vecDirUp",0];

if (_vecDirUp isEqualType [] && {_vecDirUp isEqualTypeAll []}) then
{
_linkedBomb = _x getVariable ["A3W_stickyCharges_linkedBomb",0];

if (_linkedBomb isEqualType objNull && {_linkedBomb isKindOf "TimeBombCore"}) then
{
_linkedBomb setVectorDirAndUp _vecDirUp;
_linkedBomb setVectorUp (_vecDirUp select 1); // vectorUp must be set again for the bomb to be oriented correctly when attached
};
};

sleep 0.01;
} forEach allMissionObjects STICKY_CHARGE_DUMMY_OBJ;

Code: [Select]
// ****************************************************************************************
// * This addon is licensed under the GNU Lesser GPL v3. Copyright © 2016 A3Wasteland.com *
// ****************************************************************************************
// @file Name: pvarVecDirUp.sqf
// @file Author: AgentRev

#include "defines.sqf"

(_this select 1) params [["_bomb",objNull,[objNull]], ["_vecDir",[],[[]]], ["_vecUp",[],[[]]]];

if (!mineActive _bomb) exitWith {};

_bomb setVectorDirAndUp [_vecDir,_vecUp];
_bomb setVectorUp _vecUp; // vectorUp must be set again for the bomb to be oriented correctly when attached
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2343

Re: StickyCharges Addon - Bomb direction

« Reply #1 posted: Jun 27, 2017, 08:55 PM »
Replace

https://github.com/A3Wasteland/ArmA3_Wasteland.Altis/blob/605dbf8154236689901c52226ffa59606d1b558d/addons/stickyCharges/firedEvent.sqf#L102

to

Code: [Select]
if (_ammo isKindOf "DirectionalBombCore") then
{
private _vecDirTmp = _vecDir;
_vecDir = _vecUp;
_vecUp = _vecDirTmp;
};

_rootObj setVectorDirAndUp [_vecDir,_vecUp];

Re: StickyCharges Addon - Bomb direction

« Reply #2 posted: Jun 27, 2017, 11:33 PM »
Champion, Thanks heaps.