Welcome to PlagueFest.com! Log in or Sign up to interact with the Plague Fest community.
  1. Welcome Guest! to interact with the community and gain access to all the site's features.

Tutorial Hammer: Special Objects

Discussion in Resources & Tutorials started by Jenos, Aug 13, 2011

  1. Mar 25, 2011
    Hello, I'd make this tutorial for any new mappers out there, as this technique is no secret. I'm sure all of you who frequent Zombie Escape have played Minas Tirith, Mako FFV-whatever, and Predator. And in these maps I'm sure you've seen special objects you can pick up, in Minas, the variety of items at the store, the collection of big guns on Predator, and the Materias on Mako FFFIVIFIV. And you're probably wondering "what's for dinner?", so you're going to want to read this to figure out how to do that.

    Difficulty: 2/5

    Words/commands you should know:
    • Parent: "The material or source from which something is derived"- Or in other words, the object that controls other objects.
    • !activator: This goes in the output box, it tells the trigger to affect the person or object that activated it.
    • AddHealth: Another output, this supposedly adds health to a breakable/player, I haven't had any luck with this.
    • AddOutput: Successful substitute for AddHealth, read the next bullet to see why.
    • Health <integer>: Adds health to object specified.
    • Biased - Me
    Step one-Setting up
    The first thing you want to do is open Hammer, unless you've already opened it. Place an entity anywhere in your map and make it a "weapon_<gun>" without quotes and <gun> being a type of gun. The gun is going to need a name for your gun, we'll name it Gump. You're also going to want some type of model or in your case something really ugly, an eyesore really. If you've created, or more likely downloaded a model, you're going to want to make it a prop_dynamic. If you've created some kind of boxy, metal machine gun, you're going to want to make it a func_physbox, and everyone else is going to want to look away.

    So I've made my Dynamic prop, now what?
    Good, I'm proud of you. You now have to parent this prop. Go into the props settings (Double click it) and go to that parent button. In the box type "Gump". You're also going to enjoy this more if you disable vphysics on the object. Why do you want to do this? The reason is because if it's not disabled, you will move as if you had 500 ping, if you were able to move at all.
    So I've made this... Thing out of blocks, it's a machine gun, where do i go from here?
    Well, it's your map, not mine. You're going to want to make this a func_physbox, or func_physbox_multiplayer the difference aren't that huge when you disable vphysics on the damn object. First thing's first though, You're going to want to parent your... special item. As before, parent it to your gun, "Gump". Also, you'll want to make sure that Vphysics is disabled.

    Step two-Making connections
    So you've made a equip-able object, in-game you should be able to pick it up, and walk around with both Gump and your item. But it doesn't do anything it's virtually useless. We're going to make it useful. Now what you do is going to depend on the object type.

    I made a weapon, it shoots bullets and is supposed to push zombies away.
    Well, that's easy. First you want to make (my preference) a box with the npc clip texture. Size does not matter, but i make them small to avoid griefing. Click it and press Ctrl+t, make it a func_button. Parent it, as usual, to Gump. Now once you've done that, make a box with a trigger texture, it should be large, and it's your choice how far from the gun it stretches. Ctrl+t on it, and make it a fun_push. In the options, look for push direction. In the top left you will see a circle. Drag the line to face away from your object relative to the top view. Parent the func_push to gump. Give it a name, we'll name it cement. Make sure it starts disabled. Now, make a filter_activator_team, and filter the terrorists, name it zombies. Go back into the func_push and in the filter name, put zombies. Finally, go back to that button you made ages ago and put this in the outputs: OnPressed->cement->enable, with a delay of 0 (your choice), and after that ->OnPressed->cement->Disable, with a delay of 30 seconds (you choice). And thats it, you can change the speed of the func push and other things as you please.

    I made a health kit, and want it to heal people in the area, how do i go about doing this?
    First make the func_button, then put a a box with the trigger texture around the health kit (when i saw around i mean this is the radius of the healing). This is experimental, I've never done it before because i cant test it in multiplayer, but make a trigger_proximity. Give it a name, we'll name it trigger_proximity. Make another filter_activator team, this time filter the ct's, name it humans. Back to the trigger_proximity, put "humans" in the filter field. now, back to the button, make this output: OnPressed->trigger_proximity->AddOutput with a perimeter override of Health <integer>. Or you could try this.

    FAQ-will be updated if necessary.

    In Tirith the trolls, Gandalf, the white knight, and the Balrog actually walk, how do i do this?
    Hannibal obviously had custom models, but his models had custom animations too, if you want your models to walk, or whatever you want it to do, you'll have to create or download animations.
    In Tirith, many of the objects have their own sounds, like Gandalf, how do i do this.
    You do this with an ambient_generic, use the button to activate it. In a later tutorial (if i do any) I'll cover importing custom sounds.
    In Mako, the materias all have fancy effects, how do i do this?
    Again, Hannibal (also known as Rafuron) made these effects himself (I'm only assuming this, as there is no special mention in the map credits). You will either have to make your own or contact Hannibal and ask permission to use his.
    Post your questions in this topic and i may include them in the op.

    Thanks for reading, I hope this helped you feedback is appreciated!
  2. Oct 10, 2010
    nice tut,
    but screenshots always help a lot
  3. Jul 10, 2011
    Nice post! I've never done this, but was going to try and fix one up since I figured it couldn't be that much harder than standard triggers, but your guide saved a ton of time!

    Thanks again!
  4. Sep 25, 2010
    Just what i needed.
  5. Aug 19, 2011
    In answer to the Mako Special Effects on materia, hannibal did produce all those himelf. They were made using the particle editor.

    And yes excellent tutorial, with a bit of extra thought from a mapper, this provides the basis for any kind of original weapon imaginable.

    Also abou the hannibals custom player models in tirith, I *believe* i can explain how they work. Maybe i will write a tutorial on them as well soon. They are rather complicated stuff involving a very powerful entity called gameui. Ill explain someday, but it would only be of use to very few people and dont know if its worth my time to explain