"Hatch" unit

FireEffect

Gasp!
Reaction score
98
Ok i need a simple trigger. It is when a unit dies it spawns either one or two eggs (50/50 chance) and after 10 seconds the egg(s) hatche(s).
And make the unit attack anything even other eggs or hatchlings.
 

Exide

I am amazingly focused right now!
Reaction score
448
I don't know what settings you have, etc. But here's a small trigger with the idea for you. Maybe you can work the details out yourself. :p

Code:
Untitled Trigger 001
    Events
        Unit - A unit Dies
    Conditions
        (Unit-type of (Triggering unit)) Equal to [B]*Your_Dying_Unit*[/B]
    Actions
        Set [B]*PointVariable*[/B] = (Position of (Triggering unit))
        If ((Random integer number between 1 and 2) Equal to 1) then do (Unit - Create 1 [B]*Egg*[/B] for (Neutral Hostile) at [B]*PointVariable*[/B] facing 270.00 degrees) else do (Unit - Create 2 [B]*Egg*[/B]  for (Neutral Hostile) at [B]*PointVariable*[/B] facing 270.00 degrees)
        Wait 10.00 seconds
        Set [B]TempGroup[/B] = (Units owned by (Neutral Hostile) of type [B]*Egg*[/B])
        Unit Group - Pick every unit in TempGroup and do (Actions)
            Loop - Actions
                Unit - Replace (Picked unit) with a [B]*Hatchling*[/B] using The new unit's default life and mana
        Custom Script - Call RemoveLocation(udg_[B]*PointVariable*[/B])
        Custom Script - Call DestroyGroup(udg_[B]TempGroup[/B])

Maybe you want to add the eggs to (Owner of (Triggering unit)) and change the owner in the Unit Group Loop later.
 

FireEffect

Gasp!
Reaction score
98
Thanks, but no thanks. I actually did this WITHOUT TRIGGERS :eek: Yes i did the impossible. I kept out random varibles and attack other hatchlings but it works :).
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top