• 🏆 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!

Unit production similar to zerg

Status
Not open for further replies.
Level 2
Joined
Jan 2, 2022
Messages
6
Hey. Im recently making a wc3 mod where all four races are replaced by dwarves, goblins, nerubians and one more (not sure which to choose yet :p). I've got an idea to make nerubians make units like zerg in sc2 (or should i say similar). Now i got 2 units for one type (for example Nerubian Drone (worker) and Nerubian Drone (Egg)) and when i build it the main building spawns an egg, which after some time kills itself and spawns the unit. I need a bar that shows the timer when the unit pops out and a rally point and im not sure how to do it, anyone? ;P
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
I think this should do what you want:

  • replace unit
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Spider
    • Actions
      • Set VariableSet TempUnit = (Trained unit)
      • Set VariableSet TempPoint = (Position of TempUnit)
      • Unit - Replace TempUnit with a Egg Sack using The new unit's default life and mana
      • Set VariableSet TempUnit = (Last replaced unit)
      • Unit - Add a 3.00 second Generic expiration timer to TempUnit
      • Custom script: call RemoveLocation(udg_TempPoint)
  • spawn spider
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Egg Sack
    • Actions
      • Set VariableSet TempPoint = (Position of (Triggering unit))
      • Unit - Create 1 Spider for (Owner of (Triggering unit)) at TempPoint facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_TempPoint)
this will also spawn the unit when the egg is killed, is that what you want?
 

Attachments

  • Spider Omlettes.w3m
    18.2 KB · Views: 7
Level 2
Joined
Jan 2, 2022
Messages
6
Now i realized i got another problem. I wanna those eggs spawn units after the expiration time, but you can also kill the egg and the unit comes out faster. How to prevent that? Any ideas :p?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,510
Now i realized i got another problem. I wanna those eggs spawn units after the expiration time, but you can also kill the egg and the unit comes out faster. How to prevent that? Any ideas :p?
When the Egg dies check if there was a Killing unit or not.
  • Conditions
  • (Killing unit) Not equal to No unit
Pretty sure this works.
 
Level 2
Joined
Jan 2, 2022
Messages
6
When the Egg dies check if there was a Killing unit or not.
  • Conditions
  • (Killing unit) Not equal to No unit
Pretty sure this works.
It works thanks man ^^. I'll propably post soon whole modifications to races and a test 1on1 melee map :D
 
Status
Not open for further replies.
Top