[SOLVED] Teamwork to Move Objects

Need Help? The Day isnt going so well on the Mapping front?
Post Reply
shiftey
npc_combinegunship
npc_combinegunship
Posts: 705
Joined: Thu Oct 09, 2008 4:45 pm
Contact:

[SOLVED] Teamwork to Move Objects

Post by shiftey »

I would love a feature that prohibits certain objects from being pickup able unless multiple players are activating it. For example: Player 1 wants to pick up an industrial refrigerator because he has a hunch it is covering the exit to the next section of the map, but it's too heavy for just one player to pickup. So he asks Player 2 for help. Player 1 and Player 2 both +Use the object and move in the same direction to get it out of the way and unveil the exit.

Very simple concept; I hope you understand what I mean. As far as I know there is no way to accomplish this in Hammer.
Last edited by shiftey on Fri Sep 18, 2009 1:24 am, edited 1 time in total.
Ny
Phone Donator
Phone Donator
Posts: 496
Joined: Sun Oct 05, 2008 3:22 pm
Contact:

Post by Ny »

Sounds like a good idea, a great mechanic for slowing player down to depend on others rather than rushing ahead
:nyoron:
DaMaN
npc_combinegunship
npc_combinegunship
Posts: 782
Joined: Tue Nov 07, 2006 12:03 am
Location: Parent's Basement
Contact:

Post by DaMaN »

Actually, you can do it in Hammer. A couple of ways.

First, you can get the same effect by having two buttons far enough that one player can't press both of them, but that's not really what you're looking for.

What I would do is this:
- Have two physics objects (say, two refrigerators)
- Overlap them in front of the new entrance and nocollide them (logic_collision_pair)
- OnPickUp of refrigerator1, add 1 to a math_counter (call it refrigerator_counter or somesuch)
- OnPickUp of refrigerator2, add 1 to refrigerator_counter
- OnDrop of refrigerator1, subtract 1 to refrigerator_counter
- OnDrop of refrigerator2, subtract 1 to refrigerator_counter
- OnDrop of refrigerator1, teleport back to original place (via a point_teleport)
- OnDrop of refrigerator2, teleport back to original place (via another point_teleport)
- OnHitMax of refrigerator_counter, Kill point_teleporters

Tada!

What happens is: when one refrigerator is picked up and dropped, it will be teleported back, so there's no way through. But when both refrigerators are picked up before dropping the other, neither teleport back, and there's now a way through. :D
Current projects: Return to City 17 and Rising Dead
Also, check out my Blag: http://daman-amappersworld.blogspot.com/
shiftey
npc_combinegunship
npc_combinegunship
Posts: 705
Joined: Thu Oct 09, 2008 4:45 pm
Contact:

Post by shiftey »

That is actually a useful plan for one of my problems, but the one I'm having right now is slightly more complicated than that.

I need a specific object of great weight to be moved from point a to point b. But its too heavy for 1 player to lift. Teleports are not useful for this because I want the object to stay where ever they drop it. If I create 2 physboxes (handles maybe) parented to a prop_dynamic, can each player pick up each physbox or will one of them drop it when the other picks it up? Picture a big box with two handles on each side (each handle being a physbox). If player one picks up one handle, will he drop it when player 2 picks up the other?
DaMaN
npc_combinegunship
npc_combinegunship
Posts: 782
Joined: Tue Nov 07, 2006 12:03 am
Location: Parent's Basement
Contact:

Post by DaMaN »

shiftey wrote:That is actually a useful plan for one of my problems, but the one I'm having right now is slightly more complicated than that.

I need a specific object of great weight to be moved from point a to point b. But its too heavy for 1 player to lift. Teleports are not useful for this because I want the object to stay where ever they drop it. If I create 2 physboxes (handles maybe) parented to a prop_dynamic, can each player pick up each physbox or will one of them drop it when the other picks it up? Picture a big box with two handles on each side (each handle being a physbox). If player one picks up one handle, will he drop it when player 2 picks up the other?
Actually, that could work! Make 2 physboxes as handles and 1 physbox as the big rock or w/e.

You'd have two "handles" with the same math_counter inputs, except this time when you get the OnHitMax input, you EnableMotion the big rock. OnPickup the handles adds to the counter, and OnDrop the handles subtracts from the counter, and OnDrop DisablesMotion the big rock. Put some phys_constraints (or even springs) from the handles to the big rock (so that you move the handles = you move the rock) and you've got yourself a pretty sweet puzzle!
Current projects: Return to City 17 and Rising Dead
Also, check out my Blag: http://daman-amappersworld.blogspot.com/
shiftey
npc_combinegunship
npc_combinegunship
Posts: 705
Joined: Thu Oct 09, 2008 4:45 pm
Contact:

Post by shiftey »

Thanks DaMaN. Your a life saver! I think this might work I'll try it out next time I load up hammer. Although I'll need help testing it.

Also: I was just playing oc_harvest and i found it really annoying how when you pick up the bucket of water and run with it, it kind of slows you down and lags into the player collision. Know of any ways to get around this? Maybe have OnPickup turns off collision, OnDrop turns it back on? I'm not sure if thats possible though...
Ny
Phone Donator
Phone Donator
Posts: 496
Joined: Sun Oct 05, 2008 3:22 pm
Contact:

Post by Ny »

I'm available for testing if anyone needs help - add chigerian to your friends list
:nyoron:
shiftey
npc_combinegunship
npc_combinegunship
Posts: 705
Joined: Thu Oct 09, 2008 4:45 pm
Contact:

Post by shiftey »

Sweet tits! I got it to work!

It was a bit of a pain in the ass, but I think I may have gotten it right. I still need to test with another player before anything is final. But everybody is busy tonight. The way its working right now: once two people grab it, it picks up. If one of them drops it, so does the other. I tried it with a prop_dynamic parented but it was screwy. I'm sure it could work but I don't need it to so frak it.
shiftey
npc_combinegunship
npc_combinegunship
Posts: 705
Joined: Thu Oct 09, 2008 4:45 pm
Contact:

Post by shiftey »

I tested it with w0f0x and it works. This thread can probably be moved to mapping help since it turns out its possible in hammer.
DaMaN
npc_combinegunship
npc_combinegunship
Posts: 782
Joined: Tue Nov 07, 2006 12:03 am
Location: Parent's Basement
Contact:

Post by DaMaN »

Sweet! My idea worked! :D
Current projects: Return to City 17 and Rising Dead
Also, check out my Blag: http://daman-amappersworld.blogspot.com/
Post Reply