Working plug Created 9 years ago2014-10-05 20:14:53 UTC by DiscoStu DiscoStu

Created 9 years ago2014-10-05 20:14:53 UTC by DiscoStu DiscoStu

Posted 9 years ago2014-10-05 20:14:53 UTC Post #321945
I want the player to be able to pick up a plug and put it in its socket. I tried to follow this tutorial last night, but the problem with it (or with what I'm doing) is that this only seems to work with the grav gun. I tried a bunch of things and it doesn't seem to work with +use.

Does anyone know what should be done for this to be possible? The map I'm making doesn't have a grav gun...
Posted 9 years ago2014-10-05 22:44:04 UTC Post #321946
can you have the plug hit a trigger and disappear, then have the plugged in version appear (a separate prop_dynamic probably) with some clever use of some relays and such?
Rimrook RimrookSince 2003
Posted 9 years ago2014-10-05 23:01:25 UTC Post #321947
I guess I can try that, but I'm not entirely sure how that changes the plug to be picked up on +use without needing the grav gun.
Posted 9 years ago2014-10-06 04:42:32 UTC Post #321953
My source skills are limited to L4D2 stuff. HL2 physical entities and all that are a bit outside my understanding. How did the plug thing work in Kleiner's lab when the player has to plug that thing in before Alyx is teleported out? Player didn't have the gravity gun then. Can you view the entities involved with crafty or something?
Rimrook RimrookSince 2003
Posted 9 years ago2014-10-06 05:45:50 UTC Post #321954
I bet doodle would know how to do this, since he has a similar setup in his 12 absent men mod, which I would totally recommend if you haven't played it yet ;)

So I would PM the dewd, and/or post a thread over at GB. When you get it sorted, upload an example map! =P
Captain Terror Captain Terrorwhen a man loves a woman
Posted 9 years ago2014-10-06 17:11:28 UTC Post #321964
make an invisible physbox and set the mass factor to something below 1. sometimes things are too heavy to pick up... make the model a prop_dynamic_override and eliminate collisions - parent it to the prop_physbox
Once you've hit your trigger (with the proper filter criteria) disable the physbox motion.

I used this technique with my floating island compo.. only it was just a physbox
Tetsu0 Tetsu0Positive Chaos
Posted 9 years ago2014-10-06 18:19:44 UTC Post #321965
Ooh. I have to check this. I just had a look at the func_physbox but mass scale is 0...

I KIND of got it working by making the plug a prop_physics_override, which I can pick up just fine, but the problem comes when I try to unplug it. The best I can do is that when I +use it, it drops to the floor.

Must keep trying.
Posted 9 years ago2014-10-06 19:53:34 UTC Post #321969
http://twhl.info/vault.php?map=6014

That's for a one-way but if you want to UNPLUG it.. well.. let me try to throw together something

edit 1
i see what you're saying. the plug falls and the player does not catch it. im gonna see if a point_clientcommand can be used to send another +use command after the motion has been enabled. Gravity gun probably has a constant pull whereas the use function is a instant interaction
edit 2
sending a +use command seems to erase your keybinding for E. i must investigate further
edit 3
I figured something out. It's not pretty but it functions and i'm sure it can be tweaked to your liking.
I created a not-rendered func_wall_toggle 'cradle' that toggles when you plug in the.. plug...
So motion is only disabled to remove the plug from your grasp - otherwise the point_teleport doesn't actually remove it. Motion is quickly enabled, but the cradle is now holding the plug (more or less) in place. I have a second trigger on the outskirts of the cradle that will turn the light off and remove the cradle.
This setup is repeatable.

check the same example map link for a version 2 with the cradle trigger in there. I'll work up a sequence of operations if you're interested.
other thoughts
you might be able to have a solid cradle encase the plug and halt motion taht way... if you can touch the plug through the cradle, have the plug +use trigger re-toggle the cradle and release the plug?
Tetsu0 Tetsu0Positive Chaos
Posted 9 years ago2014-10-06 21:21:23 UTC Post #321970
Well that sounds interesting, I'll be trying that tonight.
Posted 9 years ago2014-10-09 15:24:14 UTC Post #322006
Try it?
Tetsu0 Tetsu0Positive Chaos
Posted 9 years ago2014-10-30 03:01:50 UTC Post #322016
Not yet. Been hard at work with uni stuff. Maybe tomorrow!

//edit just to keep the thread from locking while I finish up some schoolwork. Will post again soon.
Posted 9 years ago2015-01-08 00:50:34 UTC Post #323148
Looks like I never posted. I did check out the example map and since I just looked at it again more closely, I thought I'd come back here and say it's a clever workaround for this limitation. Thanks for figuring it out!

Now that I finished dissecting your example and understand how it works, I need to tinker with it to adjust it to my needs. I think it's perfect for what I need.
Posted 9 years ago2015-01-08 02:13:53 UTC Post #323149
Cool!
Glad you found it useful :D
Tetsu0 Tetsu0Positive Chaos
Posted 9 years ago2015-01-08 04:06:30 UTC Post #323150
Definitely. Although I still get the feeling Source is clunky and coarse and if I want something fine, I should be using something entirely different.
Posted 9 years ago2015-01-08 18:48:12 UTC Post #323154
Goldsource? ;)
monster_urby monster_urbyGoldsourcerer
Posted 9 years ago2015-01-08 21:19:20 UTC Post #323157
I suppose that is the reason you're using it for The Core!
You must be logged in to post a response.