RuneI
Class ZoneTemplateTrigger

source: c:\runehov\RuneI\Classes\ZoneTemplateTrigger.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Triggers
         |
         +--Engine.Trigger
            |
            +--RuneI.ZoneTemplateTrigger
Direct Known Subclasses:None

class ZoneTemplateTrigger
extends Engine.Trigger

//============================================================================= // ZoneTemplateTrigger. //=============================================================================
Variables
 byte AmbientBrightness
           Fires when the player dies in this zone
 byte AmbientHue
           Fires when the player dies in this zone
 byte AmbientSaturation
           Fires when the player dies in this zone
 float DamagePerSec
 name DamageType
 class EntryActor
           e.g. a splash (only if water zone)
 sound EntrySound
           e.g. a splash (only if water zone)
 class ExitActor
           e.g. a splash (only if water zone)
 sound ExitSound
           Fires when the player dies in this zone
 byte FogBrightness
           Fires when the player dies in this zone
 float FogDistance
           Fires when the player dies in this zone
 byte FogHue
           Fires when the player dies in this zone
 byte FogSaturation
           Fires when the player dies in this zone
 float TexUPanSpeed
           Fires when the player dies in this zone
 float TexVPanSpeed
           Fires when the player dies in this zone
 vector ViewFlash
           Fires when the player dies in this zone
 vector ViewFog
           Fires when the player dies in this zone
 vector ZoneGravity
           Fires when the player dies in this zone
 name ZonePlayerDiedEvent
           Fires when the player dies in this zone
 vector ZoneVelocity
           Fires when the player dies in this zone
 bool bFarClipZone
 bool bFogZone
 bool bGravityZone
 bool bKillZone
 bool bMoveProjectiles
 bool bNeutralZone
 bool bNoInventory
 bool bPainZone
 bool bTakeOverCamera
 bool bWaterZone


Function Summary
 void Trigger(Actor Cause, Pawn EventInstigator)
     
//--------------------------------------------------------
//
// Trigger
//
//--------------------------------------------------------
 void TriggerAction(Actor Receiver, Actor Cause, Pawn EventInstigator)
     
//--------------------------------------------------------
//
// TriggerAction
//
//--------------------------------------------------------
 void UnTriggerAction(Actor Receiver, Actor Cause, Pawn EventInstigator)
     
//--------------------------------------------------------
//
// UnTriggerAction
//
//--------------------------------------------------------



Source Code


