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!
You are using an out of date browser. It may not display this or other websites correctly. You should upgrade or use an alternative browser.
Triggers
Fuel system.w3x
Variables
Initialization
Info
Map Setup
System
Setup
Drain Fuel
Select Unit
Deselect Unit
Gain Fuel
Enter map-specific custom script code below. This text will be included in the map script after variables are declared and before any trigger code.
Name
Type
is_array
initial_value
Cars
group
No
There are a few downsides about this system:
*It uses the player leaderboard, though this can be changed to sumthing else
*When the car runs out of fuel, the car pauses. This aint no good if you're using cars with cargohold. Cuz then the unit inside the car won't have a chance to get out.
*The system also use the unit's custom value
Anyhow; Enjoy the system and give cred if you use it :)
Have fun :)
~Operator
No need to copy!
Map Setup
Events
Map initialization
Conditions
Actions
Visibility - Disable fog of war
Visibility - Disable black mask
Unit - Create 3 . Car (Barrage) for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
Unit - Create 1 . Worker for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
Setup
Events
Unit - A unit enters (Playable map area)
Conditions
(Unit-type of (Triggering unit)) Equal to Car (Barrage)
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering unit) is in Cars.) Equal to True
Then - Actions
Do nothing
Else - Actions
Unit Group - Add (Triggering unit) to Cars
Unit - Set the custom value of (Triggering unit) to 100
Drain Fuel
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in Cars and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Custom value of (Picked unit)) Equal to 0
Then - Actions
-------- The Pause Action is simply to stop the car from moving when not having any fuel. Do change it to sumthing else if wanted. --------
Unit - Pause (Picked unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is selected by (Owner of (Picked unit)).) Equal to True
Then - Actions
Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) - 1)
Leaderboard - Change the title of (Leaderboard of (Owner of (Picked unit))) to (Fuel + (String((Custom value of (Picked unit)))))
Else - Actions
Select Unit
Events
Player - Player 1 (Red) Selects a unit
Player - Player 2 (Blue) Selects a unit
Player - Player 3 (Teal) Selects a unit
Player - Player 4 (Purple) Selects a unit
Player - Player 5 (Yellow) Selects a unit
Player - Player 6 (Orange) Selects a unit
Player - Player 7 (Green) Selects a unit
Player - Player 8 (Pink) Selects a unit
Player - Player 9 (Gray) Selects a unit
Player - Player 10 (Light Blue) Selects a unit
Player - Player 11 (Dark Green) Selects a unit
Player - Player 12 (Brown) Selects a unit
Conditions
(Unit-type of (Triggering unit)) Equal to Car (Barrage)
((Triggering unit) is in Cars.) Equal to True
Actions
Leaderboard - Create a leaderboard for (Player group((Owner of (Triggering unit)))) titled
When a car is deselected it stops using fuel
Deselect Unit
Events
Player - Player 1 (Red) Deselects a unit
Player - Player 2 (Blue) Deselects a unit
Player - Player 3 (Teal) Deselects a unit
Player - Player 4 (Purple) Deselects a unit
Player - Player 5 (Yellow) Deselects a unit
Player - Player 6 (Orange) Deselects a unit
Player - Player 7 (Green) Deselects a unit
Player - Player 8 (Pink) Deselects a unit
Player - Player 9 (Gray) Deselects a unit
Player - Player 10 (Light Blue) Deselects a unit
Player - Player 11 (Dark Green) Deselects a unit
Player - Player 12 (Brown) Deselects a unit
Conditions
(Unit-type of (Triggering unit)) Equal to Car (Barrage)
Actions
Unit - Move (Triggering unit) instantly to (Position of (Triggering unit))
Leaderboard - Destroy (Leaderboard of (Owner of (Triggering unit)))
This trigger is not needed to make the system work, it simply adds fuel to a car.
Gain Fuel
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Fuel
Actions
Unit Group - Pick every unit in Cars and do (Actions)
Loop - Actions
Unit - Set the custom value of (Picked unit) to 100
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.