Pick up the crowbar of research scientist Gordon Freeman, who finds himself on an alien-infested Earth being picked to the bone, its resources depleted, its populace dwindling. Freeman is thrust into the unenviable role of rescuing the world from the wrong he unleashed back at Black Mesa. And a lot of people, people he cares about, are counting on him.

Post tutorial Report RSS How to add a button to your level

This is a simple tutorial that shows you how to add a button in your Half-life 2 level.

Posted by on - Basic Mapping/Technical

[page=Adding a button]
This is a fairly short and simple tutorial that will show you how to add buttons to your map. For the example we are going to create a button, that when hit will ignite a zombie. After learning this it is easy to use buttons for other purposes. This is my first tutorial, so sorry if it's not very clear.

Adding the room and models

First off we will create a simple room. Add an npc_zombie (name it zombie1) in the middle of the room and place your info_player_start near it. Create a prop_dynamic and choose a button model for it. Place this model on the wall near your info_player_start.

func_button

Next, we want to create a brush about the size of your button model and place it inside your button model. Give it the toolsinvisible texture. Convert this brush to an entity and make its class function _button. Go to the Outputs tab and click add.

Tutorial Image

Now fill out the propeties as shown in the above picture. and hit apply.

Conclusion

Compile the map, walk up to the button, and hit e. The zombie should burst into flames ( :) )
Now you can experiment with func_button try using it to unlock a door or toggle a light on and off. Have fun!

Tutorial Image

- Salohcin

Post comment Comments
myles
myles - - 854 comments

Nice, althoguh a little vague

Reply Good karma Bad karma+1 vote
Sallycin Author
Sallycin - - 635 comments

Sorry, if you want anything explained in further detail just ask :)

Reply Good karma+1 vote
Pastry_Theft
Pastry_Theft - - 5 comments

where can i get a list of funtions for the buttons (ignite, unlock), or is it already there and i just dont see it?

Reply Good karma Bad karma+1 vote
Sallycin Author
Sallycin - - 635 comments

I don't no if anyone has made a full list of functions. I'd look around Valve developers community

Developer.valvesoftware.com

Reply Good karma+1 vote
mathew1927
mathew1927 - - 31 comments

how do u choose a button model

Reply Good karma Bad karma+1 vote
mathew1927
mathew1927 - - 31 comments

how do u change the button ?????
confused?!! :(

Reply Good karma Bad karma+1 vote
mathew1927
mathew1927 - - 31 comments

its good but you've put this under begginer so it will need more detail to make sense to most users.
You dont have to go into making a map but a little more detail would be good

Reply Good karma Bad karma+1 vote
Glazer
Glazer - - 20 comments

Indeed, a little vague, but I got by with what I learned from earlier tutorials. I was pretty proud of myself when I started that dumb zombie on fire, I've come quite a long way since I began modding this afternoon, but I've got plenty more work ahead of me! Thanks for posting man!

Reply Good karma Bad karma+2 votes
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: