• 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.

Creating a Trigger: Reveal Unit When Close?

Status
Not open for further replies.
Level 2
Joined
Oct 11, 2012
Messages
14
Hi, I am working on a night time map that involves campfires. Units have very little sight radius and rely on campfires for them during the night.

Could someone teach me how to create two triggers?
The first trigger gives campfires to a certain player? e.g. player 1,2,3 builds a campfire and upon completion it immediately belongs to player 4.

The second trigger: When a unit (player 1,2,3) comes within the campfires sight radius (600), the sight radius is shared with the triggering unit as if the campfire suddenly belonged to the triggering unit.

I hope this isn't hard *fingers crossed*
 
Level 9
Joined
Dec 21, 2011
Messages
332
  • asd
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Campfire
    • Actions
      • Unit - Change ownership of (Constructed structure) to Player 4 (Purple) and Change color
      • -------- Add what you want below --------
That's for Trig one and for trig two, well ask another person. I'm not used to make multi-player maps ( only Single Player ), so I don't know how to trigger that.
 
Level 2
Joined
Sep 5, 2012
Messages
17
Haven't tested yet but...

  • Sechs
    • Events
      • Unit - A unit comes within 600.00 of (Constructed Structure)
    • Conditions
    • Actions
      • Player - Maker (Owner of (Constructed Structure)) treat (Owner of (Triggering Unit)) as an Ally with shared vision
It's probably best to set all constructed units into a variable and replace (Constructed Structure) with the said variable.
 
Level 2
Joined
Oct 11, 2012
Messages
14
Haven't tested yet but...

  • Sechs
    • Events
      • Unit - A unit comes within 600.00 of (Constructed Structure)
    • Conditions
    • Actions
      • Player - Maker (Owner of (Constructed Structure)) treat (Owner of (Triggering Unit)) as an Ally with shared vision
It's probably best to set all constructed units into a variable and replace (Constructed Structure) with the said variable.

Very helpful, thanks! +rep.

It will take me sometime to work this because I have no idea how variables work just yet (getting to it someday). It would be kind if you could show me an example of how to add a campfire to variable and link it to that trigger. :)
 
Level 11
Joined
Oct 31, 2010
Messages
1,057
Haven't tested yet but...

  • Sechs
    • Events
      • Unit - A unit comes within 600.00 of (Constructed Structure)
    • Conditions
    • Actions
      • Player - Maker (Owner of (Constructed Structure)) treat (Owner of (Triggering Unit)) as an Ally with shared vision
It's probably best to set all constructed units into a variable and replace (Constructed Structure) with the said variable.

that wouldn't work, you cant select constructed structure or a variable of a unit as the unit in that command

Edit: Made a proper working test map :3 type warpten and build the farm
Test game flow means (you are in range of the farm and got the vision of the farm)
Test game flow 2 means (you are not in range of the farm or haven't built it and does not have the vision of the farm)
Try walking away after building the farm :3
 

Attachments

  • TestMap.w3x
    17.7 KB · Views: 65
Last edited:
Level 2
Joined
Oct 11, 2012
Messages
14
it doesn't work? grr, I was poking around variables and reading up on it. I'll try the test map.

EDIT: Much thanks darkzxx. It works perfectly. Rep. Although learning and replicating it will take time. It is mind puzzling. Hmm, first step of course is to find a way to rid the constant message spam of test game flow + 2.
 
Level 11
Joined
Oct 31, 2010
Messages
1,057
uhh no, you just delete that part O;, that part was to test the trigger flow O.O
you delete the trigger actions that start with game -

Edit : heres the map with comments on how the triggers work :3
 

Attachments

  • TestMap.w3x
    18.3 KB · Views: 65
Status
Not open for further replies.
Top