Ice Skating Trigger Not working as it should

NightMagi

Member
Reaction score
5
Problem:

Sometimes, when i press a point to face it, the unit ignores it and slides into the snow (Killer terrain). Whats the problem with this trigger?

Triger:

Trigger:
  • slide
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Set tempGroup = (Units of type Blademaster)
      • Unit Group - Pick every unit in tempGroup and do (Actions)
        • Loop - Actions
          • Set tempPoint = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
              • (Terrain type at tempPoint) Equal to Northrend - Ice
            • Then - Actions
              • Unit - Move (Picked unit) instantly to (tempPoint offset by 20.00 towards (Facing of (Picked unit)) degrees)
            • Else - Actions
              • Custom script: call RemoveLocation(udg_tempPoint)
              • Custom script: call DestroyGroup(udg_tempGroup)


when i change

Trigger:
  • Events
    • Time - Every 0.04 seconds of game time


to

Trigger:
  • Events
    • Time - Every 0.03 seconds of game time


it completely ignores the commands

please help ;/
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
the problem is with
Trigger:
  • Unit - Move (Picked unit) instantly to (tempPoint offset by 20.00 towards (Facing of (Picked unit)) degrees)


Unit - Move ... moves a unit, but it also orders the unit to stop. Instead of doing this, try this:

Trigger:
  • Custom Script: call SetUnitX(GetEnumUnit(),GetUnitX(GetEnumUnit() + 20 * Cos(GetUnitFacing(GetEnumUnit()))
    • Custom Script: call SetUnitY(GetEnumUnit(),GetUnitY(GetEnumUnit() + 20 * Sin(GetUnitFacing(GetEnumUnit()))


And have a second trigger that orders a unit to face an angle whenever a player right clicks a point or orders their unit to move to a point. Using the JASS functions SetUnitX and SetUnitY does not interrupt a unit's orders, meaning that the unit will be running faster than the slide.
 

NightMagi

Member
Reaction score
5
the problem is with
Trigger:
  • Unit - Move (Picked unit) instantly to (tempPoint offset by 20.00 towards (Facing of (Picked unit)) degrees)


Unit - Move ... moves a unit, but it also orders the unit to stop. Instead of doing this, try this:

Trigger:
  • Custom Script: call SetUnitX(GetEnumUnit(),GetUnitX(GetEnumUnit() + 20 * Cos(GetUnitFacing(GetEnumUnit()))
    • Custom Script: call SetUnitY(GetEnumUnit(),GetUnitY(GetEnumUnit() + 20 * Sin(GetUnitFacing(GetEnumUnit()))


And have a second trigger that orders a unit to face an angle whenever a player right clicks a point or orders their unit to move to a point. Using the JASS functions SetUnitX and SetUnitY does not interrupt a unit's orders, meaning that the unit will be running faster than the slide.

what would the second trigger look like? ;)
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
what would the second trigger look like? ;)

Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Terrain type at (Position of (Triggering unit))) Equal to Northrend - Ice
    • Actions
      • Wait 0.00 seconds
      • Unit - Order (Triggering unit) to Stop
      • Unit - Make (Triggering unit) face (Angle from (Position of (Triggering unit)) to (Target point of issued order)) over 0.00 seconds


Basically this. It does leak though.
 

HydraRancher

Truth begins in lies
Reaction score
197
your trigger leaks, you need to set the offset point to a variable. btw thats 25 leaks a second.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top