KF Invisible

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

colop

FNG / Fresh Meat
Aug 23, 2012
12
0
0
Hello!

var localized string MSG_InvisOn;
var localized string MSG_InvisOff;

function HealOrHurt(float DamageAmount, float DamageRadius, class<DamageType> DamageType, float Momentum, vector HitLocation)
{
local KFPawn KFP;
local Controller C;

foreach CollidingActors (class 'KFPawn', KFP, DamageRadius, HitLocation)

for( C = Level.ControllerList; C != None; C = C.nextController )
{
if( C.IsA('PlayerController') || C.IsA('xBot'))
{
C.Pawn.Visibility = 0;
C.Pawn.ClientMessage(MSG_InvisOn);
C.Pawn.bHidden = true;
}
}
}


defaultproperties
{

MSG_InvisOn="Invisible ON"
MSG_InvisOff="Invisible OFF"

}


Would be needed timer that let the player be visible after 1 minute!
How can I solve this?

C.Pawn.Visibility = 128;
C.Pawn.ClientMessage(MSG_InvisOff);
C.Pawn.bHidden = false;


THANKS! :D
 

Skell

Active member
Mar 21, 2013
1,245
2
38
On the Internet.
Would be doable in Tick() from inside the pawn's class.
Code:
var float HideTime;

simulated function Tick(float dt)
{
     super.Tick(dt);

     if(bHidden == True)
     {
          HideTime -= dt;
          if(HideTime < 0.000000)
          {
               Visibility = 128;
               HideTime = 60.000000
               bHidden = False;
               ClientMessage("Invisible OFF");
          }
     }
}

defaultproperties
{
     HideTime = 60.000000
}
 

colop

FNG / Fresh Meat
Aug 23, 2012
12
0
0
Does not succeed!
Otherwise it would be a grenade!

The player disappears but does not want to appear!
 

Skell

Active member
Mar 21, 2013
1,245
2
38
On the Internet.
I have no idea what you're talking about for the first part of what you wrote. However, I don't see any reason why this wouldn't work. Make sure you're replacing the normal KFHumanPawn with your new pawn code.
 

colop

FNG / Fresh Meat
Aug 23, 2012
12
0
0
oh
now good
thanks Skell :p



class Invisible extends Mutator;

var float HideTime;

auto state startup
{
function Tick(float dt)
{
local KFHumanPawn Pawn;

super.Tick(dt);

ForEach DynamicActors(class'KFHumanPawn', Pawn)

if (Pawn.bHidden)
{
HideTime -= dt;
if(HideTime < 0.000000)
{
Pawn.Visibility = 128;
Pawn.bHidden = False;
Pawn.ClientMessage("Invisible OFF");
HideTime = default.HideTime;
}
}
}
}



defaultproperties
{
HideTime = 60.000000;
 
Last edited: