• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Spider Spawn from Egg. Help Plz!

Status
Not open for further replies.
Level 10
Joined
Jan 20, 2011
Messages
492
(Solved) Spider Spawn from Egg. Help Plz!

Hey guys I've been trying to make a trigger where a hero comes close to a Spider Egg, and the egg dies, then spawns a Tiny Spider in the position of the Egg.

Note: I have made a respawn trigger, so the code
  • Unit - A unit comes within 256.00 of Spider Egg 0084 <gen>
will not work efficiently, since I want this trigger to work every time, not only once then the next time you come in contact of the egg it dies and spawns the Tiny Spider again.

It will be much appreciated if you help me with this problem. If anymore information is needed just ask
 
Last edited:
Level 17
Joined
Mar 21, 2011
Messages
1,597
you mean, the egg dies if the hero comes too close?
cause i understand it like that: if the hero comes close + the egg dies = spiderling

if u want it to do like this: egg dies if hero comes too close
then:
  • Unbezeichneter Auslöser 001
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Set Eggs_Unitgroup = (Units in (Playable map area) matching (((Unit-type of (Matching unit)) equal to Egg) and (((Matching unit) is alive) equal to True)))
      • Unitgroup - Pick every unit in Eggs_Unitgroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Conditions
              • (Number of units in (Units within 300.00 of (Position of (Picked unit)))) greater than 0
            • 'THEN'-Actions
              • Unit - Kill (Picked unit)
              • Unit - Create 1 Soldat for (Owner of (Picked unit)) at (Position of (Picked unit)) facing Vorgabe für Gebäude-Ausrichtung degrees
            • 'ELSE'-Actions
ofc u have to remove leaks, set variables and so on,
but i think theres a better solution, but this one should work
 
Level 10
Joined
Jan 20, 2011
Messages
492
Ok so I tried it, but it doesn't seem to be working when I come close or anything does.

  • Spider Egg
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Set Eggs_Unitgroup = (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to Spider Egg) and (((Matching unit) is alive) Equal to True)))
      • Unit Group - Pick every unit in Eggs_Unitgroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in (Units within 325.00 of (Position of (Picked unit)))) Equal to 0
            • Then - Actions
              • Unit - Kill (Picked unit)
              • Unit - Create 1 Tiny Spider for (Owner of (Picked unit)) at (Position of (Picked unit)) facing Default building facing degrees
            • Else - Actions
Thats the code incase I did something wrong, but I cannot see anything.
 
Status
Not open for further replies.
Top