Stuff » Warcraft 3 » GUI-Trigger » Sliden auf Eis
Im Folgenden werden zwei Trigger erklärt. Der erste ist für das Simulieren des Slidens auf Eis, der zweite für das Lenken auf dem Eis.Vier Variablen werden benötigt:
- UnitGroup, vom Typ Unit Group
- Point1, Point2, SlideMovePoint, alle vom Typ Point
Der komplette Trigger für das Sliden auf Eis ist:
Slide
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
Set UnitGroup = (Units in (Playable map area) matching ((((Terrain type at (Position of (Matching unit))) Equal to Northrend - Ice)
Unit Group - Pick every unit in UnitGroup and do (Actions)
Loop - Actions
Set Point1 = (Position of (Picked unit))
Set Point2 = (Point1 offset by 15.00 towards (Facing of (Picked unit)) degrees)
Unit - Move (Picked unit) instantly to Point2
Custom script: call RemoveLocation (udg_Point2)
Custom script: call RemoveLocation (udg_Point1)
Custom script: call DestroyGroup (udg_UnitGroup)
Alle 0,3 Sekunden werden alle Units, die sich auf Northrend - Ice befinden, nach vorne bewegt, womit das Sliden simuliert wäre.
Die Variablen in Verbindung mit Custom Scripts werden verwendet, um Leaks zu vermeiden.
Alle Einheiten, die sich auf Northrend - Ice befinden, können gelenkt werden, wenn der folgende Trigger aktiviert ist:
Slide Direction Change
Events
Unit - A unit Is issued an order targeting a point
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain type at (Position of (Ordered unit))) Equal to Northrend - Ice
Then - Actions
Set SlideMovePoint = (Position of (Ordered unit))
Unit - Move (Ordered unit) instantly to SlideMovePoint, facing (Angle from SlideMovePoint to (Target point of issued order)) degrees
Custom script: call RemoveLocation(udg_SlideMovePoint)
Else - Actions