• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Simple(?) Trigger Problem

Status
Not open for further replies.
Level 5
Joined
Jun 5, 2007
Messages
99
I'm working on a vehicle event where a certain vehicle does AoE damage as long as it continues moving. I used the Permanent Immolation spell as a base, and created the following triggers to check if it is moving or not.

  • Move
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
      • (Current order of Goblin Steam Roller 0013 <gen>) Equal to (Order(move))
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Add Test Steam Roller (Not a real Steam Roller) to Goblin Steam Roller 0013 <gen>
      • Trigger - Turn on Stop <gen>
      • Game - Display to (All players) the text: Move Test Activated
  • Stop
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
      • (Current order of Goblin Steam Roller 0013 <gen>) Equal to (Order(stop))
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Remove Test Steam Roller (Not a real Steam Roller) from Goblin Steam Roller 0013 <gen>
      • Trigger - Turn on Move <gen>
      • Game - Display to (All players) the text: Stop Test Activated
Nothing happens,. no matter what the vehicle is up to. I added the last line to both triggers to check to see if they're ever being executed. They never are.

Any thoughts?
 
Ok, let me give you better triggers here, cause 1) That thing will cause too much lag (0.01 seconds is the highest periodic event) and 2) It doesn't work with the order "move" or "stop"; it's a common issue everyone wants.
  • Trigger1
  • Events
    • Time - Every 0.04 seconds of game-time
  • Conditions
  • Actions
    • Set Point1 = (Position of (Test Steam Roller (Not a real Steam Roller)))
  • Trigger2
  • Events
    • Time - Every 0.05 seconds of game-time
  • Conditions
  • Actions
    • Set Point2 = (Position of (Test Steam Roller (Not a real Steam Roller)))
    • If/ Then/ Else
      • If (Conditions)
        • ((Distance between (Point2) and (Point1)) Not Equal to 0
      • Then
        • Set Temp_Group = (Units within 500.00 of (Point2) matching ((Matching unit) is a structure) Equal to False) and ((Matching unit) belongs to an enemy of (Owner of (Test Steam Roller (Not a real Steam Roller)))
        • Unit Group - Pick up every unit in (Temp_Group) and do (Actions)
          • Loop - Actions
            • Unit - Cause (Test Steam Roller (Not a real Steam Roller)) to damage (Picked unit) dealing X damage of type Z and damage type Y.
      • Custom script: call DestroyGroup (udg_Temp_Group)
    • Custom script: call RemoveLocation (udg_Point2)
    • Custom script: call RemoveLocation (udg_Poin1)
 
Level 5
Joined
Jun 5, 2007
Messages
99
Thanks for the help! Though I didn't use your exact triggers, the thought process behind them guided me to what I'm using now.

  • SteamRollerPositionCheck
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Set SteamRoller1Position[1] = (Position of Goblin Steam Roller 0013 <gen>)
      • Wait 0.01 seconds
      • Set SteamRoller1Position[2] = (Position of Goblin Steam Roller 0013 <gen>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between SteamRoller1Position[1] and SteamRoller1Position[2]) Not equal to 0.00
        • Then - Actions
          • Unit - Add Test Steam Roller (Not a real Steam Roller) to Goblin Steam Roller 0013 <gen>
        • Else - Actions
          • Unit - Remove Test Steam Roller (Not a real Steam Roller) from Goblin Steam Roller 0013 <gen>
      • Custom script: call RemoveLocation (udg_SteamRoller1Position[1])
      • Custom script: call RemoveLocation (udg_SteamRoller1Position[2])
Above is my final trigger. I was able to fit it into one trigger, and I personally feel this is slightly more organized and efficient. It also makes the balancing game easier since the damage is still controlled in the spell itself.

Thanks again for the help! :)
 
Level 9
Joined
Aug 21, 2008
Messages
533
you cant wait for 0.01 second it will bug.
In addition this wont be mui.

  • SteamRollerPositionCheck
  • Events
  • Time - Every 0.03 seconds of game time
  • Conditions
  • Actions
  • Set SteamRoller1Position[1] = (Position of Goblin Steam Roller 0013 <gen>)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions Bolen is true
    • Then - Actions
  • Set bolean false
  • Set SteamRoller1Position[1] = (Position of Goblin Steam Roller 0013 <gen>)
    • Else - Actions
  • Set bolean true
  • Set SteamRoller1Position[2] = (Position of Goblin Steam Roller 0013 <gen>)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Distance between SteamRoller1Position[1] and SteamRoller1Position[2]) Not equal to 0.00
  • Then - Actions
  • Unit - Add Test Steam Roller (Not a real Steam Roller) to Goblin Steam Roller 0013 <gen>
  • Else - Actions
  • Unit - Remove Test Steam Roller (Not a real Steam Roller) from Goblin Steam Roller 0013 <gen>
  • Custom script: call RemoveLocation (udg_SteamRoller1Position[1])
  • Custom script: call RemoveLocation (udg_SteamRoller1Position[2])
 
Status
Not open for further replies.
Top