Cleanup is going to take awhile, so the site is back up but editing has been disabled.

VendingMachine

From HalfLife 2 Knowledge Base

Jump to: navigation, search

For those of you who've played cs:s cs_office you know I am discussing.

Step1: Vending Machine-

Create a prop_static then adjust it's location in your map. Then open it's properties and set world model to "models/props/cs_office/Vending_machine.mdl" without the "" or if you've managed a custom mdl use that.

VMstep1.jpg

Step2: Bottle & Dispenser-

Now we want to make the bottle and dispenser so that it shoots out of the machine but also making it look realistically and not getting in anyones way. (well thats really up to you.)

Well this is quite simple. Take your entity tool and create a env_shooter. Lets name it "shooter1" without the "".

Now set these settings:

Gib Direction: Direction in which you want your bottle to fire Number of Gibs: Set it to 1 so that no more than one fires out of the machine ;p Gib Angles: Orientation of the spawned bottle (standing up, on its side, etc) Gib Velocity: Speed in which the bottle is fired Course Varieance: slight variance in direction Gib Life: Set it to how many seconds you want your bottle to exist in your map (I set to 10) Model: Set this to models/props/cs_office/Water_bottle.mdl or your own custom mdl Material Sound: Set to NONE as the bottle will create it's own sound. Simulate: Set to Physics

Now under the flags tab check "Repeatable" so that it will fire more than just once.

VMstep2a.jpg


Now for our button. Create a brush using the tools/toolsinvisible material/texture covering your vending machines buttons. Tie it to the entity func_button.

Set up as so:

Sounds: Up to you I didnt add any. Delay Before Reset: Again up to you but I set it to 2 (seconds)

Under the flags tab check off "Don't move" and "Use Activates (which should already be checked by default)"

Under the Output tab create this line

OnPressed | shooter1 | shoot | 0.00 | No

Now when you press your button it will activate the env_shooter firing off a bottle (if you placed the env_shooter correctly with your tweaked settings it should pop out of the vending machines mouth realistically)

VMstep3a.jpg


VMstep4.jpg


Good luck and enjoy.

Tats...

P.S. Thank you Samejima motivating me to find alternative and cleaning this up.

Edit: This is a new version of VendingMachine after playing with it a bit more I found this to be much simpler and add the effect I wanted. Hope it helps...

Personal tools