Jump to content
darkxess

RE: NATO 5.56 and 7.62 Damage Mod

Recommended Posts

Hey guys, I am wondering if you can help me, I am trying to get this mod: http://www.armaholic.com/page.php?id=24204 working on our server as a script instead of a .pbo (mod) as its not signed for servers anyways.

So my question is, how can I get it to work within our servers mission by calling it via a script?

thanks
 

Share this post


Link to post
Share on other sites

Its impossible to perform config changes (which this mod does) via script.

Share this post


Link to post
Share on other sites

Em,.. ok, so how can I possibly load this for the server to use it for everyone but without a key? :(

Share this post


Link to post
Share on other sites

Well there is clue on the download page:

Quote

Pros:
Removes the need for event handlers on all enemy units and spawners.

 

You can actually achieve this with pure scripting. But it requires some work. Basically, you need to execute this script for every unit in the game:

this addEventHandler["HandleDamage", {
  // Only if the damage is from projectile
  if (_this select 4 != "") exitWith {
    // Return updated damage
    (_this select 2) * DMG_COEF
  };
  // Don't update damage for non-projectile damage
  nil
}];

This presumes, that you have DMG_COEF defined somewhere. It simply multiplies every damage unit receives.

 

If you have completely static mission (all units for the mission are already spawned at beginning), this is all you need:

// Everything will do twice the damage.
DMG_COEF = 2;
DMG_HANDLER = {
  // Only if the damage is from projectile
  if (_this select 4 != "") exitWith {
    // Return updated damage
    (_this select 2) * DMG_COEF
  };
  // Don't update damage for non-projectile damage
  nil
};
// Apply updated damage coeficient to all currently spawned units
{
  _x addEventHandler["HandleDamage", DMG_HANDLER];
} foreach allUnits;

Of course, this is not enough for most missions. You will need to call addEventHandler for all units that are spawned in dynamically, which differs for every mission...

  • Like 1

Share this post


Link to post
Share on other sites

@SkaceKachna It would be for a mission where units are dynamically spawned - would you mind making an example mission of how this would all go together? 

Thanks :)

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

×