Water/Pressure Zone

Tutorials and discussions about Mapping - Introduce your own ones!
Post Reply
User avatar
[NBK]DxTrEm3Fx
Adept
Posts: 259
Joined: Wed May 09, 2012 5:56 pm
Location: Glendale, AZ
Contact:

Water/Pressure Zone

Post by [NBK]DxTrEm3Fx »

In my bathroom map, I have a redeemer placed in the water zone, and I want to be able to shoot a trigger to turn it into a pressure zone that kills whoever is getting the redeemer. I'm not sure if what I'm trying to accomplish will work. So far, it's not working. I'm trying to combine the water zone with a triggerable pressure zone Inside my toilet. I have the pressure zone and triggers working with movers etc. But if I add the water zone it cancels my pressure zone. I know that I can separate the two zones using portals for each zone. But I do not want to do that because technically you should be underwater when grabbing the warhead. Is it possible to make the water zone a triggerable pressure zone or a kill zone with the same effects as a pressure zone? Is it possible to make the pressure zone have the buoyancy or physics of floating in the water? :???: :noidea
Image
Image
Image
Buggie
Godlike
Posts: 2698
Joined: Sat Mar 21, 2020 5:32 am

Re: Water/Pressure Zone

Post by Buggie »

Copy props of water zone into pressure zone. And it be water zone.
Default props for water zone:

Code: Select all

defaultproperties
{
	ZoneName="Underwater"
	EntrySound=Sound'UnrealShare.Generic.DSplash'
	ExitSound=Sound'UnrealShare.Generic.WtrExit1'
	EntryActor=Class'UnrealShare.WaterImpact'
	ExitActor=Class'UnrealShare.WaterImpact'
	bWaterZone=True
	ViewFlash=(X=-0.078000,Y=-0.078000,Z=-0.078000)
	ViewFog=(X=0.128900,Y=0.195300,Z=0.175780)
}
User avatar
[NBK]DxTrEm3Fx
Adept
Posts: 259
Joined: Wed May 09, 2012 5:56 pm
Location: Glendale, AZ
Contact:

Re: Water/Pressure Zone

Post by [NBK]DxTrEm3Fx »

Buggie wrote: Sun Feb 05, 2023 7:47 pm Copy props of water zone into pressure zone. And it be water zone.
Default props for water zone:

Code: Select all

defaultproperties
{
	ZoneName="Underwater"
	EntrySound=Sound'UnrealShare.Generic.DSplash'
	ExitSound=Sound'UnrealShare.Generic.WtrExit1'
	EntryActor=Class'UnrealShare.WaterImpact'
	ExitActor=Class'UnrealShare.WaterImpact'
	bWaterZone=True
	ViewFlash=(X=-0.078000,Y=-0.078000,Z=-0.078000)
	ViewFog=(X=0.128900,Y=0.195300,Z=0.175780)
}
So do I just add it to the bottom of the PressureZone script as you will see in the code I pasted? And what about saving it so it doesn't screw up botpack.PressureZone. It needs to be saved to MyLevel so there isn't an additional package needed to play the map. I'm not a coder so this is a bit out of my realm.

Code: Select all

//=============================================================================
// PressureZone.
//=============================================================================
class PressureZone extends ZoneInfo;

var() float  KillTime;					// How long to kill the player?
var() float  StartFlashScale;			// Fog values for client death sequence
var() Vector StartFlashFog;
var() float  EndFlashScale;
var() Vector EndFlashFog;
var() float  DieFOV;					// Field of view when dead (interpolates)
var() float  DieDrawScale;				// Drawscale when dead
var   float  TimePassed;
var() byte   DieFatness;				// Fatness when dead
var   bool   bTriggered;				// Ensure that it doesn't update until it should
var	  bool	 bScreamed;

function BeginPlay()
{
	Super.BeginPlay();
	Disable('Tick');
	bTriggered = false;
	DieFOV = FClamp( DieFOV, 1, 170 );
	DieFatness = Clamp( DieFatness, 1, 255 );
}

function Trigger( actor Other, pawn EventInstigator )
{
	local Pawn p;

	// The pressure zone has been triggered to kill something

	Instigator = EventInstigator;

	if ( Instigator.IsA('bot') )
	{
		// taunt the victim
		for ( P=Level.PawnList; P!=None; P=P.NextPawn )
			if( (P.Region.Zone == self) && (P.Health > 0) )
			{
				Instigator.Target = P;
				Instigator.GotoState('VictoryDance');
			}
	}

	// Engage Tick so that death may be slow and dramatic
	TimePassed = 0;
	bTriggered = true;
	bScreamed = false;
	Disable('Trigger');
	Enable('Tick');
}

function Tick( float DeltaTime )
{
	local float  		ratio, curScale;
	local vector 		curFog;
	local PlayerPawn	pPawn;
	local Pawn P;
	local bool bActive;

	if( !bTriggered ) 
	{
		Disable('Tick');
		return;
	}

	TimePassed += DeltaTime;
	ratio = TimePassed/KillTime;
	if( ratio > 1.0 ) ratio = 1.0;

	for ( P=Level.PawnList; P!=None; P=P.NextPawn )
	{
		// Ensure player hasn't been dispatched through other means already (suicide?)
		if( (P.Region.Zone == self) && (P.Health > 0) && !P.IsA('Spectator') )
		{
			bActive = true;
				
			// Fatness
			P.Fatness   = byte( 128 + Int( (Float(DieFatness)-128) * ratio ));
			P.DrawScale = 1 + (DieDrawScale-1) * ratio;

			// Maybe scream?
			if( !bScreamed && P.bIsPlayer && (Ratio > 0.2) && (FRand() < 2 * DeltaTime) )
			{
				// Scream now (from the terrible pain)
				bScreamed = true;
				P.PlaySound( P.Die, SLOT_Talk );
			}
		
			// Fog & Field of view
			pPawn = PlayerPawn(P);
			if( pPawn != None )
			{
				curScale = (EndFlashScale-StartFlashScale)*ratio + StartFlashScale;
				curFog   = (EndFlashFog  -StartFlashFog  )*ratio + StartFlashFog;
				pPawn.ClientFlash( curScale, 1000 * curFog );

				pPawn.SetFOVAngle( (DieFOV-pPawn.default.FOVAngle)*ratio + pPawn.default.FOVAngle);
			}
			if ( ratio == 1.0 )
			{	
				Level.Game.SpecialDamageString = DamageString;
				P.health = -1000; //make sure gibs
				P.Died(Instigator, 'SpecialDamage', P.Location);
				MakeNormal(P);
			}
		}
	}	
	
	if( !bActive && (TimePassed >= KillTime) )
	{
		Disable('Tick');
		Enable('Trigger');
		bTriggered = false;
	}
}

