// 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. //============================================================================= // Node to place droogte problems (blauwalg, ducks) //============================================================================= class DroogteNode extends PathNode; Enum DroogteNodeType { Type_None, Type_BlauwAlg, Type_Duck, }; var DroogteNodeType activestate; function DroogteNodeType GetState() { return activestate; } function PreBeginPlay () { CreateDucks(); CreateBlauwalg(); } function CreateDucks() { local vector HitLocation, HitNormal; local vector start, end; local Actor temp; local Rotator newrot; local GeoDeadDuck duck; local int duckcount; local int i; newrot = rot(0,0,0); duckcount = 1 + Rand(2); //GeoDeadDuck.uc while (i < duckcount) { start = (vect(0,0,1)*128)+Location; /// Add random position start.x += -4096 + Rand(8096); start.y += -4096 + Rand(8096); end = vect(0,0,-1)*512+start; foreach TraceActors ( class'Actor', temp, HitLocation,HitNormal,end, start) { Log("Traced actor: " $ temp); // newrot = rotator(HitNormal); //rotator(Location - HitLocation); //newrot.Roll -= 16384; if (temp.IsA('StaticMeshActor') || temp.IsA('TerrainInfo') || temp.IsA('Leveetile') ) { Log("Use actor: " $ temp); activestate = Type_Duck; // newrot.Yaw += Rand(32768); duck = (Spawn( class'GeoDeadDuck',,,HitLocation + vect(0,0, 2), newrot)); /// Increase OK count: i++; break; } else { break; } } } } function CreateBlauwalg() { local vector HitLocation, HitNormal; local vector start; local FluidSurfaceInfo temp; local Rotator newrot; local GeoBlauwAlg alg; local GeoDeadFish fish; local vector offset; local int fishcount; local int i; newrot = rot(0,0,0); fishcount = 2 + Rand(3); /// Test 1, spawn blauwalg below at water: start = (vect(0,0,1)*128)+Location; foreach TraceActors ( class'FluidSurfaceInfo', temp, HitLocation,HitNormal,vect(0,0,-1)*512+Location, start) { Log("Traced actor: " $ temp); activestate = Type_BlauwAlg; newrot.Yaw += Rand(32768); alg = (Spawn( class'GeoBlauwAlg',,,HitLocation + vect(0,0, 2), newrot)); alg.AttachTag = temp.Tag; newrot.Yaw += Rand(32768); alg = (Spawn( class'GeoBlauwAlg',,,HitLocation + vect(64,0, 2), newrot)); alg.AttachTag = temp.Tag; /// Spawn fish: for (i = 0; i < fishcount; i++) { offset.x = -250 + Rand(400); offset.y = -250 + Rand(400); offset.z = -4; newrot = Rotation; newrot.Roll += Rand(32768); newrot.Yaw += Rand(32768); fish = (Spawn( class'GeoDeadFish',,,HitLocation + offset, newrot)); fish.AttachTag = temp.Tag; } break; } } defaultproperties { bNoAutoConnect=True bNotBased=True CollisionRadius=256.000000 Texture=Texture'Droogte.Editor.icon_droogte' }