How do i make regular units to be purchased like mercenaries.

sunshinex3

You can change this now in User CP.
Reaction score
7
mercenaries can be purchased 3 at a time or so on with a cool down that starts rolling in the back ground i want to do that for some player units(zerg race) but i don't how and i can't find any thing on the subject...

Stats - Stock Maximum
Stats - Stock Replenish Inter...
Stats - Stock Start Delay

I have filled these 3 fields in? What else do I need?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
You need to go to the building that trains the units. There are separate fields for units that are being trained and units that are being sold (as mercenaries).
 

sunshinex3

You can change this now in User CP.
Reaction score
7
yes that works, but now their requirements aren't in effect... why can't it ever be easy. thank you for your help.
 

sunshinex3

You can change this now in User CP.
Reaction score
7
well that sux, found nothing of value, looking into a replace / disable trigger
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
Well the WC3 engine is an enigma. Rules usually do not follow logic or reason there.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
There is in fact a way, I just tested it out.

Give your barracks the ability "Sell Unit" [Asud]. Remove all units from the list of units sold by your barracks. It should not sell nor train any units.
Instead, use the trigger action:
Trigger:
  • Neutral Building - Add UNIT to BARRACKS with NUMBER in stock and a max stock of NUMBER

to add the units to your barracks. All units added this way can be removed with:
Trigger:
  • Neutral Building - Remove UNIT from BARRACKS
 

sunshinex3

You can change this now in User CP.
Reaction score
7
//having a problem with the remove trigger going to post.

Zerg units remove sold


Trigger:
  • Zerg units remove sold
    • Events
    • Unit - A unit Dies
    • Conditions
    • And - All (Conditions) are true
    • Conditions
    • ((Unit-type of (Dying unit)) Equal to Spawning Pool (zerg)) or (((Unit-type of (Dying unit)) Equal to Den (Zerg)) or (((Unit-type of (Dying unit)) Equal to Nest (Zerg)) or ((Unit-type of (Dying unit)) Equal to Lair (Zerg))))
    • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Unit-type of (Dying unit)) Equal to Spawning Pool (zerg)
    • (Number of units in (Units owned by (Owner of (Dying unit)) of type Spawning Pool (zerg))) Less than 1
    • Then - Actions
    • Player - Make Zerg Egg (zergling) Available for training/construction by (Owner of (Dying unit))
    • Player - Make Zerg Egg (zergling colony) Available for training/construction by (Owner of (Dying unit))
    • Player - Make Zerg Egg (zergling Hive) Available for training/construction by (Owner of (Dying unit))
    • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Hatchery (zerg)) and do (Actions)
    • Loop - Actions
    • Neutral Building - Remove Zerg Egg (zergling) from (Picked unit)
    • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Colony (zerg)) and do (Actions)
    • Loop - Actions
    • Neutral Building - Remove Zerg Egg (zergling) from (Picked unit)
    • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Hive (zerg)) and do (Actions)
    • Loop - Actions
    • Neutral Building - Remove Zerg Egg (zergling) from (Picked unit)
    • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Unit-type of (Dying unit)) Equal to Den (Zerg)
    • (Number of units in (Units owned by (Owner of (Dying unit)) of type Den (Zerg))) Less than 1
    • Then - Actions
    • Player - Make Zerg Egg (Hydralisk) Available for training/construction by (Owner of (Dying unit))
    • Player - Make Zerg Egg (zergling colony) Available for training/construction by (Owner of (Dying unit))
    • Player - Make Zerg Egg (zergling Hive) Available for training/construction by (Owner of (Dying unit))
    • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Hatchery (zerg)) and do (Actions)
    • Loop - Actions
    • Neutral Building - Remove Zerg Egg (Hydralisk) from (Picked unit)
    • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Colony (zerg)) and do (Actions)
    • Loop - Actions
    • Neutral Building - Remove Zerg Egg (Hydralisk) from (Picked unit)
    • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Hive (zerg)) and do (Actions)
    • Loop - Actions
    • Neutral Building - Remove Zerg Egg (Hydralisk) from (Picked unit)
    • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Unit-type of (Dying unit)) Equal to Nest (Zerg)
    • (Number of units in (Units owned by (Owner of (Dying unit)) of type Nest (Zerg))) Less than 1
    • Then - Actions
    • Player - Make Zerg Egg (scanthid) Available for training/construction by (Owner of (Dying unit))
    • Player - Make Zerg Egg (scanthid colony) Available for training/construction by (Owner of (Dying unit))
    • Player - Make Zerg Egg (scanthid hive) Available for training/construction by (Owner of (Dying unit))
    • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Hatchery (zerg)) and do (Actions)
    • Loop - Actions
    • Neutral Building - Remove Zerg Egg (scanthid) from (Picked unit)
    • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Colony (zerg)) and do (Actions)
    • Loop - Actions
    • Neutral Building - Remove Zerg Egg (scanthid) from (Picked unit)
    • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Hive (zerg)) and do (Actions)
    • Loop - Actions
    • Neutral Building - Remove Zerg Egg (scanthid) from (Picked unit)
    • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Unit-type of (Dying unit)) Equal to Lair (Zerg)
    • (Number of units in (Units owned by (Owner of (Dying unit)) of type Lair (Zerg))) Less than 1
    • Then - Actions
    • Player - Make Zerg Egg (Ultralisk) Available for training/construction by (Owner of (Dying unit))
    • Player - Make Zerg Egg (Ultralisk colony) Available for training/construction by (Owner of (Dying unit))
    • Player - Make Zerg Egg (Ultralisk Hive) Available for training/construction by (Owner of (Dying unit))
    • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Hatchery (zerg)) and do (Actions)
    • Loop - Actions
    • Neutral Building - Remove Zerg Egg (Ultralisk) from (Picked unit)
    • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Colony (zerg)) and do (Actions)
    • Loop - Actions
    • Neutral Building - Remove Zerg Egg (Ultralisk) from (Picked unit)
    • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Hive (zerg)) and do (Actions)
    • Loop - Actions
    • Neutral Building - Remove Zerg Egg (Ultralisk) from (Picked unit)
    • Else - Actions
    • Do nothing