function MakeNormal(Pawn P)
{
	local PlayerPawn PPawn;
	// set the fatness back to normal
	P.Fatness = P.Default.Fatness;
	P.DrawScale = P.Default.DrawScale;
	PPawn = PlayerPawn(P);
	if( PPawn != None )
		PPawn.SetFOVAngle( PPawn.Default.FOVAngle );
}

// When an actor leaves this zone.
event ActorLeaving( actor Other )
{
	if( Other.bIsPawn )
		MakeNormal(Pawn(Other));
	Super.ActorLeaving(Other);
}
defaultproperties
{
	ZoneName="Underwater"
	EntrySound=Sound'UnrealShare.Generic.DSplash'
	ExitSound=Sound'UnrealShare.Generic.WtrExit1'
	EntryActor=Class'UnrealShare.WaterImpact'
	ExitActor=Class'UnrealShare.WaterImpact'
	bWaterZone=True
	ViewFlash=(X=-0.078000,Y=-0.078000,Z=-0.078000)
	ViewFog=(X=0.128900,Y=0.195300,Z=0.175780)
}
Image
Image
User avatar
OjitroC
Godlike
Posts: 3605
Joined: Sat Sep 12, 2015 8:46 pm

Re: Water/Pressure Zone

Post by OjitroC »

I'm pretty sure that Buggie means replace the relevant default properites in your Pressure Zone in the map (in the toilet) with those Water Zone properties. So, for example, under LocationString->ZoneName, put Underwater; under ZoneInfo set bWaterZone=True, etc.

So no don't alter the PressureZone code.
User avatar
[NBK]DxTrEm3Fx
Adept
Posts: 259
Joined: Wed May 09, 2012 5:56 pm
Location: Glendale, AZ
Contact:

Re: Water/Pressure Zone

Post by [NBK]DxTrEm3Fx »

OjitroC wrote: Sun Feb 05, 2023 9:57 pm I'm pretty sure that Buggie means replace the relevant default properites in your Pressure Zone in the map (in the toilet) with those Water Zone properties. So, for example, under LocationString->ZoneName, put Underwater; under ZoneInfo set bWaterZone=True, etc.

So no don't alter the PressureZone code.
That works perfectly. Thank you OjitroC. Hopefully, I'm not wearing out my welcome by asking so many questions. :oops:
Image
Image
User avatar
OjitroC
Godlike
Posts: 3605
Joined: Sat Sep 12, 2015 8:46 pm

Re: Water/Pressure Zone

Post by OjitroC »

[NBK]DxTrEm3Fx wrote: Sun Feb 05, 2023 10:28 pm That works perfectly. Thank you OjitroC. Hopefully, I'm not wearing out my welcome by asking so many questions. :oops:
No, we're here to help where we can - anyway we're looking forward to your bathroom map :P
User avatar
[NBK]DxTrEm3Fx
Adept
Posts: 259
Joined: Wed May 09, 2012 5:56 pm
Location: Glendale, AZ
Contact:

Re: Water/Pressure Zone

Post by [NBK]DxTrEm3Fx »

@OjitroC Thank you. I'm plugging away on it. I was reading the Known UT engine limits post and now worrying about some of my large texture sizes 4096x2048 :facepalm: :loool: I'll be testing it on my server with 16 bots and or human players.
Image
Image
Buggie
Godlike
Posts: 2698
Joined: Sat Mar 21, 2020 5:32 am

Re: Water/Pressure Zone

Post by Buggie »

If you use mipmaps then you safe. Render pick what able handle usually.
User avatar
[NBK]DxTrEm3Fx
Adept
Posts: 259
Joined: Wed May 09, 2012 5:56 pm
Location: Glendale, AZ
Contact:

Re: Water/Pressure Zone

Post by [NBK]DxTrEm3Fx »

Buggie wrote: Mon Feb 06, 2023 1:21 am If you use mipmaps then you safe. Render pick what able handle usually.
I typically check the Gen MipMaps box when importing textures and do not touch DXT compression. Do I need to worry about DXT compression?
Image
Image
Buggie
Godlike
Posts: 2698
Joined: Sat Mar 21, 2020 5:32 am

Re: Water/Pressure Zone

Post by Buggie »

No. Your approach is pretty fine.
User avatar
[NBK]DxTrEm3Fx
Adept
Posts: 259
Joined: Wed May 09, 2012 5:56 pm
Location: Glendale, AZ
Contact:

Re: Water/Pressure Zone

Post by [NBK]DxTrEm3Fx »

Thank you for all the help on this. It works well. Nali Priest in place of a redeemer for testing purposes and effect. Don't Get Flushed out being a Deemer whore.
Image
Image
Post Reply