• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Unstuck Trigger

Status
Not open for further replies.
Level 3
Joined
Mar 25, 2008
Messages
56
hi ok i tried searching in this forum and couldnt find this trigger.its when a unit gets stuck in an area,i would like to know the trigger when play types -unstuck as an exact match,the stuck unit moves to a centre of a specific region thanks
 
Level 6
Joined
Nov 28, 2007
Messages
203
I've actually written this trigger in this forum before ^^ but i'll show it anyways, ofc:
  • Debug
    • Events
      • Player - Player 1 (Red) types a chat message containing -unstuck as An exact match
      • Player - Player 2 (Blue) types a chat message containing -unstuck as An exact match
      • Player - Player 3 (Teal) types a chat message containing -unstuck as An exact match
      • Player - Player 4 (Purple) types a chat message containing -unstuck as An exact match
      • (an so on..)
    • Conditions
    • Actions
      • Unit Group - Pick every unit in CheckUnitsStuck[1] and do (Actions) (CheckUnitsStuck[1] - unit group variable with the "array" checked)
        • Loop - Actions
          • Set RemovablePoint = (Move 1 <gen>) (RemovablePoint - point variable)
          • Unit - Order (Picked unit) to Move To RemovablePoint
          • Custom script: call RemoveLocation(udg_RemovablePoint) (this is for removing leaks)
      • Unit Group - Pick every unit in CheckUnitsStuck[2] and do (Actions)
        • Loop - Actions
          • Set RemovablePoint = (Move 2 <gen>)
          • Unit - Order (Picked unit) to Move To RemovablePoint
          • Custom script: call RemoveLocation(udg_RemovablePoint)
You should also add
  • Unit Group - Add (Triggering unit) to CheckUnitsStuck[number]
in your triggers where the units are entering a region and shall move to the next one.
[1] for the first region (where they spawn), [2] for the second, and so on..

You can read about leaks here: http://www.hiveworkshop.com/forums/showthread.php?t=35124
And arrays here: http://www.hiveworkshop.com/forums/showthread.php?t=17789
 
Level 3
Joined
Mar 25, 2008
Messages
56
sorry but i dont get your trigger but ill try it,however ima rephrase my question.

how to i make it such that when a player types -(text) it will move his hero to the starting location.
 
Level 6
Joined
Nov 28, 2007
Messages
203
how to i make it such that when a player types -(text) it will move his hero to the starting location.
First you'll have to set the heroes to an unit group array variable, best when they are created or in the beginning, created heroes:
  • Untitled Trigger 002
    • Events
      • Your Events Here
    • Conditions
    • Actions
      • Set RemovablePoint = (Your Point/Position)
      • Unit - Create 1 (Your Hero) for Player 1 (Red) at RemovablePoint facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_RemovablePoint)
      • Set Hero[1] = (Last created unit)
and heroes from the beginning:
  • Untitled Trigger 003
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Hero[1] = Your Hero <gen>
      • Set Hero[2] = Your Hero2 <gen>
Then you'll have to move the hero:
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing -text as An exact match
    • Conditions
    • Actions
      • Set RemovablePoint = ((Triggering player) start location)
      • Unit - Order Hero[(Player number of (Triggering player))] to Move To RemovablePoint
      • Custom script: call RemoveLocation(udg_RemovablePoint)
 
Status
Not open for further replies.
Top