Page 1 of 1

Anti-Water Bug Source

PostPosted: Sun Dec 16, 07 7:54 am
by Batchy
Code: Select all
//=================================================
// Batch's Anti-WaterBug, Thanks to JimBowen For the help
//=================================================

class antiWaterBug extends Mutator; // any actor class will do here, but using Actor clutters up the tree

function Timer()
{
   local pawn p;
   for(p=Level.PawnList;p!=None;p=p.nextPawn)
   {
      if (p.isA('DeusExPlayer') && p.region.zone.isA('WaterZone')&&DeusexPlayer(P).inHand.isA('DeusExWeapon')
         && DeusExWeapon(DeusExPlayer(P).inHand).EnviroEffective==ENVEFF_Air)
         DeusExPlayer(P).inHand=None;
   }
}   


function PreBeginPlay()
{
   setTimer(0.01,true);
}

PostPosted: Sun Dec 16, 07 12:19 pm
by ~ô¿ô~Nobody~
At least you didn't use the AllActors iterator function.
Checking that 100 times a second is not required and just causes lag.

PostPosted: Sun Dec 16, 07 11:24 pm
by Batchy
Well if you recommend something that would help it, Please post it :)

PostPosted: Fri Dec 21, 07 11:09 pm
by ~ô¿ô~Nobody~
setTimer(0.5,true);

PostPosted: Thu Jan 17, 08 12:39 am
by Dae
thx

helped with some code (TzBasketBallZone to be precise :))

PostPosted: Thu Jan 17, 08 2:58 pm
by Dae
Looks like
Code: Select all
inHand=None;

works only on the server and the client still sees the weapon (and that makes an odd bug)

Code: Select all
PutInHand(None);

works better

PostPosted: Thu Jan 17, 08 3:00 pm
by Batchy
Ill put that in the new version, Thanks