KoffeinFlummi / AGM

Authentic Gameplay Modification for A3 | THIS PROJECT IS NO LONGER BEING WORKED ON. ALL ISSUES AND PULL REQUESTS WILL BE IGNORED.
Other
125 stars 84 forks source link

Make SLAM face upwards when using Magnetic Influence Sensor #751

Closed bux closed 10 years ago

bux commented 10 years ago

Arma3: 1.24 Mods: CBA_A3, AGM_dev AGM_dev from: 2014-08-08T05:48:42.262Z Tested on: self hosted MP mission Zeus enabled: Yes Modules: All AGM modules with default settings

When placing a SLAM mine using the Magnetic Influence Sensor rotate it so it faces upwards.

Btw. The Trigger menu is not wide enough for the entry: 2014-08-08_00006

CorruptedHeart commented 10 years ago

The menu size can probably be increased. The SLAM facing upwards is configured but I need to add the ability for agm_triggers classes to override cfgagm_triggers onPlace.

CorruptedHeart commented 10 years ago

This might rely on Arma 1.26 or someone with better maths skills than me in vectors and directions.

commy2 commented 10 years ago

Work arounds for in 1.24 missing commands:

vectorNormalized:

_vector = [X,Y,Z];
_length = vectorMagnitude _vector;
_vector = _vector vectorMultiply 1 / _length;

vectorFromTo: (should be named unitVectorFromTo IMO)

_vector = _positionEND vectorDiff _positionSTART
_length = vectorMagnitude _vector;
_vector = _vector vectorMultiply 1 / _length;

: )

CorruptedHeart commented 10 years ago

What I have discovered so far after a couple hours trying to get it to also take direction into account.

// This works for setting it facing up, but the direction changes.
_explosive setVectorDirAndUp [[0,0,1],[0,1,0]];
nicolasbadano commented 10 years ago

@CorruptedHeart. AFAIK, these could be your line

_explosive setVectorDirAndUp [[0,0,1],[sin dir,cos dir,0]];

commy2 commented 10 years ago

Or use [object, pitch, bank] call BIS_fnc_setPitchBank

setVectorDirAndUp is the most irritating command to use.

@esteldunedain that will fail if you bank more than 180 degrees or pitch more than 90 or something.

CorruptedHeart commented 10 years ago

I am attempting the setPitchBank command, it seems to work. But now I don't know how MP will be effected. Will push the changes shortly hopefully someone can test it for me in MP

nicolasbadano commented 10 years ago

I test this kind of things quickly by running two instances of A3 on my computer and setting up a lan game. I could do that in a moment.

CorruptedHeart commented 10 years ago

http://cloud-4.steampowered.com/ugc/28464916188763039/A727231BF1D864E8F0A84E11343F32F301156CAF/

nicolasbadano commented 10 years ago

Hmmm. stuff blown. A good sign...

CorruptedHeart commented 10 years ago

Now available on that branch

nicolasbadano commented 10 years ago

Tested on MP. The direction of SLAMs are correctly synced on both modes. However, i think they are still far underpowered in side attack mode. Three charges failed to damage a Namer APC track at all at approx. 1m distance.

nicolasbadano commented 10 years ago

Same thing with the Patria. SLAMs are supposed to be used against APCs, so we better increase the blast force (http://en.wikipedia.org/wiki/Selectable_Lightweight_Attack_Munition states it can penetrate 40 millimeters of armor at a range of eight meters).

CorruptedHeart commented 10 years ago

I will merge now and close as much of the related issues as possible except the side attack one. Will need to do some work there still obviously.

CorruptedHeart commented 10 years ago

Closed via https://github.com/KoffeinFlummi/AGM/pull/782 thanks for the help