// 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. class LeveeFailureErosionOuterFloatingWaste extends LeveeFailure placeable; #exec OBJ LOAD FILE=NatureSM.usx function SetFailureOptions() { /// Failure information: Mechanism = FM_ErosionOuterFloatingWaste; LinkedTile.Mechanism = Mechanism; LinkedTile.CurrentState = STA_Critical; LinkedTile.bCritical=true; LinkedTile.bRelevant=true; LinkedTile.bReportable=true; log("*************Set the name different******************"); NL_FailureName = "Erosie Buitentalud drijf vuil"; EN_FailureName = "Erosion Outer floating waste"; //Show our own staticmesh: self.LinkedTile.bHidden = false; self.LinkedTile.SetCollision(true,true,true); super.SetFailureOptions(); } function CreateObjects() { local DynamicMover M; local float exrotation; local rotator crot; // local DynVariableTimedMover Mv; //local DynamicMeshActor sMA; /// ID is the same as the linked object: id = LinkedTile.Name; /// Creating World Objects: /// For the record: The likely center is: 15280.00,2608.00,144.00 /// For the record: The likely center rotation: 10240,57344,0 /// Set relative rotation, the original failure was based on a rotation of 8192. So now we need to turn it back. // SetFailureRelativeRotation(0); exrotation = 0; Log(LinkedTile); Log(LinkedTile.Rotation.Yaw); if (Linkedtile.Rotation.Yaw == 32768 || Linkedtile.Rotation.Yaw == -32768) { /// Really the best way: M = CreateMover(RotateVector(1652.0,-600,360.00), id$"Driftwood", StaticMesh'NatureSM.DeadTrees.TreeTrunk1' , 4.00, 2); M.SetDrawScale(2.00); M.SetKeyPos( RotateVectorNoLocation(0.00,4.00,-628.00), 1); M.SetKeyRot( rot(2048,0,1024), 1); crot = rot ( 89179,-38072,-7644); M.SetRotation(crot); M = CreateMover(RotateVector(1792.0,-750,355.00), id$"Driftwood", StaticMesh'NatureSM.DeadTrees.TreeTrunk1' , 2.00, 2); M.SetDrawScale(2.00); M.SetKeyPos( RotateVectorNoLocation(0.00,4.00,-528.00), 1); M.SetKeyRot( rot(2048,0,1024), 1); crot = rot ( 3667,34888,4944); M.SetRotation( crot); M = CreateMover(RotateVector(1840.0,-850,355.00), id$"Driftwood", StaticMesh'NatureSM.DeadTrees.TreeTrunk1' , 4.00, 2); M.SetDrawScale(1.80); M.SetKeyPos( RotateVectorNoLocation(0.0,4.00,-528.00), 1); M.SetKeyRot( rot(2048,0,1024), 1); crot = rot ( -1957,2124, -3712); M.SetRotation( crot); M = CreateMover(RotateVector(2200.0,-820,200.00), id$"Driftwood", StaticMesh'NatureSM.Trees.Winter_tree3' , 4.00, 2); M.SetDrawScale(1.50); M.SetKeyPos( RotateVectorNoLocation(0.00,0.00,-696.00), 1); M.SetKeyRot( rot(0,0,0), 1); crot = rot (11475,-11836,-248); M.SetRotation( crot); } else { M = CreateMover(RotateVector(1602.0,-500,427.00), id$"Driftwood", StaticMesh'NatureSM.DeadTrees.TreeTrunk1' , 4.00, 2); M.SetDrawScale(2.00); M.SetKeyPos( RotateVectorNoLocation(0.00,4.00,-628.00), 1); M.SetKeyRot( rot(2048,0,1024), 1); crot = rot ( 0,11264,-3800); M.SetRotation(crot); M = CreateMover(RotateVector(1792.0,-750,365.00), id$"Driftwood", StaticMesh'NatureSM.DeadTrees.TreeTrunk1' , 2.00, 2); M.SetDrawScale(2.00); M.SetKeyPos( RotateVectorNoLocation(0.00,4.00,-528.00), 1); M.SetKeyRot( rot(2048,0,1024), 1); crot = rot ( 0,15360,-4100); M.SetRotation( crot); M = CreateMover(RotateVector(1840.0,-850,370.00), id$"Driftwood", StaticMesh'NatureSM.DeadTrees.TreeTrunk1' , 4.00, 2); M.SetDrawScale(1.80); M.SetKeyPos( RotateVectorNoLocation(0.0,4.00,-528.00), 1); M.SetKeyRot( rot(2048,0,1024), 1); crot = rot ( 0,10240,-4100); M.SetRotation( rot ( 0,10240,-4100)); M = CreateMover(RotateVector(2200.0,-820,200.00), id$"Driftwood", StaticMesh'NatureSM.Trees.Winter_tree3' , 4.00, 2); M.SetDrawScale(1.50); M.SetKeyPos( RotateVectorNoLocation(0.00,0.00,-696.00), 1); M.SetKeyRot( rot(0,0,0), 1); crot = rot (8240,0,0); M.SetRotation( crot); } /// Call parent: Super.CreateObjects(); } function ActivateFailures(bool bActiveTemp) { /// Call parent first: super.ActivateFailures(bActiveTemp); /// Show our own staticmesh: self.LinkedTile.bHidden = false; self.LinkedTile.SetCollision(true,true,true); /// Display items normally hidden (since we only place trees) OnlyVisibleIfNotActive.bForceSameLocation = true; OnlyVisibleIfNotActive.SetVisible(); self.LinkedTile.CurrentState = STA_Critical; } function CreateTriggers() { local DScriptedTrigger sT; sT = Spawn(class'DScriptedTrigger'); /// Tag is the same as the linked object name: sT.Tag = GetFailureName(); FailureScript = sT; /// Store in public leveetile var. sT.Actions[0] = new class'ACTION_WaitForTimer'; ACTION_WaitForTimer(sT.Actions[0]).PauseTime = 10.00 * speedfactor; sT.Actions[1] = new class'ACTION_IfActive'; ACTION_IfActive(sT.Actions[1]).FailureTag = GetName(id$""); sT.Actions[3] = new class'ACTION_IfRelevant'; ACTION_IfRelevant(sT.Actions[3]).FailureTag = GetName(id$""); sT.Actions[4] = new class'ACTION_WaitForTimer'; ACTION_WaitForTimer(sT.Actions[4]).PauseTime = 1.00 * speedfactor; sT.Actions[5] = new class'ACTION_IfCritical'; ACTION_IfCritical(sT.Actions[5]).FailureTag = GetName(id$""); /// Position is the same as the linked object: sT.SetLocation(LinkedTile.Location); } function CreateSignals() { local SignalFloatingWaste signal0; local SignalReportFloatingWaste signal0report0; /// Signals information: Signals.Insert(0,1); signal0 = new class'SignalFloatingWaste'; signal0.CrossCutLocation=CUT_OuterSlope; signal0.FirstState = STA_Critical; signal0.RiskCause = RISK_FloatingWaste; signal0.SignalReports.insert(0,1); signal0report0 = New class'SignalReportFloatingWaste'; signal0report0.GeoState = STA_Critical; signal0.SignalReports[0] = signal0report0; Signals[0] = signal0; } function CreateMeasures() { local Measure Msr; /// Creating measures: Measures.Insert(0,1); Msr = New class'Measure'; Msr.SetPropertyText("EventMeasureTaken", id$"Driftwood"); Msr.bMeasureEffective = True; Msr.MeasureType = MEA_Removewaste; Measures[0] = Msr; } function CreateMeasureScripts() { local DScriptedTrigger sT; sT = Spawn(class'DScriptedTrigger'); /// Position is the same as the linked object: sT.SetLocation(LinkedTile.Location); /// Trying to write down extra measure scriptedtriggers /// Trying to find: Driftwood sT.Actions.insert(0, 3); sT.Actions[0] = new class'ACTION_WaitForEvent'; ACTION_WaitForEvent(sT.Actions[0]).ExternalEvent = GetName(id$"Driftwood"); sT.Actions[1] = new class'ACTION_WaitForTimer'; ACTION_WaitForTimer(sT.Actions[1]).PauseTime = 4.00 * speedfactor; sT.Actions[2] = new class'ACTION_SetHidden'; ACTION_SetHidden(sT.Actions[2]).HideActorTag = GetName(id$"Driftwood"); ACTION_SetHidden(sT.Actions[2]).bHidden = True; }