Author Topic: Radius Impulse?  (Read 859 times)

What does it do? I've never used it before, is it like a realy or something?

Quote from: code
$radiusmasstimes = 20;
function serverCmdsetradiuspower(%client, %num) {
   if(%client.isadmin || %client.issuperadmin) {
      if(%num != $radiusmasstimes) {
         if(%num <= 100 || %num >= 1) {
            $radiusmasstimes = %num;
            chatMessageAll(%client, '\c4Radius impulse power is now: \c3%1\c4.', %num);
         }
         else if(%num <= 0 || strlwr(%num) $= "off") {
            $radiusmasstimes = 0;
            chatMessageAll(%client, '\c4Radius impulse power is now \c3OFF\c4.');
         }
         else if(strlwr(%num) $= "default") {
            $radiusmasstimes = 20;
            chatMessageAll(%client, '\c4Radius impulse power is now: \c320\c4.');
         }
         else
            messageClient(%client, '\c4Please choose a number between 1 and 100. Zero and under is off. So is typing "off". Typing "default" makes the impulse default.');
      }
   }
}
function serverCmdradiusimpulse(%client) {
   if($radiusmasstimes == 0) {
      messageClient(%client, '\c5Radius impulse is \c0OFF\c5.');
      return;
   }
   %sourceObject = %client.player;
   %position = %sourceObject.gettransform();
   InitContainerRadiusSearch(%position, 15, $TypeMasks::ShapeBaseObjectType | $TypeMasks::ProjectileDataObjectType | $TypeMasks::VehicleObjectType);
   %halfRadius = 15 / 2;
   while((%targetObject = containerSearchNext()) != 0) {
      if(%targetObject != %sourceObject) {
         %coverage = calcExplosionCoverage(%position, %targetObject, $TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType | $TypeMasks::ForceFieldObjectType);
         if (%coverage == 0)
            continue;
         %dist = containerSearchCurrRadiusDist();
         %distScale = (%dist < %halfRadius)? 1.0:
         1.0 - ((%dist - %halfRadius) / %halfRadius);
         %impulse = %targetObject.getDataBlock().mass * $radiusmasstimes;
         %impulseVec = VectorSub(%targetObject.getWorldBoxCenter(), %position);
         %impulseVec = VectorNormalize(%impulseVec);
         %impulseVec = VectorScale(%impulseVec, %impulse * %distScale);
         %targetObject.applyImpulse(%position, %impulseVec);
         }
   }
}
GlobalActionMap.bindCmd(keyboard, "F6", "", "commandToServer('radiusimpulse');");

^ Like that? (REALLY old Serverside code I made. Back when I hosted a bunch. XD So it's not so efficient)

Is that the same thing as radiusimpulse in events?

Is that the same thing as radiusimpulse in events?

I thought that event was removed. :o All it does is move everything away from it.


radius impulse is an explosion without damage, it either pushes people out, or pulls them in, to the center

radius impulse is an explosion without damage, it either pushes people out, or pulls them in, to the center

But he says it's an event, and I thought that was removed.

it's an event, and default, and not removed

it's an event, and default, and not removed

o_o Where is it? It was a ghost event for me. I remember I used to try and find it, and couldn't. I thought it completely disappeared. I did know it was default, though.

Ok so onActivate>Self>RadiusImpuls[Numbers] pushes things out and make them negative numbers to pull things in I get it