Jump to content
Nikoladis

Add artillery kills to players score

Recommended Posts

Hello,
 

So when an AI gets kills, for example through artillery support, how can I transfer those kills to the player, as he was the one who ordered the strikes?

Share this post


Link to post
Share on other sites

You can use setShotParents with a fired eventhandler on the artillery.

Problem is, as soon as the first artillery shell hits a target everything that's not instantly getting killed will know about the unit that "owns" the shots.

 

Further read:

 

Current ticket.

Been almost a year.

At the current rate of minor tweaks this should take them 3 more years to resolve.

 

Cheers

Share this post


Link to post
Share on other sites

One option is to use this approach:

// Run on server
addMissionEventHandler ["EntityKilled", 
{
    params ["_killed", "_killer", "_instigator"];
    // Was it an artillery guy that killed the person?
    if ([arty_guy1, arty_guy2, arty_guy3] find _instigator != -1) then {
        // Determine proper _player to receive credit
        private _player = player24;
        if (!isNull _player) then {
            private _toAdd = [1, -1] select (side player == side _killed);
            _player addPlayerScores [_toAdd, 0, 0, 0, _toAdd];
        };
    };
}];

 

  • Like 2

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

×