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
Item Cleanup (1).w3x
Variables
Item Cleanup
Item Cleanup
Test
Init
Respawn Items
Count Items
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
CleanedItem
item
Yes
ItemCleanupFlag
boolean
No
ItemCleanupTimer
timer
No
ItemsToClean
integer
No
Loop
integer
No
Point
location
No
Original mechanics by Trilititi, made portable for GUI users by Bribe.
Disclaimer: Don't set the life of a dead item unless you know what you are doing.
It will bug the system if you set a dead item's life to a value between 0 and 1.
Item Cleanup
Events
Time - Every 15.00 seconds of game time
Time - ItemCleanupTimer expires
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
ItemCleanupFlag Equal to True
Then - Actions
Set Variable Set ItemCleanupFlag = "false"
-------- --------
-------- Loop through all dead items and remove them --------
-------- --------
For each (Integer Loop ) from 0 to ItemsToClean , do (Actions)
Loop - Actions
Item - Set life of CleanedItem[Loop] to 1.00
Item - Remove CleanedItem[Loop]
Set Variable Set CleanedItem[Loop] = No item
Else - Actions
-------- --------
-------- Clean up all dead items on the map every 15 seconds --------
-------- --------
Set Variable Set ItemsToClean = "-1"
Item - Pick every item in (Playable map area) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Current life of (Picked item)) Equal to 0.00
Then - Actions
Set Variable Set ItemsToClean = (ItemsToClean + 1)
Set Variable Set CleanedItem[ItemsToClean] = (Picked item)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
ItemsToClean Greater than or equal to 0
Then - Actions
-------- --------
-------- Start a 1.50 second timer to give time for any death animations to play --------
-------- --------
Countdown Timer - Start ItemCleanupTimer as a One-shot timer that will expire in 1.50 seconds
Set Variable Set ItemCleanupFlag = "true"
Else - Actions
Init
Events
Map initialization
Conditions
Actions
Game - Display to (All players) the text: Press Esc to count the number of items in the map
Set Variable Set Point = (Center of (Playable map area))
Item - Create Tome of Intelligence at Point
Unit - Create 1 . Blood Mage for Player 1 (Red) at Point facing 0.00 degrees
Custom script: call RemoveLocation(udg_Point)
Respawn Items
Events
Unit - A unit owned by Player 1 (Red) . Acquires an item
Conditions
Actions
Set Variable Set Point = (Random point in Test_Region <gen>)
Item - Create Tome of Intelligence at Point
Custom script: call RemoveLocation(udg_Point)
Count Items
Events
Player - Player 1 (Red) skips a cinematic sequence
Conditions
Actions
Set Variable Set Loop = "0"
Item - Pick every item in (Playable map area) and do (Set VariableSet Loop = (Loop + 1))
Game - Display to (All players) the text: (String(Loop))
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.