Gordon Freeman is back! Half-Life 2 picks up some time after the original Half-Life left off, with Gordon Freeman working for the G-Man. Along with scientist Eli Vance and his daughter Alyx, your mission is to... well, that would be telling.

Report this article Rotating Pickups

Learn how to make rotating weapons/items (like Doom 3) in any Source game. Using the dynamic input and output system and a few other entities, you will learn how to create this under appreciated visual device.

Posted by Ripper_hugme on Jun 12th, 2007 digg this super bookmark
Basic Mapping/Technical.


Ever want to have the weapons/items of your map float and spin around like in id Software games (Quake, Doom3 and RTCW). In HL1 it was easy but in Source it’s a bit tricky because of Havok physics and the parent system. So we’re going to pull a trick out from under our sleeves. You know those old movies with the effect that stopped the camera and have the actor walk off and replaced by a man in a tin foil suit or an explosion and then have the camera start running again? This is the basic idea behind this tutorial.

First place a prop_dynamic and name it ‘shotgundummy’. Set the world model to ‘models/weapons/w_shotgun.mdl’. Finally change the prop’s collision to ‘not solid’.

Now create a small (3x3x6 units or so) brush and texture it with the origin texture (tools/toolsorigin) and position it in the relaticenter of the prop_dynamic. Tie it to a func_rotating and give it the name ‘shotgunrot’. Make sure to also mark the ‘Start on’ and ‘not-solid’ flags. You can change the speed and etc. if you want, but the default is good enough for me.

User Posted Image

Return to the prop and assign the parent your rotating brush. Add a weapon_shotgun slightly above the rest of the mess and as usual, name it ‘shotgunreal’. Put a point_template and an env_entity_maker on the gun. Open the template’s properties and change the name to ‘shotguntemplate’ and assign template 1 to ‘shotgunreal’. Open the env_entity_maker and change the 'point template to use' to our own point_template.

User Posted Image

Now we have the basic structure done, it’s time to wire the beast. Make a trigger_multiple the size of the prop’s bounding box. Add 3 ‘OnStartTouch’ outputs and make them as shown:

Entity: shotgundummy
Input: TurnOff

Entity: shotgundummy
Input: TurnOn
Delay: 16

Entity: shotguntemplate
Input: ForceSpawn



Now go to properties and set time before reset to 16, as 16 will be the amount of time (in secs) before the weapon will be available to spawn and the process to start (make sure the time matches your TurnOn input’s delay) again. Leave the flags as they are and continue onto the final step.

For the last step, go back to the point_template entity and make an OnEntitySpawned output like this:

Entity: shotgunreal
Input: kill
Delay: 0.03

This is to make sure you don’t have a shotgun lying around unnecessarily and screwing the effect if you’ve already picked up the gun.

The Final Results:

User Posted Image

User Posted Image

Notes

You may want to add a respawn sound or maybe a light that toggles while the gun is there/not there; by using the output system.

In Counterstrike Source you can use this method to mark bombsites with the C4 prop model.

In Day of Defeat Source you can make demo pack markers using the method with a few alterations as well.

I recommend that you only use this for weapons, medkits and batteries, as it’s a lot of entities for ammo, which in keeping to deathmatch law should be sitting next to the weapon it works with anyway.

To make an item that rotates in singleplayer, simply parent an item to an origin brush as there is no need to respawn the item.

Comments
fiddlerkain9
fiddlerkain9 Jun 17 2007, 2:50am says:

Cool tut...

I'll keep it in mind when I make my next map.

+1 vote     reply to comment
quanta
quanta Jul 2 2007, 12:27pm says:

Hey that's pretty cool. Heh, I never thought about how tricky that might be.

Something you might want to add is how to use a func_tracktrain to get the gun to pulse up and down - that'd be really cool!

+1 vote     reply to comment
Maelia
Maelia Dec 16 2007, 3:36pm says:

cool effect. Only problem I had with it was it doesn't check if the user already have the weapon making it unavailable for him/her. If we do it this way, people would camp the weapon spawn and have the gun disappear so others can't have it

+1 vote     reply to comment
mastersrp
mastersrp Jan 1 2008, 11:03am says:

hmm..pretty nice. i think im gonna use this for some of my maps. thanks :D

+1 vote     reply to comment
Raithien
Raithien Jul 22 2008, 11:52am says:

Useful tutorial, nice and straight forward too - thanks!

+1 vote     reply to comment
Post a Comment

Only registered members can share their thoughts. So come on! Join the Mod DB community today (totally free) and do things you never thought possible.

Icon
Half-Life 2
Platforms
PC, X360, PS3, XBOX
Developer & Publisher
Valve
Engine
Source
Contact
Send Message
Official Page
Valvesoftware.com
Release Date
Released Nov 10, 2004
Game Watch
Track this game
Bookmark
Digg Super bookmark
Tutorial
Browse
Tutorials
Views
1,564 (4 today)
Report Abuse
Report this article
Bookmark
Digg Super bookmark
Related Games
Half-Life 2
Half-Life 2
Single & Multiplayer First Person Shooter