• 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] Getting trigger to work, only when unit is in Transport

Status
Not open for further replies.
Level 4
Joined
Jun 9, 2005
Messages
49
Hello, Im currently trying to get a trigger to work when A unit is inside a farm, then every 60 seconds a 1000 wood (or food in this case) is given to all the players, but I want this only work if the farm has at least one person in, and the effect is increased per person inside the farm.

I made a small effort but its been doing my head in.
--------
Farm Mill
Events
Unit - A unit Is loaded into a transport
Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (Transporting unit)) Equal to Farm Mill
((Unit-type of (Triggering unit)) Equal to Slave) or ((Unit-type of (Targeted unit)) Equal to Villager)
Actions
Trigger - Turn on Generate <gen>
--------
Generate
Events
Time - Every 60.00 seconds of game time
Conditions
Actions
Player - Add 1000 to Player 1 (Red) Current lumber
Player - Add 1000 to Player 2 (Blue) Current lumber
Player - Add 1000 to Player 3 (Teal) Current lumber
Player - Add 1000 to Player 4 (Purple) Current lumber
Player - Add 1000 to Player 5 (Yellow) Current lumber
Player - Add 1000 to Player 6 (Orange) Current lumber
Player - Add 1000 to Player 7 (Green) Current lumber
Player - Add 1000 to Player 8 (Pink) Current lumber
Player - Add 1000 to Player 9 (Gray) Current lumber
Player - Add 1000 to Player 10 (Light Blue) Current lumber
Player - Add 1000 to Player 11 (Dark Green) Current lumber
Player - Add 1000 to Player 12 (Brown) Current lumber
--------
 
Maybe this'll work:
  • Add Unit
    • Events
      • Unit - A unit Is loaded into a transport
    • Conditions
      • (Unit-type of (Transporting unit)) Equal to Farm Mill
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Loading unit)) Equal to Slave
          • (Unit-type of (Loading unit)) Equal to Villager
    • Actions
      • Unit Group - Add (Loading unit) to InTheFarmMill
      • Trigger - Turn on Generate <gen>
  • Generate
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Add (1000 x (Number of units in InTheFarmMill)) to (Picked player) Current lumber
 
Level 4
Joined
Jun 9, 2005
Messages
49
Maybe this'll work:
  • Add Unit
    • Events
      • Unit - A unit Is loaded into a transport
    • Conditions
      • (Unit-type of (Transporting unit)) Equal to Farm Mill
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Loading unit)) Equal to Slave
          • (Unit-type of (Loading unit)) Equal to Villager
    • Actions
      • Unit Group - Add (Loading unit) to InTheFarmMill
      • Trigger - Turn on Generate <gen>
  • Generate
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Add (1000 x (Number of units in InTheFarmMill)) to (Picked player) Current lumber

That is brilliant, you've probably done far more complicated stuff but thanks!

BTW: Happy 700th post, 300 more to go!

#Ignore#

Found it out my self
 
Level 4
Joined
Sep 8, 2008
Messages
73
What really does "loading unit" refers to?
Is it the unit being loaded into the transport?
I couldnt seem to get it to work last time i used that reference, so i suspected it might be like a unit that is loaded - such in loaded into the game.
 
Level 4
Joined
Jun 9, 2005
Messages
49
What really does "loading unit" refers to?
Is it the unit being loaded into the transport?
I couldnt seem to get it to work last time i used that reference, so i suspected it might be like a unit that is loaded - such in loaded into the game.

Assuming theres no Transported unit EventResponse, and Triggering unit refers from anything to a hero leveling up or dieing as long as its related to the triggering, loading unit is probably the closest thing.
 
Status
Not open for further replies.
Top