• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Turning off Spell

Status
Not open for further replies.
Level 12
Joined
Jun 10, 2008
Messages
1,043
Hello Hive! I've been trying to create this spell where, depending on your level, you summon a group of units. The problem is, they're supposed to be removed after 120 seconds, and I can't figure out how to make it only the specific summoned units, and not any other summoned units in the area. Basically, I ended after "Wait 121 seconds" and then I thought I'd need another trigger to turn them off, so I made a "Run trigger" actions, but if that is not needed I will remove it. Please help!

  • Call to the North
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Call to the North
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Call to the North for (Casting unit)) Equal to 1
        • Then - Actions
          • Cinematic - Send transmission to (All players) from (Casting unit) named (Name of (Casting unit)): Play No sound and display Call to Erthaliam!. Modify duration: Add 0.00 seconds and Wait
          • Unit - Create 1 Norse Elementalist for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
          • Wait 120.00 seconds
          • Trigger - Run Call to the North Off <gen> (checking conditions)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Call to the North for (Casting unit)) Equal to 2
        • Then - Actions
          • Cinematic - Send transmission to (All players) from (Casting unit) named (Name of (Casting unit)): Play No sound and display Call to Caradia!. Modify duration: Add 0.00 seconds and Wait
          • Unit - Create 2 Norse Elementalist for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
          • Wait 120.00 seconds
          • Trigger - Run Call to the North Off <gen> (checking conditions)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Call to the North for (Casting unit)) Equal to 3
        • Then - Actions
          • Cinematic - Send transmission to (All players) from (Casting unit) named (Name of (Casting unit)): Play No sound and display Call to Sirdinaam!. Modify duration: Add 0.00 seconds and Wait
          • Unit - Create 2 Norse Vanguard Ringleader for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
          • Unit - Create 3 Norse Elementalist for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
          • Wait 120.00 seconds
          • Trigger - Run Call to the North Off <gen> (checking conditions)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Call to the North for (Casting unit)) Equal to 4
        • Then - Actions
          • Cinematic - Send transmission to (All players) from (Casting unit) named (Name of (Casting unit)): Play No sound and display Call to the North!. Modify duration: Add 0.00 seconds and Wait
          • Unit - Create 2 Norse Vanguard Ringleader for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
          • Unit - Create 4 Norse Elementalist for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
          • Unit - Create 6 Norse Pillager for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
          • Wait 120.00 seconds
          • Trigger - Run Call to the North Off <gen> (checking conditions)
        • Else - Actions
          • Do nothing
 
No, it refers only to 1 unit, but, you can do this:
  • Actions
    • Unit - Create 3 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units of type Footman) and do (Actions)
      • Loop - Actions
        • Unit Group - Add (Picked unit) to LastCreatedGroup
    • Unit Group - Pick every unit in LastCreatedGroup and do (Actions)
      • Loop - Actions
        • Unit - Add a 120.00 second Generic expiration timer to (Picked unit)
Put that 3 units in the group and then add expiration timer through picked unit function
LastCreatedGroup is Unit Group variable, set it up
 
Hmmm, the thing is, the same unit being summoned is also being used as creeps on the map, and there is a different typ eof unit being created, (EX: 2 Norse Pillagers, 1 Norse Elementalist) how would you do this then?
 
No, it refers only to 1 unit, but, you can do this:
  • Actions
    • Unit - Create 3 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units of type Footman) and do (Actions)
      • Loop - Actions
        • Unit Group - Add (Picked unit) to LastCreatedGroup
    • Unit Group - Pick every unit in LastCreatedGroup and do (Actions)
      • Loop - Actions
        • Unit - Add a 120.00 second Generic expiration timer to (Picked unit)
->
  • Actions
    • set point = Position of triggering unit
    • Unit - Create 3 Footman for owner of triggering unit at point facing Default building facing degrees
    • Unit Group - Pick every unit in (Last created unit group) and do (Actions)
      • Loop - Actions
        • Unit - Add a 120.00 second Generic expiration timer to (Picked unit)
      • call RemoveLocation(udg_point)
@nuuh: Add that unit group thing after each "create x units" and you're done :)


  • Actions
    • set point = Position of triggering unit
    • Unit - Create 3 Footman for owner of triggering unit at point facing Default building facing degrees
    • Unit Group - Pick every unit in (Last created unit group) and do (Actions)
      • Loop - Actions
        • Unit - Add a 120.00 second Generic expiration timer to (Picked unit)
      • Unit - Create 4 Riflemen for owner of triggering unit at point facing Default building facing degrees
      • Unit Group - Pick every unit in (Last created unit group) and do (Actions)
        • Loop - Actions
          • Unit - Add a 120.00 second Generic expiration timer to (Picked unit)
      • call RemoveLocation(udg_point)
 
Status
Not open for further replies.
Back
Top