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

Garrison Flag

Status
Not open for further replies.
Level 9
Joined
Feb 17, 2009
Messages
290
So if you've ever played Age of Empires II you probably noticed that garrisoning a unit inside a tower will add a flag to the top of the building.

I am having a difficult time logic-ing my way through how to track when the unit has been unloaded in warcraft 3. There are two ways to unload a unit, by clicking it on the GUI or casting the unload button, and the GUI method is not trackable by triggers as far as I am aware.

Is anyone knowledgable about this sort of thing? The reason it is important is I am adding a sphere (the flag) to the tower when a unit is loaded into transport. That's easy. I am not seeing a good method for taking the flag away for BOTH METHODS of leaving transport.

This will need to work for any number of towers since each tower can hold a single unit and multiple people could have multiple towers with something inside.

These towers also can upgrade and the sphere gets removed naturally when it finishes, so I need a way to track all this stuff in such a way I can easily add the sphere back.

Thanks!!
 
I'm terrible with JASS, and of course the author of that code thought it was a brilliant idea to wrap what I need with completely unrelated material, and I cannot get it to save without name expecting errors in any other map. I followed the instructions.


Edit: I went to a text comparison site to show mine against his trigger and as I thought, they're both completely identical and yet it does not work in even another new map just like his.
 
Since there was no decent explanation of how any of this trigger works in the details can you help me with a few variable references? Here is the "off" trigger before I messed with it. This is how I was trying to do it intially, and below it is what I assumed I should use for the variable references.

  • Watch Tower Garrison OFF
    • Events
      • Game - CargoEvent becomes Equal to 2.00
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Transporting unit)) Equal to Watch Tower (purchaseable)
          • (Unit-type of (Transporting unit)) Equal to Watch Tower II (purchaseable)
          • (Unit-type of (Transporting unit)) Equal to Watch Tower III (purchaseable)
          • (Unit-type of (Transporting unit)) Equal to Watch Tower III |c0000ff00+1|r (purchaseable)
          • (Unit-type of (Transporting unit)) Equal to Watch Tower III |cffff0000+2|r (purchaseable)
          • (Unit-type of (Transporting unit)) Equal to Watch Tower III |cffffffff+3|r (purchaseable)
          • (Unit-type of (Transporting unit)) Equal to Watch Tower |cffffcc00IV|r (purchaseable)
          • (Unit-type of (Transporting unit)) Equal to Watch Tower |cffffcc00V|r (purchaseable)
          • (Unit-type of (Transporting unit)) Equal to |cffffdeadWatch Tower VI|r (Unique)
    • Actions
      • Unit - Remove Sphere Special (Garrison) from (Casting unit)
different version:

  • Watch Tower Garrison OFF
    • Events
      • Game - CargoEvent becomes Equal to 2.00
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of CargoTransportUnit[UDex]) Equal to Watch Tower (purchaseable)
          • (Unit-type of CargoTransportUnit[UDex]) Equal to Watch Tower II (purchaseable)
          • (Unit-type of CargoTransportUnit[UDex]) Equal to Watch Tower III (purchaseable)
          • (Unit-type of CargoTransportUnit[UDex]) Equal to Watch Tower III |c0000ff00+1|r (purchaseable)
          • (Unit-type of CargoTransportUnit[UDex]) Equal to Watch Tower III |cffff0000+2|r (purchaseable)
          • (Unit-type of CargoTransportUnit[UDex]) Equal to Watch Tower III |cffffffff+3|r (purchaseable)
          • (Unit-type of CargoTransportUnit[UDex]) Equal to Watch Tower |cffffcc00IV|r (purchaseable)
          • (Unit-type of CargoTransportUnit[UDex]) Equal to Watch Tower |cffffcc00V|r (purchaseable)
          • (Unit-type of CargoTransportUnit[UDex]) Equal to |cffffdeadWatch Tower VI|r (Unique)
    • Actions
      • Unit - Remove Sphere Special (Garrison) from CargoTransportUnit[UDex]
The sphere is a flag that appears on the watch tower to signify someone is inside.

I'm sure for people who do this every day it is obvious what I am doing wrong. I just wish people who wrote these elaborate scripts would bother to detail things for people who don't. Thank you for helping me so far by the way, I really appreciate it.
 
Status
Not open for further replies.
Back
Top