Vending Machine

Tutorial collection, comprehensive listings on main site.

Vending Machine

Postby Tutorial on Mon Mar 07, 2005 10:21 pm

category
General Half-Life 2/Entities

description
Thirsty? A working vending machine.

keywords
vending, machine, bottle, vend.

In this tutorial you will learn how to create a water bottle vending machine similar to the cs_office vending machines.

Start off with the room you want the vending machine to be in. Select your entity tool and place an entity in your map. While it is still selected, press alt+enter and select prop_static from the list. Click on World Model under the Keyvalues and browse for the model named models/props/cs_office/Vending_machine. Adjust your model so it is on the ground and facing the direction your want it to.

Image

We will now create what will cause the bottle to be shot from the vending machine.

Select your entity tool and place it near the vending machine model. While it is selected press alt+enter and choose env_shooter from the list. Give it the following properties:

Name: shooter
Gibs Direction: This will be explained below.
Number of Gibs: 1
Gib Velocity: 150 - This is the speed that the bottle comes out at. You can change this setting to what suits you.
Gib Life: 20 - This is the time in seconds before the bottle disappears.
Model: models/props/cs_office/Water_bottle.mdl
Simulate: Physics

Under the flags tab, tick Repeatable

You must now adjust your env_shooter so it is postioned correctly with the model.

Image

Gibs Direction:

I will now explain how to change the Gibs Direction. In the picture below I have circled the two parts to look out for. The circled part on the properties window is where you edit the direction. You simply click on the white line and change which way it faces. The yellow line is the direction the gib will shoot in. After editing the direction in the properties box and clicking on apply, the yellow line will indicate the new direction.

Image

We must now create a brush and place it over the button of the vending machine as shown below.

Image

With the brush selected, press ctrl+t and choose func_button. Give it the following setings:

Delay Before Reset: 4 - This number can be changed to suit your needs.

Under the flags tick Don't Move and Use Activates.

Next we must setup the Outputs tab. Set it up as show in the image below.

Image

Thats it. Just compile and test.

Related
Example Map

Cr4ig
- Don't send PM's to this user -
Tutorial
Not A Real User
 
Joined: Sun Mar 06, 2005 11:00 pm

battery dispenser

Postby Mikkelmann on Sun Dec 04, 2005 11:32 am

Can you dispense working batterys with the env_shooter entity? :?
Mikkelmann
Just Joined
Just Joined
 
Joined: Sun Dec 04, 2005 11:30 am

Postby Nick99 on Sun Jan 08, 2006 1:48 am

The vending machine model doesn't appear
can u help me?
Nick99
Member
Member
 
Joined: Sun Jan 08, 2006 1:45 am

Postby RSX WHEEEEEE on Sun Jan 08, 2006 3:51 am

would it be possible to make this brush-based and have it shoot exploding barrels for HL2?
User avatar
RSX WHEEEEEE
May Contain Skills
May Contain Skills
 
Joined: Tue Jun 21, 2005 4:19 pm
Location: ATL HO!

Postby supaste on Fri Feb 02, 2007 4:39 pm

why is this under half life tutorials?

this tut should be moved to css and a new version should be made for half life with the correct half life modles because this will confuse and piss off lots of people.
Image
supaste
Regular
Regular
 
Joined: Sun Nov 12, 2006 3:51 pm

Postby EagleStrike on Sat Feb 03, 2007 9:36 pm

Dude, you shoud of like, left this post too die...get ready for rampancies from members seeing it, but I've been looking for a vending machine tutorial for a while now, ta for finding it... :)
As I Walk Through The Valley Of Death, I Will Fear No Evil, Cos I'm The Meanest Fucker In The Valley...
EagleStrike
Pheropod
Pheropod
 
Joined: Sun Dec 03, 2006 7:26 pm
Location: London, England

Postby Mr. Happy on Sat Feb 03, 2007 11:31 pm

It was always there

in the tutorials tab :shock:

Dun worry bumping tuts dont matter
Image
-You've just been happified!?
User avatar
Mr. Happy
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Sat Dec 30, 2006 9:20 am
Location: Flyin' thru "da cloud" in the MotherShip

Re: Vending Machine

Postby darknight22 on Fri Oct 24, 2008 11:33 pm

it might be just for mine but you forgot to name the vending machine and set the shooter`s and the button`s parent the the vending machine cos some one might punt it with the grav gun.
darknight22
Dumpling
Dumpling
 
Joined: Sun Oct 19, 2008 4:23 am
Location: Ozzy

Re: Vending Machine

Postby budongzzz on Sat Apr 25, 2009 8:07 am

anything here is vending machine, thanks you give some info


_________________
Vending Machines
budongzzz
Just Joined
Just Joined
 
Joined: Sat Apr 25, 2009 8:04 am

Return to Tutorials

Who is online

Users browsing this forum: No registered users