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

The ungarrison trigger doesn't work! ARGH!!!

Status
Not open for further replies.
Level 10
Joined
Aug 15, 2008
Messages
448
Hello!! I'm making a modern warfare-futuristic map and I'm trying to make infantry unit garrison in neutral buildings, capturing them and getting a good defence positions (for now I've made bunkers and artillery positions), and then return the structures to neutral-passive when they leave it, so they can be recaptured by other players. The "entering" trigger is ok, but I can't make the buildings neutral again when infantry leave them, so any other player who comes to the building (empty) cannot take it because it is mine!!!
Here's the functioning trigger:

  • Capture bunker
    • Events
      • Unit receives an order which target is an object
    • Conditions
      • And - All (conditions) are true
        • (issued order) non equal to (order(attack))
        • (owner of (target unit of issued order)) equal to neutral-passive
        • (unit-type of (target unit of issued order)) equal to Bunker
    • Actions
      • Unit group - pick every units is (units within 84 of (position of (target unit of issued order))) and do (actions)
        • Actions
          • If (all conditions are true) then do (then actions) else do (else actions)
            • If - (conditions)
              • (picked unit) equal to (ordered unit)
            • Then - (actions)
              • Unit - change ownership of (target unit of issued order) to (owner of (ordered unit)) and change color
              • Unit - order (target unit of issued order) to Load (ordered unit)
            • Else - (actions)
              • Do nothing
That's it. The building just doesn't return neutral when infantry leave it...
Thanks in advance =D.
Check this link if you want to know more on my map: http://www.hiveworkshop.com/forums/f256/need-some-help-my-modern-warfare-futuristic-map-battlemasters-blazing-river-95205/

P.S.: is there any way to make maps with more mb? That's because my map is 4.5mb and Warcraft is already annoying me because I can't use big maps on LAN or online...
 
Last edited:
Level 6
Joined
Dec 28, 2007
Messages
178
try change the event to something like that:
A unit begins channeling an ability
ability being cast equal to load-unload..
that may work :)
 
Level 10
Joined
Aug 15, 2008
Messages
448
That's because it's the ENTERING trigger. This is my non-functioning EXIT trigger:

  • Uncapture bunker
    • Events
      • Time - every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit group - pick every unit in (units of type (bunker) and do (actions)
        • Actions
          • If (all conditions are true) then (then actions) else (else actions)
            • If (conditions)
              • (no unit is loaded into (picked unit)) equal to TRUE
            • Actions - then
              • Unit - change ownership of (picked unit) to neutral-passive and change color
            • Actions - else
              • Do nothing
It doesn't really function. My idea is that the NO UNIT variable is some kind of real, but not existing, unit... it looks weird, but this would explain why the trigger doesn't work: NO UNIT ISN'T in the bunker!!!
 
Last edited:
Level 10
Joined
Aug 15, 2008
Messages
448
Originally posted by hawk900

Just add-unload?
I can't do such things sice I want buildings to be used by more than one player if left undefended.

Originally posted by -JonNny

if its the normal Wc3 load unload you are using this should work
  • leave
    • Events
      • Unit - A Unit recieves and point targeted Order
    • Conditions
      • String(issuedOrder) equals "unloadall"
    • Actions
      • Unit - change ownership of (Triggering Unit) to neutral-passive and change color
I thought about it too, but like hawk900 says, it doesn't work for unloading specific units.

Originally posted by LightBloOD

try change the event to something like that:
A unit begins channeling an ability
ability being cast equal to load-unload..
that may work :)

That's the problem: the only UNLOAD ability I can find is the UNLOAD ALL one, so editing this single one isn't very userful.


Anyway, here are a few details more (nothing really special):
-The bunker has a standard load-unload ability that can only target organic units
-It has an OrcBurrow like cargo with 4 slots so units can shoot from inside
 
Last edited:
This doesn't work for unloading specific units, so beware.

.. its not that hard

String(issuedOrder) equals "unloadall"
String(issuedOrder) equals "unload"
String(issuedOrder) equals "load"

... the problem is that if the bunker contains more than 1 unit you would have to store the numer of units which are insider a bunker what you gotta increaese/decrease it every time when a unit is loaded/unloaded and if the numer is "0" (no units left) you gotta change the owner

But theres another problem ,
if you rightclick the bunker with your unit the bunker get the "load" order
if you cast the "load" ability the bunker will get the "load" order
BUT if you rightclick the unit with the bunker there will be NO order !

... dunno , maybe try to fix that with giving them a "defend" ability cuz there is no "load" order but a "undefend" order then they are loaded... straaange blizzard o_O
 
Level 10
Joined
Aug 15, 2008
Messages
448
Ok, I've made a trigger to go along with my original CAPTURE BUNKER one:
  • Capture bunker 2
    • Events
      • Unit receives an order which target is an object
    • Conditions
      • And - All (conditions) are true
        • (issued order) non equal to (order(attack))
        • (owner of (target unit of issued order)) equal to neutral-passive
        • (unit-type of (target unit of issued order)) equal to Bunker
    • Actions
      • Unit group - pick every units is (units within 84 of (position of (target unit of issued order))) and do (actions)
        • Actions
          • If (all conditions are true) then do (then actions) else do (else actions)
            • If - (conditions)
              • (picked unit) equal to (ordered unit)
            • Then - (actions)
              • Unit - order (ordered unit) to stop
              • Unit - set (target unit of ability being cast) custom value to ((custom value of (target unit of ability being cast)) + 1)
              • Unit - order (target unit of issued order) to Load (ordered unit)
            • Else - (actions)
              • Do nothing
This should prevent the unit to get into the building by themselves, making the building to actually load them. I also put a debug message so ingame I get a "Bunker cargo +1" so it seems to be allright...
But I also made two other triggers:
-One checks every 0.50 seconds if the bunkers have a 0 custom value: if so, then it will switch them back (should check them one by one) to neutral.
-This is the other one (I'll have to make another one for the UNLOAD ALL):
  • Bunker cargo down
    • Events
      • Unit receives an order with no target
    • Conditions
      • And - All (conditions) are true
        • Conditions
          • (issued order) equal to (order(unload))
          • (unit-type of (ordered unit)) equal to Bunker
    • Actions
      • Unit - set (ordered unit) custom value to ((custom value of (ordered unit)) - 1)
This should reset the Bunker custom value to 0, making it return neutral because of the previous trigger, but it seems not to recognise the UNLOAD order: I put a debug message here too and the "Bunker cargo -1" message didn't show up. Anyone here has an idea?

[EDIT]
Hey, I've managed to make it functioning!!!!! Now units enter in neutral bunkers (and artillery emplacement) and when you unload them (one by one or with the UNLOAD ALL ability) it returns neutral! Well, a pair of times I was unloading 4 units from a bunker and the last one got stuck into the bunker because it returned neutral before I could unload it... I just had to re-load the other units and use the UNLOAD ALL ability. Otherwise, the trigger is now fully functional. Thanks you all for your helping!!!
 
Last edited:
Status
Not open for further replies.
Top