Engine
Class ZoneInfo

source: c:\runehov\Engine\Classes\ZoneInfo.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Info
         |
         +--Engine.ZoneInfo
Direct Known Subclasses:ArenaZone, QueueZone, LevelInfo, SkyZoneInfo, WarpZoneInfo, CloudZone, LokiBloodZone, ShredderZone, TeleporterZone, WaterZone

class ZoneInfo
extends Engine.Info

//============================================================================= // ZoneInfo, the built-in Unreal class for defining properties // of zones. If you place one ZoneInfo actor in a // zone you have partioned, the ZoneInfo defines the // properties of the zone. // This is a built-in Unreal class and it shouldn't be modified. //=============================================================================
Variables
 int DamagePerSec
           RUNE: Fires when the player dies in this zone
 string DamageString
           RUNE: Fires when the player dies in this zone
 name DamageType
           RUNE: Fires when the player dies in this zone
 class EntryActor
           e.g. a splash (only if water zone)
 sound EntrySound
           only if waterzone
 sound EntrySoundBig
           only if waterzone
 class ExitActor
           e.g. a splash (only if water zone)
 sound ExitSound
           only if waterzone
 LocationID LocationID
           RUNE: Fires when the player dies in this zone
 float MaxCameraDist
           RUNE: Maximum distance camera is allowed in this zone (zero denotes no change)
 int MaxCarcasses
           RUNE: Fires when the player dies in this zone
 byte MaxLightCount
           maximum number of lights to use (when MeshPolyCount drops below MinLightingPolyCount)
 int MaxLightingPolyCount
           maximum number of lights to use (when MeshPolyCount drops below MinLightingPolyCount)
 byte MinLightCount
           minimum number of lights to use (when MaxLightingPolyCount is exceeded)
 int MinLightingPolyCount
           maximum number of lights to use (when MeshPolyCount drops below MinLightingPolyCount)
 int NumCarcasses
           RUNE: Fires when the player dies in this zone
 SkyZoneInfo SkyZone
           Optional sky zone containing this zone's sky.
 name SkyZoneName
           RUNE: Maximum distance camera is allowed in this zone (zero denotes no change)
 float ZoneFluidFriction
 vector ZoneGravity
 float ZoneGroundFriction
 int ZonePlayerCount
           RUNE: Fires when the player dies in this zone
 name ZonePlayerDiedEvent
           RUNE: Fires when the player dies in this zone
 name ZonePlayerEvent
 name ZonePlayerExitEvent
           RUNE: Event to fire when player leaves this zone
 name ZoneTag
 float ZoneTerminalVelocity
 vector ZoneVelocity
 bool bBounceVelocity
           this velocity zone should bounce actors that land in it
 bool bDestructive
           Destroys carcasses.
 bool bFarClipZone
           Zone has a far-clip plane (uses FogDistance) (RUNE -- was const)
 bool bFogZone
           Zone is fog-filled. (RUNE -- was const)
 bool bGravityZone
           Use ZoneGravity.
 bool bKillZone
           Zone instantly kills those who enter. (RUNE -- was const)
 bool bLokiBloodZone
           RUNE: This zone contains Loki's blood
 bool bMoveProjectiles
           this velocity zone should impart velocity to projectiles and effects
 bool bNeutralZone
           Players can't take damage in this zone.
 bool bNoInventory
           Destroys carcasses.
 bool bPainZone
           Zone causes pain.
 bool bTakeOverCamera
           RUNE: Take over camera when player is in this zone
 bool bWaterZone
           Zone is water-filled.


Function Summary
 
simulated
LinkToSkybox()
     
//MWP:begin -- moved out of PreBeginPlay() to allow overriding
//=============================================================================
 
simulated
PreBeginPlay()
     
//=============================================================================
// Engine notification functions.
 void Trigger(Actor Other, Pawn EventInstigator)
 
simulated
debug(Canvas Canvas, int mode)
     
//============================================================
//
// Debug
//
//============================================================



Source Code


