• 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.

[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 :)
 
Level 2
Joined
Sep 21, 2007
Messages
26
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?
 
Level 2
Joined
Sep 21, 2007
Messages
26
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)
 
Level 4
Joined
Aug 12, 2004
Messages
76
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?
 
Level 2
Joined
Sep 21, 2007
Messages
26
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.
 
Level 2
Joined
Sep 21, 2007
Messages
26
  • 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.
Top