• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] Replace unit after order-queue empty?

Status
Not open for further replies.
Level 2
Joined
Sep 21, 2007
Messages
26
Hi there, what i'm trying to do is when a unit finishes building, i want to swap that unit to another unit.

What i have is this:

  • Events
    • Unit - A unit Finishes casting an ability
  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • (Unit-type of (Casting unit)) Equal to Tower Builder (Anti-Matter)
        • (Unit-type of (Casting unit)) Equal to Tower Builder (Electricity)
        • (Unit-type of (Casting unit)) Equal to Tower Builder (Gun)
        • (Unit-type of (Casting unit)) Equal to Tower Builder (Siege)
  • Actions
    • Unit - Replace (Casting unit) with a Tower Builder using The new unit's default life and mana
    • Set Builders[(Player number of (Owner of (Casting unit)))] = (Last replaced unit)
    • Trigger - Run Check Abilities <gen> (ignoring conditions)
    • Wait 0.05 seconds
    • Selection - Select (Last replaced unit) for (Owner of (Last replaced unit))
The problem with that is that if you shift+build (i.e queue up buildings to be built) it will just ignore that and the unit will be replaced as soon as the first structure is built and then it will no longer have the building in its building list so it cannot complete the rest of the queue.

Is there any way for me to only replace *once* its order-queue is empty?

Alternatively, is there anyway for me to replace it only after its build menu is closed?

Thanks :)
 
I tried it as:

  • (Current order of (Casting unit)) Equal to (Order(<Empty String>))
but that doesn't seem to be working. Am i doing one of those things wrong?
 
I figured the casting would be 'Repair' since these are cloned Peasant units and i figured that would be why it'd work.

I was searching yesterday and i found that it was actually meant to be "Order(none)" instead of what i have, but that still doesn't work.

Why would the order always be null? Wouldn't they have an order to build the next building in their queue? (and then in the case of a Peasant, repair it)
 
Err i'm not trying to steal the post but i have a similar question with this. So there is nothing such that it detects null order?
 
Oh, change the event to Finishes Constructing a Structure. Repair isn't detected.

Where abouts is "Finishes Constructing a Structure"? All i can see is "Finishes Construction" which i assume would refer to the building.
 
  • Builder Revert
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Current order of (Triggering unit)) Equal to (Order(none))
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Tower Builder (Anti-Matter)
          • (Unit-type of (Triggering unit)) Equal to Tower Builder (Electricity)
          • (Unit-type of (Triggering unit)) Equal to Tower Builder (Gun)
          • (Unit-type of (Triggering unit)) Equal to Tower Builder (Siege)
    • Actions
      • Unit - Replace (Triggering unit) with a Tower Builder using The new unit's default life and mana
      • Set Builders[(Player number of (Owner of (Triggering unit)))] = (Last replaced unit)
      • Trigger - Run Check Abilities <gen> (ignoring conditions)
      • Wait 0.05 seconds
      • Selection - Select (Last replaced unit) for (Owner of (Last replaced unit))
I think i tried that this morning but i tried it again just now and it still doesn't do it =/

And with it that way, even if i remove the:

  • Conditions
    • (Current order of (Triggering unit)) Equal to (Order(none))
it still doesn't work.
 
Status
Not open for further replies.
Back
Top