// September 2015 // Levee Patroller / Dijk Patrouille // This source file is (c) by Deltares. This source file is open source but only available to select users. Do not redistribute without written permission of Stichting Deltares, Delft, The Netherlands. // This header has been automatically generated. //============================================================================= // This MARKER is summoned in the game to mark a volume with a possible failure // It will also be responsible for the report // It will be visible when player put it there // ------------------------------------------------------------ // Created by Rui Guimaraes // © 2006, Geodelft // // 2006-09-13 gui Corrected problem of having several markers close by // And optimized calling of funtions (no longer using Command // Console command on Touch and UnTouch) // 2006-10-06 The Implemented correction for small distances so width of // cracks will be more realistic //============================================================================= class YellowMarker extends Marker notplaceable; //CHANGE FOR STATIC MESH WE WANT #exec OBJ LOAD FILE=GeoGamePlay.usx const SHORTDISTANCE_THRESHOLD = 50; // cm const SHORTDISTANCE_DIVIDER = 5; var localized string MarkerName; // String with message to appear as marker name var YellowMarker OtherMarker; var int CurrentDist, PreviousDist, CurrentHeight, PreviousHeight; //============================================================================= // Date Id Modification // 2006-10-06 The Created //============================================================================= function PostBeginPlay() { Super.PostBeginPlay(); } //============================================================================= // Date Id Modification // 2006-10-06 The Created //============================================================================= function Touch(Actor Other) { Super.Touch(Other); if ( GeoPlayerController(Pawn(Other).Controller) != None) { GeoPlayerController(Pawn(Other).Controller).NearMarker(self, false); } //log(OtherMarker.Name); } //============================================================================= // Date Id Modification // 2006-10-06 The Created //============================================================================= function UnTouch(Actor Other) { Super.UnTouch(Other); if ( GeoPlayerController(Pawn(Other).Controller) != None) { GeoPlayerController(Pawn(Other).Controller).AwayFromMarker(self, false); } } //============================================================================= // Date Id Modification // 2006-10-06 The Created //============================================================================= // returns true when other isn't none //============================================================================= function bool SetOtherMarker(YellowMarker Other) { OtherMarker=Other; if(OtherMarker != none) { return true; }else { return false; } } //============================================================================= // Date Id Modification // 2006-10-06 The Created //============================================================================= function float SmallDistanceCorrection(float ADistance) { local float LNewDistance; LNewDistance = ADistance; if (LNewDistance < SHORTDISTANCE_THRESHOLD) { LNewDistance = LNewDistance / SHORTDISTANCE_DIVIDER; } return LNewDistance; } //============================================================================= // Date Id Modification // 2006-10-06 The Created //============================================================================= function bool UpdateDistanceToOtherMarker() { local float DistUnrealUnit; local float HeightUnrealUnit; //local int DistCm; if (OtherMarker != None && OtherMarker != Self) { DistUnrealUnit=Abs(VSize(Location - OtherMarker.Location)); HeightUnrealUnit=Abs(Location.Z - OtherMarker.Location.Z); PreviousDist=CurrentDist; PreviousHeight=CurrentHeight; CurrentHeight=HeightUnrealUnit * (100.0 / 128.0); // Convert to cm CurrentDist=DistUnrealUnit * (100.0 / 128.0); // Convert to cm /* Correction for small distances so width of cracks will be more realistic * this hack was found unnecessary with newer cracks * CurrentDist = SmallDistanceCorrection(CurrentDist); */ return true; } else { PreviousDist=CurrentDist; CurrentDist=0; return false; } } //============================================================================= // Date Id Modification // 2006-10-06 The Created //============================================================================= function LocationNameSign CheckLocationSign() { local bool FirstSign; local actor A; local float TempDist; local LocationNameSign MyLocationSign; // CHECK THE CLOSEST LOCATION SIGN FirstSign = true; foreach DynamicActors( class 'Actor', A, 'LocationNameSign') if((TempDist > Abs(VSize(Location - A.Location))) || FirstSign) { MyLocationSign=LocationNameSign(A); TempDist = Abs(VSize(Location - A.Location)); FirstSign = false; } return MyLocationSign; } //============================================================================= // Date Id Modification // 2006-10-06 The Created //============================================================================= defaultproperties { bstatic=false bGameRelevant=true bBlockPlayers=false bUseCylinderCollision=true CollisionHeight=200.0 // Check for ideal sizes CollisionRadius=200.0 // Check for ideal sizes DrawScale=2.5 bTriggerOnceOnly=false Event=GeoPlayer //CHANGE FOR STATIC MESH WE WANT StaticMesh=StaticMesh'GeoGamePlay.Markers.YellowMarker' DrawType=DT_StaticMesh MarkerName="Damage Marker" }