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

Spawning mobs turning off the trigger and clearing

Status
Not open for further replies.
Level 4
Joined
Aug 13, 2008
Messages
47
Hey, I'm working on my first scripted boss fight in a map project of mine. I'm pretty new to the world editor program and I'd like a bit of help for the spawning system. Heres the deal:
I have the spawning system set up in the boss's region. Every 20 seconds two ghosts spawn on each side of the room... ALL THE TIME.100% of game time. I only want the trigger to work if enemy heroes are inside the room, but any other time i want it off. In addition to that, I'm not sure how to turn off this trigger once heroes leave the region and get it ready for use again.
Thanks in advance
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
Just define a variable for every hero you got in the game, then set as conditions
  • Conditions
    • Or, - Multiple Conditions
      • *Your Region* contains *your hero_variable_no.1* equal to true
      • *Your Region* contains *your hero_variable_no.2* equal to true
      • *Your Region* contains *your hero_variable_no.3* equal to true
(boolean condition - Region contains unit)
and so on.. shall do the work..
 
Level 4
Joined
Aug 13, 2008
Messages
47
that isnt working because theres a hero selection system and when you choose your hero theres no variable for the newly chosen hero unless im missing something. Is there any other way around this?
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
Uhh is there a region in which the selected heroes start?
If so, do:
  • Events
    • Unit - A unit enters *your spawnregion*
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • 'IF'-Conditions
        • (Triggering Unit) equal to *Hero No.1*
      • 'THEN'-Actions
        • Set Heroes[0] = (Triggering Unit)
      • 'ELSE'-Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • 'IF'-Conditions
            • (Triggering Unit) equal to *Hero No.2*
          • 'THEN'-Actions
            • Set Heroes[1] = (Triggering Unit)
          • 'ELSE'-Actions
            • and so on
 
Level 2
Joined
Oct 9, 2006
Messages
17
  • Events
    • Time - Every 20.00 seconds of game time
  • Conditions
  • Actions
    • Unit Group - Pick every unit in (Units in (region)) and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Picked unit) belongs to an enemy of (Player that owns boss)) Equal to True
          • Then - Actions
            • Unit - Create 2 ghost for Player at (region) facing Default building facing (270.0) degrees
          • Else - Actions
? dun think u need variables for that.
 
Level 9
Joined
Aug 1, 2008
Messages
453
Make a trigger that when a unit enters a region it turns on *spawn trigger* and then make another region that turns off your *spawn trigger* when they leave the area. Requires 2 regions, make them little lines next to each other. i would post the trigger but idk how to post the trigger on the fourms
 
Level 4
Joined
Aug 13, 2008
Messages
47
Sorry if i wasnt clear on the question but i think bloopers helped out with the problem. Hmm nevermind. I have it set up exactly like bloopers except it doesnt seem be working like it should be. I have no units that are the boss's enemies in the boss's region. And yes i dont want to use any variables other than the boss's region and boss himself region
 
Last edited:
Level 4
Joined
Aug 13, 2008
Messages
47
heres the trigger
  • Events
    • Time - Every 20.00 seconds of game time
  • Conditions
  • Actions
    • Unit Group - Pick every unit in (Units in Prides Room <gen>) and do (Actions)
      • Loop - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Picked unit) belongs to an enemy of Player 12 (Brown)) Equal to True
      • Then - Actions
        • Game - Display to (All players) for 10.00 seconds the text: Lieutenant Pride: C...
        • Unit - Create 1 Restless Spirit for Player 12 (Brown) at (Center of Spirit Spawn 1 <gen>) facing (Position of Lieutenant Pride 0042 <gen>)
        • Unit - Create 1 Restless Spirit for Player 12 (Brown) at (Center of Spirit Spawn 2 <gen>) facing (Position of Lieutenant Pride 0042 <gen>)
      • Else - Actions
right now it seems like the spawning is working 24/7 even when only the boss is in the room
 
Level 2
Joined
Oct 9, 2006
Messages
17
put your if, then, else trigger inside your unit select trigger

  • Unit Group - Pick every unit in (Units in pride room <gen>) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) belongs to an enemy of Player 12 (Brown)) Equal to True
        • Then - Actions
          • Unit - Create 1 restless spirit for Player 12 (Brown) at (Center of spirit spawn 1<gen>) facing Default building facing (270.0) degrees
          • Unit - Create 1 restless spirit for Player 12 (Brown) at (Center of spirit spawn 2<gen>) facing Default building facing (270.0) degrees
        • Else - Actions
 
Status
Not open for further replies.
Top