//ok, so when i lose a building like a spawning pool, i need units(zergling) for sale in hatcheries hives and colonies to be removed from those buildings.
 
Last edited:

jonas

You can change this now in User CP.
Reaction score
67
Just reply to Accname's posts using the "Reply" button, you'll see how it's done
 

sunshinex3

You can change this now in User CP.
Reaction score
7
Trigger:
  • Events
    • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
      • Conditions
      • ((Unit-type of (Dying unit)) Equal to Spawning Pool (zerg)) or (((Unit-type of (Dying unit)) Equal to Den (Zerg)) or (((Unit-type of (Dying unit)) Equal to Nest (Zerg)) or ((Unit-type of (Dying unit)) Equal to Lair (Zerg))))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
      • (Unit-type of (Dying unit)) Equal to Spawning Pool (zerg)
      • (Number of units in (Units owned by (Owner of (Dying unit)) of type Spawning Pool (zerg))) Less than 1
      • Then - Actions
      • Player - Make Zerg Egg (zergling) Available for training/construction by (Owner of (Dying unit))
      • Player - Make Zerg Egg (zergling colony) Available for training/construction by (Owner of (Dying unit))
      • Player - Make Zerg Egg (zergling Hive) Available for training/construction by (Owner of (Dying unit))
      • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Hatchery (zerg)) and do (Actions)
      • Loop - Actions
      • Neutral Building - Remove Zerg Egg (zergling) from (Picked unit)
      • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Colony (zerg)) and do (Actions)
      • Loop - Actions
      • Neutral Building - Remove Zerg Egg (zergling) from (Picked unit)
      • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Hive (zerg)) and do (Actions)
      • Loop - Actions
      • Neutral Building - Remove Zerg Egg (zergling) from (Picked unit)
      • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
      • (Unit-type of (Dying unit)) Equal to Den (Zerg)
      • (Number of units in (Units owned by (Owner of (Dying unit)) of type Den (Zerg))) Less than 1
      • Then - Actions
      • Player - Make Zerg Egg (Hydralisk) Available for training/construction by (Owner of (Dying unit))
      • Player - Make Zerg Egg (zergling colony) Available for training/construction by (Owner of (Dying unit))
      • Player - Make Zerg Egg (zergling Hive) Available for training/construction by (Owner of (Dying unit))
      • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Hatchery (zerg)) and do (Actions)
      • Loop - Actions
      • Neutral Building - Remove Zerg Egg (Hydralisk) from (Picked unit)
      • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Colony (zerg)) and do (Actions)
      • Loop - Actions
      • Neutral Building - Remove Zerg Egg (Hydralisk) from (Picked unit)
      • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Hive (zerg)) and do (Actions)
      • Loop - Actions
      • Neutral Building - Remove Zerg Egg (Hydralisk) from (Picked unit)
      • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
      • (Unit-type of (Dying unit)) Equal to Nest (Zerg)
      • (Number of units in (Units owned by (Owner of (Dying unit)) of type Nest (Zerg))) Less than 1
      • Then - Actions
      • Player - Make Zerg Egg (scanthid) Available for training/construction by (Owner of (Dying unit))
      • Player - Make Zerg Egg (scanthid colony) Available for training/construction by (Owner of (Dying unit))
      • Player - Make Zerg Egg (scanthid hive) Available for training/construction by (Owner of (Dying unit))
      • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Hatchery (zerg)) and do (Actions)
      • Loop - Actions
      • Neutral Building - Remove Zerg Egg (scanthid) from (Picked unit)
      • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Colony (zerg)) and do (Actions)
      • Loop - Actions
      • Neutral Building - Remove Zerg Egg (scanthid) from (Picked unit)
      • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Hive (zerg)) and do (Actions)
      • Loop - Actions
      • Neutral Building - Remove Zerg Egg (scanthid) from (Picked unit)
      • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
      • (Unit-type of (Dying unit)) Equal to Lair (Zerg)
      • (Number of units in (Units owned by (Owner of (Dying unit)) of type Lair (Zerg))) Less than 1
      • Then - Actions
      • Player - Make Zerg Egg (Ultralisk) Available for training/construction by (Owner of (Dying unit))
      • Player - Make Zerg Egg (Ultralisk colony) Available for training/construction by (Owner of (Dying unit))
      • Player - Make Zerg Egg (Ultralisk Hive) Available for training/construction by (Owner of (Dying unit))
      • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Hatchery (zerg)) and do (Actions)
      • Loop - Actions
      • Neutral Building - Remove Zerg Egg (Ultralisk) from (Picked unit)
      • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Colony (zerg)) and do (Actions)
      • Loop - Actions
      • Neutral Building - Remove Zerg Egg (Ultralisk) from (Picked unit)
      • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Hive (zerg)) and do (Actions)
      • Loop - Actions
      • Neutral Building - Remove Zerg Egg (Ultralisk) from (Picked unit)
      • Else - Actions
      • Do nothing
 
Last edited:

jonas

You can change this now in User CP.
Reaction score
67
No idea, but it's still impossible to read (we don't even know where the else clauses are ending). Maybe you could try [ code ]... [/ code ] as a workaround.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
There is couple of things to note:
1) To get proper indention on your trigger you need to actually put some whitespaces in your code. If you copy the code from the editor the whitespaces should be correct already.
2) Your trigger is leaking memory quite heavily. There are numerous memory leaks which will create lag in your map after this trigger has run too many times. (each run of the trigger takes away some of your memory permanently). Do a google search on memory leaks and how to avoid them.
3) You should not be using "Dying unit". Replace "Dying unit" with "Triggering Unit" everywhere.
4) I would recommend getting the system to work in a small test map first with a single unit type. Then, expand on that and keep testing to make sure things still work out.
 

sunshinex3

You can change this now in User CP.
Reaction score
7
i found the problem, i need a condition that counts units of a certain type, not all units
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top