• 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] Explosive Sheep

Status
Not open for further replies.
Level 1
Joined
Oct 23, 2007
Messages
5
Hey everybody,

At the moment I'm making a "hero arena" style map, and as a buyable "Battlefield Effect" players can spawn a line of sheep that run across the map and blow up if they come into contact with an enemy hero (so they effectively have to dodge them).

I've got the spawn triggers to work fine, however I have no idea how to make the sheep explode when they come into contact with the heroes. (And kill them in one fluffy pop:xxd:)

I thought about different possibilities; such as creating an invisable aura and using a trigger "When unit is effected by spell" (or whatever the exact name is).

I think ultimately what I need to understand is how to make spawned units become part of a unit group. I suppose you could make a variable, and set each sheep to 1,2,3 etc, but since I'm spawning loads of sheep it wouldn't be very effective. There is no trigger I can find that doesn't require a specific unit (aka - When unit comes within XX of unit, instead of what I need = "When unit type comes within XX of Unit")

Or if there's a different easier way - but any help would be great:infl_thumbs_up:

Thanks in advance, Warhoof.:grin:
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
  • Unknown
    • Events
      • Event
    • Conditions
    • Actions
      • Unit - Create 1 Sheep for Some_Player at Some_Place facing Default building facing degrees
      • Trigger - Add to Unknown2 the event (Unit - A unit comes within 256.00 of (Last created unit)
  • -------- Do this to all the sheeps --------
  • Unknown2
    • Events
    • Conditions
    • Actions
      • Unit - Explode (Triggering unit)
 
Level 1
Joined
Oct 23, 2007
Messages
5
But the problem there (I think) is that only works fi your spawning one sheep. I however am spawning around 50 - 60 sheep in a straight line, therefore last created unit would only work for one of them. Or am I missing something?

Nonetheless thanks for the quick reply;

Thanks in advance, Warhoof.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
As I said do this to all sheeps

  • Unknown
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Trigger - Add to (This trigger) the event (Unit - A unit comes within 256.00 of (Last created unit))
      • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Trigger - Add to (This trigger) the event (Unit - A unit comes within 256.00 of (Last created unit))
      • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Trigger - Add to (This trigger) the event (Unit - A unit comes within 256.00 of (Last created unit))
      • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Trigger - Add to (This trigger) the event (Unit - A unit comes within 256.00 of (Last created unit))
      • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Trigger - Add to (This trigger) the event (Unit - A unit comes within 256.00 of (Last created unit))
      • -------- etc --------
(With your own sheeps and regions of course...)
 
Level 15
Joined
Aug 18, 2007
Messages
1,390
instead of making the same thing use this one:
  • Unknown
  • Events
  • Conditions
  • Actions
  • For Each (IntergerA) to (IntergerB) do Actions:
  • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
    • Trigger - Add to (This trigger) the event (Unit - A unit comes within 256.00 of (Last created unit))
The Interger A should be 1 and Interger B should be the ammount of spawns.
 
Level 8
Joined
Feb 20, 2007
Messages
338
Yes loop the spawn.

  • For each (Integer A) from 1 to 50, do (Actions)
    • Loop - Actions
You could give them the Kaboom! Ability (make a customized one) or Goblin Land Mine - once they have the ability (through editor) you should not have to have a trigger to cause them to cast it. In the case of say Kaboom you would give it to them as a Default Active Ability.

Personally I would give them land mine ability that way the sheep will explode and die - which will go along way at cleaning up the map of excess units.

You could possibly do this without a trigger.

Make a copy of say Feral Spirit (which normally spawns wolves) make it spawn X number of customized sheep, lets call the spell 'Ka-Baaaa-Boom!'.

Your Customized sheep (Let's call them Explosive Woollies) would have the ability of land mine, would have a greater Acquisition Range, maybe have Wander as one of their abilities. Being cast by 'Ka-Baaa-Boom!' they would have a limit spawn duration and would vanish once that time is up.

The casting unit casts 'Ka-Baaaa-Boom! - X number of 'Explosive Woollies' are spawned, they immediately start wandering about unless there are enemies within their range of acquisition they do their lamb-walk/leaping toward the enemy (Ah how cute, sheep) until they are in range via your Land Mine ability and explode.

It would be good Baaaaa enemy.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
First - lol that was a funny post :xxd:
And second, he wanted them to go in a straight line from base 1 to base 2.
And why would the goblin mine activate alone ? if you want it to activate the unit needs to die because golin mine is equal to the "AoE on death" ability.
 
Level 8
Joined
Feb 20, 2007
Messages
338
First - lol that was a funny post :xxd:
And second, he wanted them to go in a straight line from base 1 to base 2.
And why would the goblin mine activate alone ? if you want it to activate the unit needs to die because golin mine is equal to the "AoE on death" ability.

Sorry I meant Kaboom ability. my baaaad (said goatishly)
 
Level 1
Joined
Oct 23, 2007
Messages
5
lol - reminds me of that lame joke:
A criminal was exiled to a lone island which was inhabited by a single goat. Seven years later a group of tourists stumbled upon the island and found a young boy. They asked what his name was and the boy replied "B-i-i-i-i-i-l-l-l-l-y-y-y". But anyway;

I made the sheep runs across the map, I've used Ghost Wolf's trigger (found it easier to understand than the loop actions) to kill enemies within area. But you're saying all I have to do is add the kaboom ability to the sheep as a default and they'll die? Because I'm a little confused. I was hoping that when you have "Unknown 2" (as Ghost Wolf put it), adding the action to explode last created unit as well would work - but it didn't. So if someone could elaaaaborate a little that would be great.

Thaaankss a bunch, Warhoof :)
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I think this should work (although its pretty cheap...)

  • Unknown
    • Events
      • Map initialization
    • Conditions
      • ((Triggering unit) is A structure) Equal to True
    • Actions
      • For each (Integer A) from 1 to 60, do (Actions)
        • Loop - Actions
          • Set Sheep_Points[(Integer A)] = ((Center of Sheep Region <gen>) offset by ((Real((Integer A))) x 400.00) towards 90.00 degrees)
          • Unit - Create 1 Sheep for Player 1 (Red) at Sheep_Points[(Integer A)] facing 180.00 degrees
      • For each (Integer A) from 1 to 60, do (Actions)
        • Loop - Actions
          • Custom script: call RemoveLocation( udg_Sheep_Points[bj_forLoopAIndex] )
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Sheep)) and do (Actions)
        • Loop - Actions
          • Trigger - Add to Unknown 2 <gen> the event (Unit - A unit comes within 100.00 of (Picked unit))

  • Unknown 2
    • Events
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Set Sheep_Location = (Position of (Triggering unit))
      • Unit Group - Pick every unit in (Units within 200.00 of Sheep_Location) and do (Actions)
        • Loop - Actions
          • Unit - Explode (Picked unit)
      • Custom script: call RemoveLocation( udg_Sheep_Location )
 
Status
Not open for further replies.
Top