ACE3 icon indicating copy to clipboard operation
ACE3 copied to clipboard

getHitpoints function doesn't support reflector hitpoints

Open SzwedzikPL opened this issue 11 years ago • 26 comments

During tests of https://github.com/acemod/ACE3/pull/2230 i noticed that after dragging or carrying lamp reflectors are always working (event if damaged before).

The reason is that this dont support reflector hitpoints (or selections? only getHit return anything)

https://github.com/acemod/ACE3/blob/master/addons/common/functions/fnc_fixFloating.sqf#L24

SzwedzikPL avatar Aug 25 '15 12:08 SzwedzikPL

I'll investigate. Doubt those can be manipulated with setHitPointDamage and getHitPointDamage though.

commy2 avatar Aug 27 '15 20:08 commy2

@commy2 look at #2279

jonpas avatar Aug 27 '15 20:08 jonpas

@commy2 i've prepared https://github.com/acemod/ACE3/pull/2279 but have problem with setdamage.

SzwedzikPL avatar Aug 27 '15 21:08 SzwedzikPL

I advice that you use the new getAllHitPointsDamage cursorTarget command

commy2 avatar Aug 30 '15 18:08 commy2

@SzwedzikPL What about: [cursorTarget] call ace_common_fnc_getReflectorsWithSelections ?

commy2 avatar Aug 30 '15 18:08 commy2

The problem is not exactly that getHitpoints doesn't support reflectors After dragging some object (i.e. lamp with reflectors) we'r calling: https://github.com/acemod/ACE3/blob/master/addons/dragging/functions/fnc_dropObject.sqf#L60 And in fixFloating fnc we do not support reflectors, so thats why reflectors are always working after drag/carry (even if damaged before) https://github.com/acemod/ACE3/blob/master/addons/common/functions/fnc_fixFloating.sqf#L24

SzwedzikPL avatar Aug 30 '15 19:08 SzwedzikPL

k. I understand now.

I'll see that I fix this after 3.3.0. Currently cleaning up (== incorperating new commands...) all the other stuff with hitpoints.

https://github.com/acemod/ACE3/pull/2319

commy2 avatar Aug 30 '15 19:08 commy2

@commy2 ok. Should I close https://github.com/acemod/ACE3/pull/2279 ?

SzwedzikPL avatar Aug 30 '15 19:08 SzwedzikPL

Nah. Leave it open for now.

commy2 avatar Aug 30 '15 20:08 commy2

Fixed in #2601. Sry for this taking a month. Had other priorities even though this ended up being really simple.

commy2 avatar Sep 26 '15 12:09 commy2

This is not fixed. Please test it with https://github.com/acemod/ACE3/pull/2230

  1. Place Portable Lights (double) from Objects (construction)
  2. Shot to one of the reflectors
  3. Carry lamp
  4. Place lamp

You'll see that after placing both reflectors are working.

SzwedzikPL avatar Oct 16 '15 17:10 SzwedzikPL

allowDamage false from fixCollision blocks adding damage from setHitIndex biki says

"The command does not prevent object from taking scripted damage such as setDamage or setHit. "

Can reproduce with this code having no effect:

qq1 allowDamage false;
qq1 setHitIndex [0,1];

PabstMirror avatar Oct 16 '15 18:10 PabstMirror

Pabst, you are my hero again!

commy2 avatar Oct 16 '15 18:10 commy2

And a big FU to you BI.

commy2 avatar Oct 16 '15 18:10 commy2

Wiki is wrong. The same happens with:

cursorTarget allowDamage false;
cursorTarget setHit ["light_1_hitpoint", 1]

commy2 avatar Oct 16 '15 18:10 commy2

Can we swap order of the events? Or do we need to look into a proper "allowDamage" handler so we can disable and then reenable?

PabstMirror avatar Oct 16 '15 18:10 PabstMirror

We can not swap the order of these commands. We will need a proper allowDamage function like forceWalk etc.

commy2 avatar Oct 16 '15 18:10 commy2

https://github.com/acemod/ACE3/issues/2757

commy2 avatar Oct 16 '15 18:10 commy2

Wiki is wrong. The same happens with:

Edit the BIKI! :grin:

jonpas avatar Oct 16 '15 18:10 jonpas

Edited it. Also added that allowDamage false soldiers can still drown. (R.I.P. Ghost)

commy2 avatar Oct 16 '15 18:10 commy2