00001	//=============================================================================
00002	// ZoneTemplateTrigger.
00003	//=============================================================================
00004	class ZoneTemplateTrigger expands Trigger;
00005	
00006	var() bool bFarClipZone;
00007	var() bool bFogZone;
00008	var() bool bGravityZone;
00009	var() bool bKillZone;
00010	var() bool bMoveProjectiles;
00011	var() bool bNeutralZone;
00012	var() bool bNoInventory;
00013	var() bool bPainZone;
00014	var() bool bTakeOverCamera;
00015	var() bool bWaterZone;
00016	var() float DamagePerSec;
00017	var() name DamageType;
00018	var() class<actor> EntryActor;	// e.g. a splash (only if water zone)
00019	var() sound EntrySound;
00020	var() class<actor> ExitActor;	// e.g. a splash (only if water zone)
00021	var() name ZonePlayerDiedEvent;	// Fires when the player dies in this zone
00022	var() sound ExitSound;
00023	var() vector ZoneGravity;
00024	var() vector ZoneVelocity;
00025	var() byte AmbientBrightness;
00026	var() byte AmbientHue;
00027	var() byte AmbientSaturation;
00028	var() byte FogHue;
00029	var() byte FogBrightness;
00030	var() byte FogSaturation;
00031	var() float FogDistance;
00032	var() float TexUPanSpeed;
00033	var() float TexVPanSpeed;
00034	var() vector ViewFlash;
00035	var() vector ViewFog;
00036	
00037	//--------------------------------------------------------
00038	//
00039	// Trigger
00040	//
00041	//--------------------------------------------------------
00042	
00043	function Trigger(actor Cause, Pawn EventInstigator)
00044	{
00045		local actor A;
00046		
00047		// Broadcast the Trigger message to all matching actors.
00048		if( Event != '' )
00049			foreach AllActors( class 'Actor', A, Event )
00050				TriggerAction(A, Cause, EventInstigator);
00051	}
00052	
00053	
00054	//--------------------------------------------------------
00055	//
00056	// TriggerAction
00057	//
00058	//--------------------------------------------------------
00059	function TriggerAction(actor Receiver, actor Cause, Pawn EventInstigator)
00060	{
00061		local ZoneInfo Z;
00062		local ZoneInfo Temp;
00063		local Actor A;
00064		local Pawn P;
00065	
00066		Z = ZoneInfo(Receiver);
00067		if (Z != None)
00068		{
00069			// TODO:  Any additional zoneinfo vars needed for this?
00070			
00071			// Copy all relevant data from the template		
00072			Z.bFarClipZone 		= bFarClipZone;
00073			Z.bFogZone 			= bFogZone;
00074			Z.bGravityZone 		= bGravityZone;
00075			Z.bKillZone			= bKillZone;
00076			Z.bMoveProjectiles	= bMoveProjectiles;
00077			Z.bNeutralZone		= bNeutralZone;
00078			Z.bNoInventory		= bNoInventory;
00079			Z.bPainZone			= bPainZone;
00080			Z.bTakeOverCamera	= bTakeOverCamera;
00081			Z.bWaterZone 		= bWaterZone;
00082			Z.DamagePerSec		= DamagePerSec;
00083			Z.DamageType		= DamageType;
00084			Z.EntryActor 		= EntryActor;
00085			Z.EntrySound		= EntrySound;
00086			Z.ExitActor			= ExitActor;
00087			Z.ExitSound			= ExitSound;
00088			Z.ZoneGravity		= ZoneGravity;
00089			Z.ZoneVelocity		= ZoneVelocity;
00090			Z.AmbientBrightness = AmbientBrightness;
00091			Z.AmbientHue		= AmbientHue;
00092			Z.AmbientSaturation = AmbientSaturation;
00093			Z.FogHue			= FogHue;
00094			Z.FogBrightness		= FogBrightness;
00095			Z.FogSaturation		= FogSaturation;
00096			Z.FogDistance		= FogDistance;
00097			Z.TexUPanSpeed		= TexUPanSpeed;
00098			Z.TexVPanSpeed		= TexVPanSpeed;
00099			Z.ViewFlash			= ViewFlash;
00100			Z.ViewFog			= ViewFog;
00101			Z.ZonePlayerDiedEvent = ZonePlayerDiedEvent;
00102	
00103			// Send a ZoneChange message to all actors within this zone			
00104			foreach AllActors(class'Actor', A)
00105			{
00106				if(A.Region.Zone == Z)
00107				{ // This actor is in the current zone, so send a ZoneChange message
00108					Z.ActorLeaving(A);
00109					A.ZoneChange(Z);
00110					Z.ActorEntered(A);
00111				}
00112	
00113				// Send head/foot zone changes for Pawns
00114				if(A.IsA('Pawn'))
00115				{
00116					P = Pawn(A);
00117					if(P.HeadRegion.Zone == Z)
00118					{
00119						P.HeadZoneChange(Z);
00120					}
00121					if(P.FootRegion.Zone == Z)
00122					{
00123						P.FootZoneChange(Z);
00124					}
00125				}
00126			}
00127		}
00128	}
00129	
00130	
00131	//--------------------------------------------------------
00132	//
00133	// UnTriggerAction
00134	//
00135	//--------------------------------------------------------
00136	function UnTriggerAction(actor Receiver, actor Cause, Pawn EventInstigator)
00137	{
00138	}
00139	
00140	defaultproperties
00141	{
00142	     ZoneGravity=(Z=-1150.000000)
00143	     AmbientSaturation=255
00144	     TexUPanSpeed=1.000000
00145	     TexVPanSpeed=1.000000
00146	}

End Source Code