Post tutorial Report RSS 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 on - 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.

Post comment Comments
fiddlerkain9
fiddlerkain9 - - 4 comments

Cool tut...

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

Reply Good karma Bad karma+1 vote
quanta
quanta - - 1 comments

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!

Reply Good karma Bad karma+2 votes
Maelia
Maelia - - 2 comments

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

Reply Good karma Bad karma+1 vote
mastersrp
mastersrp - - 132 comments

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

Reply Good karma Bad karma+1 vote
Shimmey
Shimmey - - 65 comments

Useful tutorial, nice and straight forward too - thanks!

Reply Good karma Bad karma+1 vote
Kys
Kys - - 346 comments

Oh, thanks!

Reply Good karma Bad karma+1 vote
:Jack
:Jack - - 2,079 comments

Interlopers.com? :D !

Reply Good karma Bad karma+1 vote
Nikholai-Chan
Nikholai-Chan - - 40 comments

Thanks for this it's great :]

The only problem i'm finding [unless i did something wrong] is that even if the gun hasn't spawned yet and you just walk over the trigger again it will spawn right away.

Is there a way to stop that? i would keep trying but SDK crashed ¬_¬

Also on a side note this is great for Ammo pick ups coz unless you have the gun to start with you pick up the prop_dynamic which is render useless :/

Thanks again :]

Reply Good karma Bad karma+1 vote
eaetheaen
eaetheaen - - 10 comments

I want to make an entire mod just so I can use this

Reply Good karma Bad karma+1 vote
Post a comment

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