// // CPT operator / SondeerGame // This source file is (c) by Deltares. // - October 2014 // class dialogStartSondering extends GeoGUIPage config(GeoUser); #exec OBJ LOAD FILE=HumanLandscapeSM.usx var automated GeoFrame DialogBackground; var automated GeoButton StartSonderenButton; var automated GeoButton IgnoreButton; function bool ButtonClick(GUIComponent Sender) { local SondeerWagenInterior node; local SondeerWagenInterior found; local vector vpos; local rotator rrot, playerrot; local DynamicMeshActor A; if (Sender == Ignorebutton) { Log("Ignoring"); GeoPC.SondeerLocationToSkip = GeoPC.CurrentSondeerLocation; Controller.CloseMenu(false); } else if (Sender == StartSonderenButton) { Log("Start sonderen"); /// Change sondeer wagen physics: GeoPC.Pawn.SetDrawType(DT_None); GeoPC.Pawn.SetCollision(false,false,false); //SetCollision( optional bool NewColActors, optional bool NewBlockActors, optional bool NewBlockPlayers ); GeoPC.LeaveVehicle(); /// jln - 02-10-2008 Place new sondeer location: vpos = GeoPC.Pawn.Location; //vpos.z -= 190; rrot = GeoPC.Pawn.Rotation; rrot.Yaw -=16384; /// Just divide it by 4 to smooth it a bit: rrot.Pitch /= 10; rrot.Roll /= 10; if (GeoPC.CompanyName == "Deltares" || GeoPC.CompanyName == "A.P. van den Berg") { node = GeoPC.Spawn(class'SondeerWagenInterior', None,, vpos, rrot); } else if (GeoPC.CompanyName == "Geomil") { node = GeoPC.Spawn(class'SondeerWagenInterior_GeoMil', None,, vpos, rrot); } else if (GeoPC.CompanyName == "Fugro") { node = GeoPC.Spawn(class'SondeerWagenInterior_Fugro', None,, vpos, rrot); } else { /// Just in case: node = GeoPC.Spawn(class'SondeerWagenInterior', None,, vpos, rrot); } /// jln - 17-11-2008 (SONDEER-59) /// Remove reflector pols in the nearby area (otherwise they show up inside the interior ForEach GeoPC.RadiusActors(class'DynamicMeshActor', a, 2000, vpos) { // Log("Mesh: " @ a @ " - " @ a.StaticMesh); if (a.StaticMesh == StaticMesh'HumanLandscapeSM.ConstructionStuff.ReflectorPole') { // Log("Found: " @ a); a.bHidden = true; } } /// SondeerWagenInterior does not exist, cheat using tag! node.tag = 'SondeerWagenInterior'; /// Find Sondeer location // { /// Found? /// Exit car. vpos = node.Location; vpos.z += 200; found = node; Log("Found: " @ node @ " - " @ vpos); GeoPC.SetLocation(vpos); if (GeoPC.Pawn != None) { /// Let player face front: (and reset yaw); playerrot = rrot; playerrot.pitch = 0; playerrot.roll = 0; playerrot.Yaw /= 2; GeoPC.Pawn.SetRotation(playerrot); GeoPC.Pawn.SetLocation(vpos); } //} GeoPC.FindAndHide("dialogStartSondering"); GeoPC.GotoState('PlayerMousing'); /// Phase 2: GeoPC.ClientOpenMenu("GeoInterface.dialogPhaseIntro", false, "Phase3"); } return true; } defaultproperties { AllowSelect=false bAllowedAsLast=true bDisconnectOnOpen=false bPersistent=false bNeverFocus=true Begin Object Class=GeoFrame name=TDialogBackground WinLeft=0.0 WinTop=0.375 WinWidth=1.0 WinHeight=0.25 End Object Begin Object Class=GeoButton Name=TStartSonderenButton OnClick=ButtonClick IniOption="TStartSonderenButton" WinWidth=0.2 WinLeft=0.5 WinTop=0.475 End Object Begin Object Class=GeoButton Name=TIgnoreButton OnClick=ButtonClick IniOption="TIgnoreButton" WinWidth=0.10 WinLeft=0.34 WinTop=0.475 bVisible=true bNeverFocus=true End Object DialogBackground=TDialogBackground StartSonderenButton=TStartSonderenButton IgnoreButton=TIgnoreButton }