Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 |
/** * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved. */ class Trigger_LOS extends Trigger; /** * Overridden to check for any players looking at this * trigger. */ simulated event Tick(float DeltaTime) { local array<SequenceEvent> losEvents; local SeqEvent_LOS evt; local PlayerController Player; local int idx; local vector cameraLoc; local rotator cameraRot; local float cameraDist; // if any valid los events are attached, if (FindEventsOfClass(class'SeqEvent_LOS',losEvents)) { // look through each player foreach WorldInfo.AllControllers(class'PlayerController', Player) { if (Player.Pawn != None) { player.GetPlayerViewPoint(cameraLoc, cameraRot); cameraDist = PointDistToLine(Location,vector(cameraRot),cameraLoc); // iterate through each event and see if this meets the activation requirements for (idx = 0; idx < losEvents.Length; idx++) { evt = SeqEvent_LOS(losEvents[idx]); if (cameraDist <= evt.ScreenCenterDistance && VSize(player.Pawn.Location-Location) <= evt.TriggerDistance && Normal(Location - cameraLoc) dot vector(cameraRot) > 0.f && (!evt.bCheckForObstructions || player.LineOfSightTo(self,cameraLoc))) { // attempt to activate the event losEvents[idx].CheckActivate(self,player.Pawn,false); } } } } } } defaultproperties { Begin Object Class=CylinderComponent Name=CollisionCylinder ObjName=CollisionCylinder Archetype=CylinderComponent'Engine.Default__Trigger:CollisionCylinder' ObjectArchetype=CylinderComponent'Engine.Default__Trigger:CollisionCylinder' End Object CylinderComponent=CollisionCylinder Begin Object Class=SpriteComponent Name=Sprite ObjName=Sprite Archetype=SpriteComponent'Engine.Default__Trigger:Sprite' ObjectArchetype=SpriteComponent'Engine.Default__Trigger:Sprite' End Object Components(0)=Sprite Components(1)=CollisionCylinder CollisionComponent=CollisionCylinder SupportedEvents(0)=Class'Engine.SeqEvent_LOS' Name="Default__Trigger_LOS" ObjectArchetype=Trigger'Engine.Default__Trigger' } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |