Left 4 Dead 2

Left 4 Dead 2

Not enough ratings
Randomized foot lockers
By Evil
A quick guide explaining how to create randomized foot lockers
   
Award
Favorite
Favorited
Unfavorite
Randomized foot locker spawns
(If you know how to create working foot lockers but need help with randomizing the spawn, skip to step 10.)

THE FIRST LOCKER

1. Place a prop_dynamic in your map, and change it's world model to footlocker01 (it is recommended to disable shadows and change collisions to 'not solid'). Make sure to give it a name.

2. Using the 'nodraw' texture, create 1 unit thick brushes to act as the sides, bottom, and lid of the box (the 'lid' should be in the closed position, sealing the box)

3. Next, hold CTRL and select the four walls and floor of the nodraw box, now hold CTRL and hit T to tie them to an entity (this will essentially make all the brushes act as one). Change it's class to func_brush. Next, double click any of the panels to open it's properties, here you're going to change:
Name: foot locker 1 no draw box
Parent: foot locker 1 (the physical model)
Input filter: Ignore all
Solidity: Always solid
Disable receiving shadows: yes

4. The lid will now need a few changes too. Select it, hold CTRL and hit T, and change it's class to func_brush. Under properties, change these:
Name: foot locker 1 lid
Parent: foot locker 1
Input filter: Ignore all
Solidity: always solid
Disable receiving shadows: yes

5. Next you will want to find the 'clip' texture, and create a small brush where the player will open the box from (where they would put their hand when opening it). While this brush is still selected, hold CTRL and hit T, and change it's class to func_button. Now open it's properties and change:
Name: foot locker 1 button
Parent: foot locker 1
Disable receiving shadows: yes
Delay before reset: -1
And under flags, hit 'Don't Move'

6. Now we're going to add several outputs to the button.
1st: OnPressed - foot locker 1 - SetAnimation - opening - delay 0:01 - Fire Once Only (yes)
2nd: OnPressed - foot locker 1 lid - kill - delay 0:02 - Fire Once Only (yes)

7. Place items in the foot locker. (Don't use the weapon_spawn entity, use 'weapon_pain_pills_spawn' or an equivilant instead, the game won't remove weapon_spawn entities with the 'kill' command?). Change the names of all items to 'foot locker 1 items', and under flags, check 'Must exist'.

8: Double click the locker model and add an output of: OnAnimationDone - foot locker 1 - SetAnimation - open - delay 0:01 - Fire Once Only (yes)

DUPLICATING THE LOCKER

9. Next you will need to hold CTRL and select all parts of the box (walls, floor, lid, button, model, and items), release CTRL, hold shift and drag them to the next locker location. Now open the properties of each item and change the (1) to a (2) in their names. You will also need to update the outputs on the model and the button, open the outputs tab and use the eye dropper tool to update each accordingly (foot locker 1 lid will need to be changed to foot locker 2 lid for example).
**************************************************
RANDOMIZING THE SPAWN

10. Now we need a logic_case entity. Place it near one of the boxes, and give it a name (foot locker logic case). Now we need several outputs:
OnCase01 - foot locker 2 - kill hierarchy - delay 0:02 - Fire Once Only (yes)
OnCase01 - foot locker 2 items - kill - delay 0:03 - Fire Once Only (yes)
OnCase02 - foot locker 1 - kill hierarchy - delay 0:02 - Fire Once Only (yes)
OnCase02 - foot locker 1 items - kill - delay 0:03 - Fire Once Only (yes)

11. Next we need something to trigger the logic_case, so we'll use a logic_timer entity. Place one near the logic_case entity, and name it foot locker logic timer. It will need a couple outputs:
OnTimer - foot locker logic case - PickRandom - delay 0:05 - Fire Once Only (yes)
OnTimer - foot locker logic timer - kill - delay 0:07 - Fire Once Only (yes)
Be sure to set it's refire interval higher than it's kill interval (5 seconds is fine).



That should be it, you should now have a randomized spawn. To apply this to more foot lockers, you will simply add a new case for each locker (4 lockers = 4 cases), and each case will have two more outputs per locker (one to kill the locker hierarchy, one to kill the items inside). So, for 4 lockers, it'd look like this:

OnCase01 - foot locker 2 - kill hierarchy - delay 0:01 - Fire Once Only (yes)
OnCase01 - foot locker 2 items - kill - delay 0:02 - Fire Once Only (yes)
OnCase01 - foot locker 3 - kill hierarchy - delay 0:02 - Fire Once Only (yes)
OnCase01 - foot locker 3 items - kill - delay 0:03 - Fire Once Only (yes)
OnCase01 - foot locker 4 - kill hierarchy - delay 0:03 - Fire Once Only (yes)
OnCase01 - foot locker 4 items - kill - delay 0:04 - Fire Once Only (yes)
OnCase02 - foot locker 1 - kill hierarchy - delay 0:01 - Fire Once Only (yes)
OnCase02 - foot locker 1 items - kill - delay 0:02 - Fire Once Only (yes)
OnCase02 - foot locker 3 - kill hierarchy - delay 0:02 - Fire Once Only (yes)
OnCase02 - foot locker 3 items - kill - delay 0:03 - Fire Once Only (yes)
OnCase02 - foot locker 4 - kill hierarchy - delay 0:03 - Fire Once Only (yes)
OnCase02 - foot locker 4 items - kill - delay 0:04 - Fire Once Only (yes)
And so on.
***********************************************

FURTHER RANDOMIZING

Optionally, you can add an alternate set of items to each foot locker spawn to shuffle between. For this, we will need to change the name of the items in the first foot locker to 'foot locker 1a items'. Next, hold CTRL and select all the items inside, release CTRL and hold shift; now drag the items over slightly. Open the properties and change '1a' to '1b' in the name field. Now place a logic_case next to the foot locker and name it 'foot locker 1 items logic'.
This will need two outputs:
OnCase01 - foot locker 1a items - kill - delay 0.01 - Fire Once Only (yes)
OnCase02 - foot locker 1b items - kill - delay 0.01 - Fire Once Only (yes)

We now need to add an output on our main logic case (foot locker logic case). This output will be:

OnCase01 - foot locker 1 items logic - PickRandom - delay - 0.04 - Fire Once Only (yes)

Since the items are still parented to the foot locker, they will be removed with the rest of the items when 'kill hierarchy' is fired, no additional outputs are needed.
8 Comments
Mr. Fortnite Jan 31, 2018 @ 3:36pm 
ill leave u to it. PEACE! OUT!

Evil  [author] Jan 31, 2018 @ 3:26pm 
lulz I guess. It's literally impossible for this guide to give anyone green blobs unless their game is either missing textures or assets, which has nothing to do with this guide and everything to do with verifying game integrity.
Mr. Fortnite Jan 31, 2018 @ 3:03pm 
thx bro, i just think u need to do somethin about the textures it just looks like a green blob:steamhappy:
Evil  [author] Jan 31, 2018 @ 2:47pm 
Figured that was a troll comment, but you gotta approach all these with the assumption that people actually need help. I did leave a few minor details out by accident though (involving changing tools to select one brush side, or multiple brushes), was thinking he may have been talking about one of those.
Mr. Fortnite Jan 31, 2018 @ 1:43pm 
you dont need to
ᴿᴱᴻᴱ™ Jan 31, 2018 @ 11:10am 
@Cemetera : he didnt even start L4D2 authoring tools...
Evil  [author] Jan 30, 2018 @ 2:42pm 
which part? the locker set up, or the randomization?
Mr. Fortnite Jan 30, 2018 @ 2:13pm 
didnt work??
:steambored: