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

Status
Not open for further replies.
Level 3
Joined
Dec 14, 2007
Messages
44
make a variable and everytime a unit goes in set that variable to +1 and everytime a unit leaves set that variable to -1 and when your variable equals to 0 then make it neutral or w/e.

Nvm theres no unit leaves a transport event which is kinda weird
 
Last edited:
Level 3
Joined
Dec 14, 2007
Messages
44
Could this work? Or did i just waste a bunch of time being a bacon?

  • Unit is loaded
    • Events
      • Unit - A unit Is loaded into a transport
    • Conditions
    • Actions
      • Unit Group - Add Transporting unit to TransportingUnitGroup
      • Set TransportingUnit = (Transporting unit)
      • Set MainUnit = (Loading unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (MainUnit is being transported) Equal to True
        • Then - Actions
          • Unit Group - Add MainUnit to NumberofPPLgroup
          • Set UnitsInVehicle = (Number of units in NumberofPPLgroup)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (MainUnit is being transported) Equal to False
            • Then - Actions
              • Unit Group - Remove MainUnit from NumberofPPLgroup
              • Set MainUnit = No unit
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in NumberofPPLgroup) Equal to 0
                • Then - Actions
                  • Trigger - Turn On Imobilizing Vehicles <gen> (checking conditions)
                • Else - Actions
                  • Do nothing
            • Else - Actions
              • Do nothing
  • Imobilizing Vehicles (Initialy Off)
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • ((Triggering unit) is in TransportingUnitGroup) Equal to True
    • Actions
      • Unit - Order TransportingUnit to Stop
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in (Playable map area))) Greater than 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Do nothing
Forgot a lot of stuff the first time i posted by accident :p
 
Last edited:
Level 5
Joined
May 23, 2008
Messages
148
If you want to detect an unload, then you have too listen for ability 'unload' being used:
  • Bunker Unload
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(unload))
    • Actions
      • Animation - Change (Target unit of issued order)'s vertex coloring to (0.00%, 100.00%, 100.00%) with 50.00% transparency

Here, the unloaded units color and trasnaprency is being changed (I wanted to show you how to refer to the unlaoded unit via Target unit of issued order. You should simply decrement a your loaded units counter.

It only works for single unloads (clicking unit icons). I advise you to remove the Unload ability, which allows all the units transported to be unloaded in one shot.​
 
Level 5
Joined
May 23, 2008
Messages
148
Doh, I must say it deoasn't happend that often, because it dodn't occur to me ^_^, every single unit getting out of the bunker got teal and transparent :wink:.

By massing it, did he mean simply copying the trigger so that the chance of 'missing' the event is smaller?
 
Level 11
Joined
Aug 16, 2007
Messages
847
I am using a Tank, but the unload ability is that of a zeppelin, meaning no it does not unload instantly and not always in the same place.

@Crazycoolcolin

The problem with that is I have multiple tanks that this trigger needs to be affecting, so it would be difficult to use variables, atleast in that manner
 
Level 2
Joined
Jun 15, 2008
Messages
18
Actions - Unit - Set Custom Value
This can be used to store any integer value, and is specific to each individual unit. If you use this instead of variables, you can have as many ships as you want, with different numbers of units.
 
Level 5
Joined
May 23, 2008
Messages
148
Ah but Dagguh then they either wouldn't be able to get out or they would (by clicking on the picture of the guys) and there would be no change.

I think I'm going to see if I can get the Custom value thing working with Colin's trigger

That's exactly what I said before. Without unload ability you can unlaod them only by clicking at their 'pictures'.
 
Level 11
Joined
Aug 16, 2007
Messages
847
Hmm okay I'm having some trouble with this here are the triggers I've used:

  • Garrison
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Garrison
      • ((Owner of (Target unit of ability being cast)) Equal to Neutral Passive) or ((Owner of (Target unit of ability being cast)) Equal to (Owner of (Casting unit)))
    • Actions
      • Unit - Change ownership of (Target unit of ability being cast) to (Owner of (Casting unit)) and Change color
      • Unit - Order (Target unit of ability being cast) to Load (Casting unit)
  • Garrison Copy
    • Events
      • Unit - A unit Is loaded into a transport
    • Conditions
    • Actions
      • Unit - Set the custom value of (Target unit of ability being cast) to ((Custom value of (Target unit of ability being cast)) + 1)
      • Wait until (((Casting unit) is loaded into (Target unit of ability being cast)) Equal to False), checking every 1.00 seconds
      • Unit - Set the custom value of (Target unit of ability being cast) to ((Custom value of (Target unit of ability being cast)) - 1)
      • If ((Custom value of (Target unit of ability being cast)) Equal to 0) then do (Unit - Change ownership of (Target unit of ability being cast) to Neutral Passive and Change color) else do (Do nothing)
nothing seems to happen... except the first trigger that one works fine I just posted it in case its be important.



That's exactly what I said before. Without unload ability you can unlaod them only by clicking at their 'pictures'.

But... that wouldn't help me...
 
Level 1
Joined
Jun 16, 2008
Messages
1
Need Help For Sound Effect Trigger

hello all. i need some help regarding the sound efx for my map... like the first blood, double kill, etc after kills a hero. can somebody pls teach me how to make this code?
 
Level 11
Joined
Aug 16, 2007
Messages
847
Target Unit of Ability Being Cast -> Loading Unit
Casting Unit -> Transporting Unit

And in the wait condition, you messed the units up, they should be the other way around.​

Oh yeah I see

Those actions were originally in the Garrison Trigger, I just forgot to change them.

Well I I'll try it out and see if it works :)


EDIT: Worked perfectly thanks to everyone who helped +rep all aroung :smile:
 
Last edited:
Status
Not open for further replies.
Top