Hiding a mover

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Blödsinn machen

cannon fodder
Dec 4, 2001
68
0
0
Switzerland
dwmade.stormpages.com
I've created a subclass of mover and am trying to make it so that when the mover brush has sustained a certain amount of damage (in TakeDamage) it is hidden, since brushes can't be destroyed. Taking some of the code from the mover class:

Code:
SetCollision(false, false, false);
SetLocation(Location + vect(0,0,20000)); // temp since still in bsp
bHidden = true;

.... I've done this and yet it still has not effect. after the brush has sustained enough damage, this code is execute (I've logged it)... and the SetCollision call works fine since the player can now walk through the brush.. but the brush is still there. does anyone have a solution for this?
 
No no... This is a mover, no rebuilt needed. I've worked with movers before, so I know they CAN be moved... I've just never used the setLocation function. Maybe movers have some dislike for that function? Anyway, why do you need to do all that? Isn't it enough to just have the mover be a normal move and just move out of the way when shot? If not, try looking through the mover class and see how it moves itself.

Eater.
 

Blödsinn machen

cannon fodder
Dec 4, 2001
68
0
0
Switzerland
dwmade.stormpages.com
Eater1, thanks for clarifying that for me...
I took the code straight from the Mover class in PostBeginPlay:
Code:
	//brushes can't be deleted, so if not relevant, make it invisible and non-colliding
	if ( !Level.Game.IsRelevant(self) )
	{
		SetCollision(false, false, false);
		SetLocation(Location + vect(0,0,20000)); // temp since still in bsp
		bHidden = true;
	}
I really don't see why it shouldn't work if I do the same elsewhere. anyway, I just want a mover that will explode after sustaining a certain amount of damage and then be removed from the level. now, I don't really need to do that, but I'm curious to see if I can.
 
Hmmm... Well, I guess you'll have to invenstigate a little. Maybe the problem is not with your code, but maybe that function is not being called at all? Are you sure you're actually using your mover? Check these things out and be 100% sure that it IS that block of code (some ClientMessages in that block would help determine if it gets called).

Eater.
 

Blödsinn machen

cannon fodder
Dec 4, 2001
68
0
0
Switzerland
dwmade.stormpages.com
well, I suppose I should start by (not being an idiot) and putting the whole bloody function here...
Code:
function TakeDamage( int Damage, Pawn InstigatedBy, vector HitLocation, 
						vector Momentum, name DamageType )
{
	local ShockWave Explosion;
	local bool bStupidBrushResult;

	
	Log("Vehicle.TakeDamage"@Damage);
	
	Health -= Damage;
	
	if ( Health <= 0 )
	{
		Explosion = Spawn(class'ShockWave',,, HitLocation);
		Explosion.Instigator = InstigatedBy;
		SetCollision(False, False, False);
		bStupidBrushResult = SetLocation(Location + vect(0, 0, 20000));
		Log("SetLocation returned"@bStupidBrushResult);
		bHidden = True;
	}
}

anyway, I've logged it right there and it tells me that SetLocation succeeded. And there's quite the visual confirmation that TakeDamage is called for the mover because it explodes nicely after sustaining enough damage... well, this is really starting to get to my head. :mad:
 

+RIP+Botje

New Member
Dec 8, 2001
19
0
0
38
A Sanitarium :)
Visit site
final function SetKeyframe( byte NewKeyNum, vector NewLocation, rotator NewRotation )
and then
final function InterpolateTo( byte NewKeyNum, float Seconds )

like this:
if ( Health <= 0 )
{
Explosion = Spawn(class'ShockWave',,, HitLocation);
Explosion.Instigator = InstigatedBy;
SetCollision(False, False, False);
SetKeyframe( Numkeys++ , Location + vec(0,0,20000) , Rotation);
InterPolateTo ( Numkeys, 0 );
bHidden = True;
}

i'm guessing that SHOULD work, didn't try it.
/*(plz don't bash me 2c4u :)*/