XIDPawn
Class Detectionvolume

source: C:\XIII\XIDPawn\Classes\DetectionVolume.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Brush
         |
         +--Engine.Volume
            |
            +--XIDPawn.Detectionvolume
Direct Known Subclasses:None

class Detectionvolume
extends Engine.Volume

//============================================================================= // detectionvolume. //=============================================================================
Variables
 XIIIPawn PersoEnContact
           fait localiser l'enemy
 bool bActivated
 bool bLocalizeEnemy
           fait localiser l'enemy
 bool bPawnActivable
           si vrai activable par pawn sinon par joueur


Function Summary
 XIIIPawn CheckTouchList()
 void Trigger(Actor Other, Pawn EventInstigator)
     
// When detectionvolume is triggered...
//
 void Trigger(Actor Other, Pawn EventInstigator)
     
// When detectionvolume is triggered...
//



Source Code


00001	//=============================================================================
00002	// detectionvolume.
00003	//=============================================================================
00004	class Detectionvolume extends Volume;
00005	
00006	
00007	var bool bActivated;
00008	var() bool bPawnActivable; //si vrai activable par pawn sinon par joueur
00009	var() bool bLocalizeEnemy; // fait localiser l'enemy
00010	var() XIIIpawn PersoEnContact;
00011	
00012	ignores touch;
00013	
00014	//-----------------------------------------------------------------------------------
00015	//-----------------------------------------------------------------------------------
00016	//Detection quand perso rentre dans volume
00017	//
00018	state() Detection
00019	{
00020	
00021		function Trigger( actor Other, pawn EventInstigator )
00022		{
00023		}
00024		//_______________________________________________________________
00025		// When detectionvolume is triggered...
00026		event Touch( actor Other)
00027		{
00028			if (xiiipawn(Other)!=none && !bActivated && ((xiiipawn(Other).controller.bIsPlayer && !bPawnActivable) || (!xiiipawn(Other).controller.bIsPlayer && bPawnActivable)))
00029			{
00030				//log(self$"!!!!  Entered volume   !!!!");
00031				bActivated=true;
00032				instigator=xiiipawn(Other);
00033				TriggerEvent(Event, Self, instigator);
00034			}
00035		}
00036	begin:
00037	}
00038	
00039	function xiiipawn CheckTouchList()
00040	{
00041		local XIIIpawn P;
00042	
00043		ForEach TouchingActors(class'XIIIpawn', P)
00044			return P;
00045	}
00046	
00047	// When detectionvolume is triggered...
00048	//
00049	function Trigger( actor Other, pawn EventInstigator )
00050	{
00051		Instigator = EventInstigator;
00052		PersoEnContact=CheckTouchList();
00053		if (PersoEnContact!=none)
00054		{
00055			if (!bActivated && ((PersoEnContact.controller.bIsPlayer && !bPawnActivable) || (!PersoEnContact.controller.bIsPlayer && bPawnActivable)))
00056	       	{
00057				bActivated=true;
00058				instigator=PersoEnContact;
00059				TriggerEvent(Event, Self, instigator);
00060			}
00061		}
00062		gotostate('Detection');
00063	}
00064	
00065	
00066	
00067	defaultproperties
00068	{
00069	     bStatic=False
00070	     bAlwaysRelevant=True
00071	     InitialState="Detection"
00072	     CollisionRadius=126.000000
00073	     CollisionHeight=126.000000
00074	}

End Source Code