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

[Trigger] Ordering a unit to train a unit

Status
Not open for further replies.
Level 7
Joined
Jan 1, 2005
Messages
133
Ok I've got a bit of a complex trigger I'm trying to make. Basically im trying to simulate the zerg larva/egg build system for my starcraft maps project.

Atm this is what im thinking

Event: unit starts training a unit.

Condition: unit training the trained unit is a Larva (triggering unit)
Trained unit = Drone

Action: replace Triggering unit (Larva) with a Zerg Egg)

  • Zerg Drone production
    • Events
      • Unit - A unit Begins training a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Larva
    • Actions
      • Unit - Replace (Triggering unit) with a Zerg Coccon (Drone) using The old unit's relative life and mana
Now that works fine

But from their i want the new Zerg egg unit to train the Drone unit. Atm all i can think of is this.

  • Zerg Drone 2
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Entering unit)) Equal to Zerg Coccon (Drone)
    • Actions
      • Unit Group - Order (Units owned by Player 1 (Red) of type (Unit-type of (Entering unit))) to train a Zerg Drone
But nothing happens.
 
Level 13
Joined
Mar 24, 2010
Messages
950
maybe try adding a small wait time in there, the sec a unit enters it might not react fast enough to train something instantly.
Also put a message in there to all players to see if the triggers even running.
Change entering unit to triggering unit, shouldnt matter but might as well get use to doing that.
 
Level 7
Joined
Jan 1, 2005
Messages
133
maybe try adding a small wait time in there, the sec a unit enters it might not react fast enough to train something instantly.
Also put a message in there to all players to see if the triggers even running.
Change entering unit to triggering unit, shouldnt matter but might as well get use to doing that.

thanks for the tip. I will give it a try and see what happens.
thanks mate
 
Level 12
Joined
Aug 22, 2008
Messages
911
Personally I'd rather play with summoning abilities than training.
I have another offer for you: Each interval the hatchery spawns additional larva that are linked to it, the hatchery has an ability of "Select Larva" that selects all larva when cast, and when the larva are ordered to morph they actually spawn eggs at their location. When the spawn time (or the training time) is over and the eggs die the trained units spawn.
Do you follow me?
 
Level 7
Joined
Jan 1, 2005
Messages
133
Personally I'd rather play with summoning abilities than training.
I have another offer for you: Each interval the hatchery spawns additional larva that are linked to it, the hatchery has an ability of "Select Larva" that selects all larva when cast, and when the larva are ordered to morph they actually spawn eggs at their location. When the spawn time (or the training time) is over and the eggs die the trained units spawn.
Do you follow me?

Yes I use to use this method previously and it worked well. The only problem i have is there is no build timer during the building process and the player has to just wait for the spawning unit to appear instead of know how long the unit will take to appear. Also i want to try and get a rally point working with this as well so zerg players don't have to micro 10x more then the Terran and Protoss players.
 
Level 7
Joined
Jan 1, 2005
Messages
133
Ok well i try the suggestions and all i was able to determine was can get a text message to appear when the egg appears but the trigger wont issued the order. I have left it as it is for now but it might only be doable in JASS maybe but i dont have the know how to make JASS triggers. thank you everyone who provided me with tips and help on this for me.
 
Level 12
Joined
Aug 22, 2008
Messages
911
Hold on, now that I've reviewed your triggers, you might be able to do this. Just order the Last Replaced Unit to train the Drone after replacing the larva, if it can. That way you won't need the second trigger. You can set the rally point of the last replaced unit by saving the rally point of the triggering unit into a point variable before replacing and setting the rally point for the new unit afterwards.
EDIT: 700th post!
 
Level 7
Joined
Jan 1, 2005
Messages
133
Hold on, now that I've reviewed your triggers, you might be able to do this. Just order the Last Replaced Unit to train the Drone after replacing the larva, if it can. That way you won't need the second trigger. You can set the rally point of the last replaced unit by saving the rally point of the triggering unit into a point variable before replacing and setting the rally point for the new unit afterwards.
EDIT: 700th post!

Cool thanks for the tip. Ill look into making these changes to the trigger and will get back to you. thanks
 
Status
Not open for further replies.
Top