class ClockDriver expands Keypoint; var() name MinuteHandTag; var() name HourHandTag; var Mover MinuteHand; var Mover HourHand; function bool FindHandMover(name ATag, string VarName, out Mover M) { if (ATag == '') { warn("mover Tag for" @ VarName @ "must be given - terminating"); return false; } foreach AllActors(class'Mover', M, ATag) break; if (M == None) { warn("no mover with Tag='" $ ATag $ "' found - terminating"); return false; } return true; } event bool SetHand(Mover Hand, float Roll) { local rotator R; R.Roll = Roll; if ( ! Hand.SetRotation(R)) { warn("coulden't set rotation=" $ R @ "for" @ Hand); return false; } return true; } event bool SetHands() { local bool result; local float f; result = true; f = 65536.0 / 60.0 * Level.Minute; if ( ! SetHand(MinuteHand, f)) result = false; if ( ! SetHand(HourHand, (f / 12.0 ) + (65536.0 / 12.0 * Level.Hour))) result = false; return result; } event PostBeginPlay() { if ( ! FindHandMover(MinuteHandTag, "MinuteHandTag", MinuteHand)) destroy(); if ( ! FindHandMover(HourHandTag, "HourHandTag", HourHand)) destroy(); Super.PostBeginPlay(); SetHands(); SetTimer(Level.TimeDilation * 60, true); } event Timer() { SetHands(); } defaultproperties { bStatic=False }