


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.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) }
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)
}
That works perfectly. Thank you OjitroC. Hopefully, I'm not wearing out my welcome by asking so many questions.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.
No, we're here to help where we can - anyway we're looking forward to your bathroom map[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.![]()
I typically check the Gen MipMaps box when importing textures and do not touch DXT compression. Do I need to worry about DXT compression?