00001	//=============================================================================
00002	// ZoneInfo, the built-in Unreal class for defining properties
00003	// of zones.  If you place one ZoneInfo actor in a
00004	// zone you have partioned, the ZoneInfo defines the 
00005	// properties of the zone.
00006	// This is a built-in Unreal class and it shouldn't be modified.
00007	//=============================================================================
00008	class ZoneInfo extends Info
00009		native;
00010	//	nativereplication;
00011	
00012	#exec Texture Import File=Textures\ZoneInfo.pcx Name=S_ZoneInfo Mips=Off Flags=2
00013	
00014	//-----------------------------------------------------------------------------
00015	// Zone properties.
00016	
00017	var() name   ZoneTag;
00018	var() vector ZoneGravity;
00019	var() vector ZoneVelocity;
00020	var() float  ZoneGroundFriction;
00021	var() float  ZoneFluidFriction;
00022	var() float	 ZoneTerminalVelocity;
00023	var() name   ZonePlayerEvent;
00024	var() name   ZonePlayerExitEvent;	// RUNE: Event to fire when player leaves this zone
00025	var() name   ZonePlayerDiedEvent;	// RUNE: Fires when the player dies in this zone
00026	var   int    ZonePlayerCount;
00027	var   int	 NumCarcasses;
00028	var() int	 DamagePerSec;
00029	var() name	 DamageType;
00030	var() localized string DamageString;
00031	var(LocationStrings) localized string ZoneName;
00032	var LocationID LocationID;	
00033	var() int	 MaxCarcasses;
00034	var() sound  EntrySound;	// only if waterzone
00035	var() sound  EntrySoundBig;	// only if waterzone
00036	var() sound  ExitSound;		// only if waterzone
00037	var() class<actor> EntryActor;	// e.g. a splash (only if water zone)
00038	var() class<actor> ExitActor;	// e.g. a splash (only if water zone)
00039	var() bool   bTakeOverCamera;	// RUNE:  Take over camera when player is in this zone
00040	var() float	 MaxCameraDist;		// RUNE:  Maximum distance camera is allowed in this zone (zero denotes no change)
00041	var() name	 SkyZoneName;
00042	var skyzoneinfo SkyZone; // Optional sky zone containing this zone's sky.
00043	var()		bool   bBounceVelocity;		// this velocity zone should bounce actors that land in it
00044	
00045	//-----------------------------------------------------------------------------
00046	// Zone flags.
00047	
00048	var()		bool   bWaterZone;   // Zone is water-filled.
00049	var() 		bool   bFogZone;     // Zone is fog-filled.   (RUNE -- was const)
00050	var() 		bool   bFarClipZone; // Zone has a far-clip plane (uses FogDistance) (RUNE -- was const)
00051	var() 		bool   bKillZone;    // Zone instantly kills those who enter. (RUNE -- was const)
00052	var()		bool   bNeutralZone; // Players can't take damage in this zone.
00053	var()		bool   bGravityZone; // Use ZoneGravity.
00054	var()		bool   bPainZone;	 // Zone causes pain.
00055	var()		bool   bDestructive; // Destroys carcasses.
00056	var()		bool   bNoInventory;
00057	var()		bool   bMoveProjectiles;	// this velocity zone should impart velocity to projectiles and effects
00058	var()		bool   bLokiBloodZone; // RUNE:  This zone contains Loki's blood
00059	
00060	//-----------------------------------------------------------------------------
00061	// Zone light.
00062	
00063	var(ZoneLight) byte AmbientBrightness, AmbientHue, AmbientSaturation;
00064	var(ZoneLight) byte FogBrightness, FogHue, FogSaturation;
00065	//test var(ZoneLight) color FogColor;
00066	var(ZoneLight) float FogDistance;
00067	
00068	var(ZoneLight) const texture EnvironmentMap;
00069	var(ZoneLight) float TexUPanSpeed, TexVPanSpeed;
00070	var(ZoneLight) vector ViewFlash, ViewFog;
00071	
00072	//-----------------------------------------------------------------------------
00073	// Reverb.
00074	
00075	// Settings.
00076	var(Reverb) bool bReverbZone;
00077	var(Reverb) bool bRaytraceReverb;
00078	var(Reverb) float SpeedOfSound;
00079	var(Reverb) byte MasterGain;
00080	var(Reverb) int  CutoffHz;
00081	var(Reverb) byte Delay[6];
00082	var(Reverb) byte Gain[6];
00083	
00084	//MWP:begin
00085	//-----------------------------------------------------------------------------
00086	// Lens flare.
00087	
00088	var(LensFlare) texture LensFlare[12];
00089	var(LensFlare) float LensFlareOffset[12];
00090	var(LensFlare) float LensFlareScale[12];
00091	
00092	//-----------------------------------------------------------------------------
00093	// per-Zone mesh LOD lighting control
00094	 
00095	// the number of lights applied to the actor mesh is interpolated between the following
00096	// properties, as a function of the MeshPolyCount for the previous frame.
00097	var() byte MinLightCount; // minimum number of lights to use (when MaxLightingPolyCount is exceeded)
00098	var() byte MaxLightCount; // maximum number of lights to use (when MeshPolyCount drops below MinLightingPolyCount)
00099	var() int MinLightingPolyCount;
00100	var() int MaxLightingPolyCount;
00101	// (NOTE: the default LOD properties (below) have no effect on the mesh lighting behavior)
00102	//MWP:end
00103	
00104	//=============================================================================
00105	// Network replication.
00106	
00107	replication
00108	{
00109		reliable if( Role==ROLE_Authority )
00110			ZoneGravity, ZoneVelocity, 
00111			// ZoneTerminalVelocity,
00112			// ZoneGroundFriction, ZoneFluidFriction,
00113			AmbientBrightness, AmbientHue, AmbientSaturation,
00114			TexUPanSpeed, TexVPanSpeed,
00115			// ViewFlash, ViewFog, // Not replicated because vectors replicated with elements rounded to integers
00116			bReverbZone,
00117			MaxCameraDist, bTakeOverCamera,
00118			FogBrightness, FogHue, FogSaturation;
00119	//		FogColor;
00120	}
00121	
00122	//=============================================================================
00123	// Iterator functions.
00124	
00125	// Iterate through all actors in this zone.
00126	native(308) final iterator function ZoneActors( class<actor> BaseClass, out actor Actor );
00127	
00128	//MWP:begin -- moved out of PreBeginPlay() to allow overriding
00129	//=============================================================================
00130	simulated function LinkToSkybox()
00131	{
00132		local skyzoneinfo TempSkyZone;
00133	
00134		if(SkyZoneName != 'None')
00135		{
00136			foreach AllActors(class'SkyZoneInfo', TempSkyZone, SkyZoneName)
00137			{ // Found an actor who's TAG matches SkyZoneName, so use it
00138				SkyZone = TempSkyZone;
00139				return;
00140			}
00141		}
00142	
00143		// SkyZone.
00144		foreach AllActors( class 'SkyZoneInfo', TempSkyZone, '' )
00145			SkyZone = TempSkyZone;
00146		foreach AllActors( class 'SkyZoneInfo', TempSkyZone, '' )
00147			if( TempSkyZone.bHighDetail == Level.bHighDetailMode )
00148				SkyZone = TempSkyZone;
00149	}
00150	//MWP:end
00151	
00152	//=============================================================================
00153	// Engine notification functions.
00154	
00155	simulated function PreBeginPlay()
00156	{
00157		Super.PreBeginPlay();
00158	
00159		// call overridable function to link this ZoneInfo actor to a skybox
00160		LinkToSkybox();
00161	}
00162	
00163	function Trigger( actor Other, pawn EventInstigator )
00164	{
00165		if (DamagePerSec != 0)
00166			bPainZone = true;
00167	}
00168	
00169	// When an actor enters this zone.
00170	event ActorEntered( actor Other )
00171	{
00172		local actor A;
00173		local vector AddVelocity;
00174	
00175		if ( bNoInventory && Other.IsA('Inventory') && (Other.Owner == None) )
00176		{
00177			Other.LifeSpan = 1.5;
00178			return;
00179		}
00180	
00181		if( Pawn(Other)!=None && Pawn(Other).bIsPlayer )
00182			if( ++ZonePlayerCount==1 && ZonePlayerEvent!='' )
00183				foreach AllActors( class 'Actor', A, ZonePlayerEvent )
00184					A.Trigger( Self, Pawn(Other) );
00185	
00186		if ( bMoveProjectiles && (ZoneVelocity != vect(0,0,0)) )
00187		{
00188			if ( Other.Physics == PHYS_Projectile )
00189				Other.Velocity += ZoneVelocity;
00190			else if ( Other.IsA('Effects') && (Other.Physics == PHYS_None) )
00191			{
00192				Other.SetPhysics(PHYS_Projectile);
00193				Other.Velocity += ZoneVelocity;
00194			}
00195		}
00196	}
00197	
00198	// When an actor leaves this zone.
00199	event ActorLeaving( actor Other )
00200	{
00201		local actor A;
00202		if( Pawn(Other)!=None && Pawn(Other).bIsPlayer )
00203		{
00204			if( --ZonePlayerCount==0)
00205			{
00206				if ( ZonePlayerEvent!='' )
00207					foreach AllActors( class 'Actor', A, ZonePlayerEvent )
00208						A.UnTrigger( Self, Pawn(Other) );
00209	
00210				if( ZonePlayerExitEvent!='' )
00211					foreach AllActors( class 'Actor', A, ZonePlayerExitEvent )
00212						A.Trigger( Self, Pawn(Other) );
00213			}
00214		}
00215	}
00216	
00217	//============================================================
00218	//
00219	// Debug
00220	//
00221	//============================================================
00222	simulated function debug(canvas Canvas, int mode)
00223	{
00224		local int ix;
00225		local actor A;
00226	
00227		// put text here
00228		Canvas.DrawText("  NumCarcasses:    "$NumCarcasses);
00229		Canvas.CurY -= 8;
00230		Canvas.DrawText("  MaxCarcasses:    "$MaxCarcasses);
00231		Canvas.CurY -= 8;
00232	
00233		Super.Debug(Canvas, mode);	// Draws actor name
00234	
00235		// Draw graphics
00236		if (ZonePlayerEvent != '')
00237			foreach AllActors(class'Actor', A, ZonePlayerEvent)
00238				Canvas.DrawLine3D(Location, A.Location, 255, 255, 0);
00239	
00240		if (ZonePlayerExitEvent != '')
00241			foreach AllActors(class'Actor', A, ZonePlayerExitEvent)
00242				Canvas.DrawLine3D(Location, A.Location, 255, 0, 0);
00243	}
00244	
00245	defaultproperties
00246	{
00247	     ZoneGravity=(Z=-1150.000000)
00248	     ZoneGroundFriction=8.000000
00249	     ZoneFluidFriction=1.200000
00250	     ZoneTerminalVelocity=2500.000000
00251	     MaxCarcasses=3
00252	     bMoveProjectiles=True
00253	     AmbientSaturation=255
00254	     TexUPanSpeed=1.000000
00255	     TexVPanSpeed=1.000000
00256	     SpeedOfSound=8000.000000
00257	     MasterGain=100
00258	     CutoffHz=6000
00259	     Delay(0)=20
00260	     Delay(1)=34
00261	     Gain(0)=150
00262	     Gain(1)=70
00263	     MinLightCount=6
00264	     MaxLightCount=6
00265	     MinLightingPolyCount=1000
00266	     MaxLightingPolyCount=5000
00267	     bStatic=True
00268	     bNoDelete=True
00269	     bAlwaysRelevant=True
00270	     Texture=Texture'Engine.S_ZoneInfo'
00271	     NetUpdateFrequency=4.000000
00272	}

End Source Code