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

Discussion in 'World Editor Help' started by sunshinex3, Sep 30, 2016.

  1. sunshinex3

    sunshinex3 You can change this now in User CP.

    Ratings:
    +4 / 0 / -0
    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?
     
  2. Accname

    Accname 2D-Graphics enthusiast

    Ratings:
    +1,544 / 4 / -4
    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).
     
  3. sunshinex3

    sunshinex3 You can change this now in User CP.

    Ratings:
    +4 / 0 / -0
    yes that works, but now their requirements aren't in effect... why can't it ever be easy. thank you for your help.
     
  4. sunshinex3

    sunshinex3 You can change this now in User CP.

    Ratings:
    +4 / 0 / -0
    well that sux, found nothing of value, looking into a replace / disable trigger
     
  5. Accname

    Accname 2D-Graphics enthusiast

    Ratings:
    +1,544 / 4 / -4
    Well the WC3 engine is an enigma. Rules usually do not follow logic or reason there.
     
  6. sunshinex3

    sunshinex3 You can change this now in User CP.

    Ratings:
    +4 / 0 / -0
    do you think their is some way to, disable enable "sold units"
     
  7. Accname

    Accname 2D-Graphics enthusiast

    Ratings:
    +1,544 / 4 / -4
    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
     
  8. sunshinex3

    sunshinex3 You can change this now in User CP.

    Ratings:
    +4 / 0 / -0
    omg ty, this helped me out alot now i can make the zerg race.
     
  9. sunshinex3

    sunshinex3 You can change this now in User CP.

    Ratings:
    +4 / 0 / -0
    //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: Nov 10, 2016
  10. jonas

    jonas Member

    Ratings:
    +40 / 4 / -0
    man, use wc3 tags and indentation.
     
  11. sunshinex3

    sunshinex3 You can change this now in User CP.

    Ratings:
    +4 / 0 / -0
    sry would you give me an example, of the tags.
     
  12. jonas

    jonas Member

    Ratings:
    +40 / 4 / -0
    Just reply to Accname's posts using the "Reply" button, you'll see how it's done
     
  13. sunshinex3

    sunshinex3 You can change this now in User CP.

    Ratings:
    +4 / 0 / -0
    ah yes ty
     
  14. jonas

    jonas Member

    Ratings:
    +40 / 4 / -0
    you still need proper indentation - just copy and paste the triggers from the map again
     
  15. sunshinex3

    sunshinex3 You can change this now in User CP.

    Ratings:
    +4 / 0 / -0
    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: Nov 12, 2016
  16. sunshinex3

    sunshinex3 You can change this now in User CP.

    Ratings:
    +4 / 0 / -0
    balls what am i missing i did the [ wc3]trigger[/wc3 ]
     
  17. jonas

    jonas Member

    Ratings:
    +40 / 4 / -0
    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.
     
  18. sunshinex3

    sunshinex3 You can change this now in User CP.

    Ratings:
    +4 / 0 / -0
    i think its such a long trigger it wont effectively show on this website
     
  19. Accname

    Accname 2D-Graphics enthusiast

    Ratings:
    +1,544 / 4 / -4
    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.
     
  20. sunshinex3

    sunshinex3 You can change this now in User CP.

    Ratings:
    +4 / 0 / -0
    i found the problem, i need a condition that counts units of a certain type, not all units
     

Share This Page