• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

auto train trigger

Status
Not open for further replies.
Level 2
Joined
Jan 23, 2014
Messages
14
Hi all

I made a building, it has two abilities 1.train a unit 2.upgrade to another building. I tested the map and everything was good i could train as many unit as i want and then upgrade my building. nothing was wrong . BUT i only added this trigger for auto training (like Footman Map)

  • Mytrigger
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • Unit - Order (Triggering unit) to train/upgrade to a (Trained unit-type)
the problem is when i canceled the auto train manually at some point so that i can upgrade building, i found that the upgrade button is grayed i can see the tool tip but can't click it. it seems like the building is still in train/research queue. Before this trigger map was working so the problem must be from it, what i did wrong?
 
Level 2
Joined
Jan 23, 2014
Messages
14
Well i uploaded the map can someone test it please? just train 1 unit and after that cancel the auto training and see if you can upgrade the building. My warcraft crashes sometime recently, maybe it's my fault not the map QQ
 

Attachments

  • My Map.w3x
    16.2 KB · Views: 62
Hi, your idea was ok. Just the implementation of blizzard doesnt seem to be good here.

Seems to bug if you do the build order in same operation thread. I fixed it with including a "wait 0 seconds" line.

To still make it MUI (multiple unit instability) with the wait I added a local integer which represents the unit type of trained unit.

Check this out:

  • Aktionen
    • Custom script: local integer t = GetUnitTypeId(GetTrainedUnit())
    • Wait 0.00 seconds
    • Custom script: call IssueTrainOrderByIdBJ( GetTriggerUnit(), t )
 
Status
Not open for further replies.
Top