// 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 ACTION_MoveToPointSet extends LatentScriptedAction; var(Action) array DestinationTags; // tag of destination - if none, then use the ScriptedSequence var QAHashTable HashMap; function bool MoveToGoal() { return true; } function Actor GetMoveTargetFor(ScriptedController C) { local int DTag; local Actor Movetarget; if(HashMap == none) { HashMap = new class'QAHashTable'; } DTag = HashMap.GetValue(String(c.pawn.Name)); if(DTag == -1) { DTag = RandRange(0,DestinationTags.Length-1); HashMap.Add(String(c.pawn.Name),DTag); } //log("Sheeppie****"@c.pawn.Name@DestinationTags[DTag]); //MoveTarget = C.SequenceScript.GetMoveTarget(); if ( DestinationTags[DTag] != '' ) { ForEach C.AllActors(class'Actor',MoveTarget,DestinationTags[DTag]) break; } if ( AIScript(MoveTarget) != None ) MoveTarget = AIScript(MoveTarget).GetMoveTarget(); c.pawn.SetMoveTarget(MoveTarget); if( c.pawn.NearMoveTarget ()) { DTag = RandRange(0,DestinationTags.Length-1); HashMap.SetValue(String(c.pawn.Name),DTag); //log("Sheepie has new movetag"); } return MoveTarget; } function string GetActionString() { return ActionString@DestinationTags[0]; } defaultproperties { ActionString="Move to point" bValidForTrigger=false }