• 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] Click position?

Status
Not open for further replies.
Woah, could you please try to write in accurate english? I still don't even know if your problem is ingame or if you just want to make working in the editor easier. And what the hell are "whispers"? Are you talking about the nightelf whisps?
If you want it ingame, you'll need trackables. However, try to think of what you want, and then, try to write an understandable sentence -.-
 
You need a trigger that selects a unit, like this
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • Trigger - Add to Trigger1 <gen> the event (Player - Player(IntegerA) selects a unit)
  • Trigger1
  • Events
  • Conditions
  • Actions
    • Set SelectedUnit[(Player Number of (Triggering Player))] = (Triggering unit)
For the "region part", you need to get "Trackables", which require Jass. You can do it in some other way though, like detecting the right click. This would go like this:
  • Trigger2
  • Events
    • Unit - A unit is issued an order targeting a point
  • Conditions
    • And - Conditions
      • (Unit-type of (Triggering unit)) Equal to (Unit-type of (SelectedUnit[(Player Number of (Owner of (Triggering unit))])
      • (Issued order) Equal to (order(smart))
  • Actions
    • Set Point1 = (Target point of issued order)
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (your region) contains (Point1) Equal to True //This is a "Boolean" comparison
      • Then - Actions
        • Unit - Create 1 (Unit-type of (SelectedUnit[(Player Number of (Owner of (Triggering unit)))]) at Point1 facing default building degrees
      • Else - Actions
    • Custom script: call RemoveLocation (udg_Point1)
Trackables are better, because you only need a click. With the trigger above, which is easier for you though, you must first select a unit (any unit) and right click at the region to create the saved-in variable unit.

References:
[•] http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/array-tutorial-17789/
[•] http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/variables-5896/
[•] http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/basic-triggering-5885/
[•] http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/
 
Level 9
Joined
May 22, 2009
Messages
276
pharaos second trigger would be good if you have your unit selected all game (make a trigger that makes player select this unit when it selects something else). At the same time you can add abilities that allow u to change the wisp's color (make 11 wisps in object editor with each a different collor). you can now just right click the place u want the wisp and if you use his trigger it'll work
 
Status
Not open for further replies.
Top