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

Rescued units quest

Status
Not open for further replies.
Level 6
Joined
Aug 27, 2013
Messages
104
Hello,

I need a trigger where I need to rescue 4 groups of units. I can't figure it out.
So objective is Find remnants of your forces (0/4). After each rescue I want a message to pop out (1/4) and so on till (4/4) and quest is then finished.

Thanks in advance.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
Hello,

I need a trigger where I need to rescue 4 groups of units. I can't figure it out.
So objective is Find remnants of your forces (0/4). After each rescue I want a message to pop out (1/4) and so on till (4/4) and quest is then finished.

Thanks in advance.
To keep track of a whole number you use an Integer variable. If you want these triggers to work for multiple Players, you would use an Integer Array variable.

I'm going to assume you want it to only work for a single Player and keep it as simple as possible:

Use a Region to detect when you've come near the Rescuable units. Then proceed to change ownership of those Rescuable units to yourself using the Pick Every Unit action in combination with the Change Ownership action. Then increase your Integer variable by 1 and display a Text Message showing this updated value. Lastly, you can have another check to see if you've collected all four, which could be useful if you wanted something to happen at that moment.

So we'd have 4 of these triggers, one for each Rescue group. This means you'll need 4 Rescue Regions as well:
  • Rescue 1
    • Events
      • Unit - A unit enters Rescue1 <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit Group - Pick every unit in (Units in Rescue1 <gen> owned by Player 2 (Blue)) and do (Actions)
        • Loop - Actions
          • Unit - Change ownership of (Picked unit) to (Owner of (Triggering unit)) and Change color
      • Set VariableSet Rescue_Count = (Rescue_Count + 1)
      • Game - Display to (All players) for 30.00 seconds the text: (Rescued: + ((String(Rescue_Count)) + /4))
      • Trigger - Run Check If Rescue Is Finished <gen> (checking conditions)
In each Trigger you will only need to adjust the Region, you can see it being used twice throughout.

This is our optional check to see if we've rescued everyone. It runs whenever we rescue a group of units:
  • Check If Rescue Is Finished
    • Events
    • Conditions
      • Rescue_Count Equal to 4
    • Actions
      • -------- This trigger runs whenever Rescue1/2/3/4 runs. If Rescue_Count is equal to 4 then it's Actions will execute. --------
      • Game - Display to (All players) for 30.00 seconds the text: You've rescued everyone!
My triggers assume that you're Player 1 (Red) and that you're rescuing Player 2 (Blue). You must adjust the Players used in these triggers to fit your map.

Edit: I added a second example map that uses Quests and a slightly better design.
 

Attachments

  • Rescue Example 1.w3m
    20.1 KB · Views: 4
  • Rescue Example 2 Quests.w3m
    20.4 KB · Views: 5
Last edited:
Status
Not open for further replies.
Top