Jump to content
Sign in to follow this  
Jigsor

Destroy enemy ammo box and get a negative score.

Recommended Posts

Csat ammo boxes or all ammo boxes from my understanding belong to civilian. So I'm blufor and my objective is to destroy enemy ammo cache "Box_East_Ammo_F".

If I destroy ammo cache I get -1 point on heavy vehicle and -3 total.

Fine, I have and eventhandler "killed" on ammo box that adds score to the guy who destroyed it. If want to award 15 point to the player, I actually have to award 18 points to compensate negative score.

OK, got that sorted ,but scoreboard still shows a -1 for the heavy armor as record. Is there away to turn that negative to positive or hide/get rid of it?

Related negative score bug:http://feedback.arma3.com/view.php?id=11505

Share this post


Link to post
Share on other sites

The only way I know off is by using a "handleDamage" event. You basically block the regular incoming damage and then apply the same via setDamage.

That way the game can't tell who caused the damage and therefor won't alter your score.

It's an old and kinda annoying bug that can happen when destroying all sorts of objects.

Share this post


Link to post
Share on other sites

I don't think that there is a way to cleanly manipulate the actual "visible" score, other than the overall/personal one. Meaning, you can't addVehicleScore or addAircraftScore, unfortunately.

Share this post


Link to post
Share on other sites

BIS should just remove the scoreboard completely, it serves no purpose in this game.

Edited by zooloo75

Share this post


Link to post
Share on other sites

I would have to agree with zooloo. I turned off the scoreboard for my server - no one has complained...

Anyway, I think Grimes has the right idea. You can change a players personal rating and score so he/she isn't considered ENEMY, but you would have to add a handledamage event handler to the box and add damage that way.

Share this post


Link to post
Share on other sites

Thanks for the suggestions guys. SetDamage sounds like it will work, but testing this function gives me the same results.

I'd like to keep scoreboard if I can make it work.

I already had handledamage eventhandler limiting what munitions could destroy cache.

Killed eventhandler is now removed and scoring is in handledamage eventhandler.

_ammocache = createVehicle [_objtype , position cur_cache_pos, [], 0, "None"];
sleep 0.1;		
//_ammocache addEventHandler ["killed", {handle = [(_this select 0),(_this select 1)] execVM "scripts\AmmoCache_Score.sqf"}];
_ammocache addeventhandler ["handledamage",{_this call ammmoCache_handleDamage}]; 

I still get a negative 3 score with both of these edits.

Removing refference of source does not have effect

handledamage Passed array: [unit, selectionName, damage, source, projectile]

JIG_ammmoCache_damage = {	
   _cache = _this select 0;
   _damage = _this select 2;
   _source = _this select 3;
   _ammo = _this select 4;        

   if ((_ammo == "satchelCharge_remote_ammo") || (_ammo == "demoCharge_remote_ammo")) then {
           //--- Increase damage, add score, remove eventhandler, delete cache box
           //_damage = _damage * 3;
    _cache setDamage 1;
    _cache removeAllEventHandlers "handledamage";
    _pScore = 18;
    _source addScore _pScore;
    paddscore = [_source, _pscore]; publicVariable "paddscore";
    deleteVehicle _cache;
   } else {        
	_damage = 0;
   };
   _damage
};

JIG_ammmoCache_damage = {	
   _cache = _this select 0;
   _damage = _this select 2;
   //_source = _this select 3;
   _ammo = _this select 4;        

   if ((_ammo == "satchelCharge_remote_ammo") || (_ammo == "demoCharge_remote_ammo")) then {
           //--- Increase damage, add score, remove eventhandler, delete cache box
           //_damage = _damage * 3;
    _cache setDamage 1;
    _cache removeAllEventHandlers "handledamage";
    //_pScore = 18;
    //_source addScore _pScore;
    //paddscore = [_source, _pscore]; publicVariable "paddscore";
           deleteVehicle _cache;
   } else {        
	_damage = 0;
   };
   _damage
};

Is it not possible to handle scoring and limit damage on objects that do not belong to opposing side through bis eventhandler?

Edited by Jigsor

Share this post


Link to post
Share on other sites

That is probably because your handleDamage function still passed the original damage value to ArmA.

Try this instead:

JIG_ammmoCache_damage = {
_cache = _this select 0;
_damage = _this select 2;
_source = _this select 3;
_ammo = _this select 4;

if ((_ammo == "satchelCharge_remote_ammo") || (_ammo == "demoCharge_remote_ammo")) then {
	if (_damage > 0.9) then { _damage = 0.9 };
	_cache setDamage 1;

	_pScore = 18;
	_source addScore _pScore;
	paddscore = [_source, _pscore]; publicVariable "paddscore";

	_cache removeAllEventHandlers "handledamage";
	deleteVehicle _cache;
} else {
	_damage = 0;
};
_damage
};

Share this post


Link to post
Share on other sites

No luck Tajin. The results are the same. Still negative score.

If no return of damage at end of function by commenting //_damage the result is also the same.

Edited by Jigsor

Share this post


Link to post
Share on other sites

Oh, interesting.

It should help to add a delay to the destruction of the box and don't do it directly inside the eventHandler.

Like this:

JIG_ammmoCache_damage = {
_cache = _this select 0;
_damage = _this select 2;
_source = _this select 3;
_ammo = _this select 4;
_out = 0;

if ((_ammo == "satchelCharge_remote_ammo") || (_ammo == "demoCharge_remote_ammo")) then {
	_cache spawn {
		sleep 1;
		_this setDamage 1;
		sleep 3;
		deleteVehicle _this;
	};
	_pScore = 18;
	_source addScore _pScore;
	paddscore = [_source, _pscore]; publicVariable "paddscore";
};
_out
};

Share this post


Link to post
Share on other sites

_cache spawn {

sleep 1;

_this setDamage 1;

sleep 3;

Did the trick. It works perfectly! Thank you Tajin.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×