• 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] Help on my Trigger!!!!

Status
Not open for further replies.
Level 5
Joined
Nov 13, 2007
Messages
99
Hello guys, I'm trying to make car washing trigger. It only works when the car is damaged and car washing basically heals the car. Here is the trigger:
  • Checking
    • Events
      • Unit - A unit enters Washing Time <gen>
    • Conditions
      • ((Owner of (Entering unit)) Current gold) Greater than or equal to 1000
      • (Race of (Entering unit)) Equal to Demon
    • Actions
      • Trigger - Turn on Car Washing <gen>
  • ----
  • Car Washing
    • Events
    • Conditions
    • Actions
      • Unit - Set the custom value of (Last created unit) to (Player number of (Triggering player))
      • Player - Add -1000 to (Owner of (Entering unit)) Current gold
      • Unit - Move (Entering unit) instantly to (Center of Time to Repair <gen>), facing Default building facing degrees
      • Unit - Change ownership of (Entering unit) to Player 10 (Light Blue) and Retain color
      • Wait 30.00 seconds
      • Trigger - Turn on Wash <gen>
  • ----
  • Wash
    • Events
    • Conditions
    • Actions
      • Unit - Move (Entering unit) instantly to (Center of Drying <gen>), facing Default building facing degrees
      • Unit - Change ownership of (Last created unit) to (Player((Custom value of (Last created unit)))) and Retain color
----
At first i'm trying to:
1)When the owner of the car has at least 1000 or more money, he can go into the healing spot. Then the trigger changes the color so that the car can't be moved by the owner. Then after the healing is done, the car is then move back outside. I actually want that to happen, but it doesn't really work. Something must've happen to the trigger. Please help!
 
Last edited:
Level 5
Joined
Apr 21, 2006
Messages
82
I can see no "Last Created Unit" in those trigger, in which case i think those don't work at all. You need to save the unit into a variable and then put that variable on those triggers. And yes put
  • tags to make it easier to read as well >.>
  • [trigger]
  • Set Car = (Last created unit)
something like that you need to put somewhere to 'indetify' the unit you want to wash
 
Level 18
Joined
Mar 13, 2009
Messages
1,411
  • Checking
    • Events
      • Unit - A unit enters Washing Time <gen>
    • Conditions
      • ((Owner of (Entering unit)) Current gold) Greater than or equal to 1000
      • (Race of (Entering unit)) Equal to Demon
    • Actions
      • Trigger - Turn on Car Washing <gen>
----
  • Car Washing
    • Events
    • Conditions
    • Actions
      • Unit - Set the custom value of (Last created unit) to (Player number of (Triggering player))
      • Player - Add -1000 to (Owner of (Entering unit)) Current gold
      • Unit - Move (Entering unit) instantly to (Center of Time to Repair <gen>), facing Default building facing degrees
      • Unit - Change ownership of (Entering unit) to Player 10 (Light Blue) and Retain color
      • Wait 30.00 seconds
      • Trigger - Turn on Wash <gen>
----
  • Wash
    • Events
    • Conditions
    • Actions
      • Unit - Move (Entering unit) instantly to (Center of Drying <gen>), facing Default building facing degrees
      • Unit - Change ownership of (Last created unit) to (Player((Custom value of (Last created unit)))) and Retain color
----

Here go the tags.

Make a unit variable
In the first trigger you make an action:
[UnitVariable]=Entering Unit

Then in the other triggers you use the variable instead of Entering Unit.
 
Level 5
Joined
Apr 21, 2006
Messages
82

  • Checking
  • Events
    • Unit - A unit enters Washing Time <gen>
  • Conditions
    • ((Owner of (Entering unit)) Current gold) Greater than or equal to 1000
    • (Race of (Entering unit)) Equal to Demon
  • Actions
    • -------- Store the car into a variable so we can use it later on triggers. --------
    • Set WashingCar = Entering Unit
    • Trigger - Run Car Washing <gen> (Checking conditions)


  • Car Washing
  • Events
  • Conditions
  • Actions
    • Set RepairPoint = (Center of Time to Repai <gen>)
    • -------- Point variable above; in the end of trigger we'll remove the leak that the point creates. --------
    • Unit - set the custom value of WashingCar to (Player number of (Owner of unit(WashingCar)))
    • Player - Add -1000 to (Owner of (WashingCar)) Current Gold
    • Unit - Move Washing Car instantly to RepairPoint, facing Default building facing degrees.
    • Unit - Change ownership of WashingCar to Player 10 (Light Blue) and Retain Color
    • Wait 30.00 seconds
    • Trigger - Run trigger Wash <gen> (Checking Conditions)
    • -------- Here we remove the point so it won't create leaks. --------
    • Custom script: call RemoveLocation(udg_RepairPoint)


  • Wash
  • Events
  • Conditions
  • Actions
    • -------- Again the same as in the 2nd trigger --------
    • Set DryingPoint = (Center of Drying <gen>)
    • Unit - Move WashingCar instantly to DryingPoint, facing Default building degrees
    • Unit - Change ownership of WashingCar to (Player((Custom value of (WashingCar)))) and Retain Color
    • Custom script: call RemoveLocation(udg_DryingPoint)
however only 1 player can do this at time cause there is "Wait 30.00 seconds" action.
 
Level 18
Joined
Mar 13, 2009
Messages
1,411
You could say that Run sort of fulfills the Event for another trigger of your choice (and then you can choose whether Conditions are ignored or not). Turn on just makes the trigger work when it is turned off (not working ;P)
 
Status
Not open for further replies.
Top