Object Manipulation
Post Reply
Quote
Re: Object Manipulation
Posted by Yesurbius on Fri Dec 31st at 3:07am 2004


In one of the maps with the car, you come to a road station, and need to find 3 car batteries, and put them on the shelf, to create enough power to open the gate.

I think the system behind it is the same as in Dr. Kleiner's lab, where you have to plug in the power connector.

II am curious how this is done. I imagine it would be a two step process, one to define that the two objects are able to come together, and finally an output once they do come together.

If someone could let me know how to accomplish this, or point me to an example - it'd be appreciated.





Quote
Re: Object Manipulation
Posted by Nickelplate on Fri Dec 31st at 3:16am 2004


You make a rope with the carr-battery model at the end (make the battery's parent be the keyframe_rope and the Keyframe_rope's parent the move_rope) then in the rop properties make it be detached at start (set "start dangling" tag to YES). that way the battery will snap into place when you drop it close enough. Then make the rope width be 0. and there you have it. This is the same principle as the plug that you have to plug in in klieners lab, you were right only with that, the model at the end was different and the rope was visible! [addsig]



Quote
Re: Object Manipulation
Posted by Zeon on Fri Dec 31st at 5:05am 2004


Lemme tell ya...that plug system in Kleiner's lab is a real beast. You can find a working version of it in dm_lockdown...which is where I grabbed it and started learning how to use logic_relays. If you've never worked with a whole system (more than 2) of entities working together, that's a good place to start .

I think Nickelplate has a very good option for getting what you need done. Another way that I can see to do it would be to involve logic_compare's and filter activations. Not pretty. Try Nickelplate's first, lol.





Quote
Re: Object Manipulation
Posted by Yesurbius on Fri Dec 31st at 5:46am 2004


? quote:
Lemme tell ya...that plug system in Kleiner's lab is a real beast. You can find a working version of it in dm_lockdown...which is where I grabbed it and started learning how to use logic_relays. If you've never worked with a whole system (more than 2) of entities working together, that's a good place to start .



I have yet to get into logic stuff yet - I got the basic idea of how it works tho, I had looked at how they work on a 4-floor elevator map.

Regarding rope - will have to try that.




Quote
Re: Object Manipulation
Posted by Yesurbius on Fri Dec 31st at 9:49pm 2004


? quote:
You make a rope with the carr-battery model at the end (make the battery's parent be the keyframe_rope and the Keyframe_rope's parent the move_rope) then in the rop properties make it be detached at start (set "start dangling" tag to YES). that way the battery will snap into place when you drop it close enough. Then make the rope width be 0. and there you have it. This is the same principle as the plug that you have to plug in in klieners lab, you were right only with that, the model at the end was different and the rope was visible!


Been at this all morning without any luck. a) It does not "connect" .. or snap into place. b) if I make a plug, the cord is super stretchy .. can walk with it throughout the level even LOL

I created a prefab with all the objects I am using to get this going ... here is the .vmf file (from sourcesdk/bin/prefabs)

Code:

versioninfo
{
"editorversion" "400"
"editorbuild" "2978"
"mapversion" "74"
"formatversion" "100"
"prefab" "1"
}
world
{
"id" "19427"
"mapversion" "74"
"classname" "worldspawn"
"skyname" "sky_wasteland02"
"maxpropscreenwidth" "-1"
solid
{
"id" "19443"
side
{
"id" "1098"
"plane" "(260 742.441 124) (268 742.441 124) (268 741.441 124)"
"material" "DEV/DEV_MEASUREGENERIC01"
"uaxis" "[1 0 0 -64] 0.0625"
"vaxis" "[0 -1 0 -71.5078] 0.0078125"
"rotation" "0"
"lightmapscale" "32"
"smoothing_groups" "0"
}
side
{
"id" "1099"
"plane" "(260 741.441 116) (268 741.441 116) (268 742.441 116)"
"material" "DEV/DEV_MEASUREGENERIC01"
"uaxis" "[1 0 0 -64] 0.0625"
"vaxis" "[0 -1 0 -71.5078] 0.0078125"
"rotation" "0"
"lightmapscale" "32"
"smoothing_groups" "0"
}
side
{
"id" "1100"
"plane" "(260 742.441 124) (260 741.441 124) (260 741.441 116)"
"material" "DEV/DEV_MEASUREGENERIC01"
"uaxis" "[0 1 0 71.5078] 0.0078125"
"vaxis" "[0 0 -1 64] 0.0625"
"rotation" "0"
"lightmapscale" "32"
"smoothing_groups" "0"
}
side
{
"id" "1101"
"plane" "(268 742.441 116) (268 741.441 116) (268 741.441 124)"
"material" "DEV/DEV_MEASUREGENERIC01"
"uaxis" "[0 1 0 71.5078] 0.0078125"
"vaxis" "[0 0 -1 64] 0.0625"
"rotation" "0"
"lightmapscale" "32"
"smoothing_groups" "0"
}
side
{
"id" "1102"
"plane" "(268 742.441 124) (260 742.441 124) (260 742.441 116)"
"material" "DEV/DEV_MEASUREGENERIC01"
"uaxis" "[1 0 0 -64] 0.0625"
"vaxis" "[0 0 -1 64] 0.0625"
"rotation" "0"
"lightmapscale" "32"
"smoothing_groups" "0"
}
side
{
"id" "1103"
"plane" "(268 741.441 116) (260 741.441 116) (260 741.441 124)"
"material" "DEV/DEV_MEASUREGENERIC01"
"uaxis" "[1 0 0 -64] 0.0625"
"vaxis" "[0 0 -1 64] 0.0625"
"rotation" "0"
"lightmapscale" "32"
"smoothing_groups" "0"
}
editor
{
"color" "0 121 130"
"visgroupshown" "1"
}
}
}
entity
{
"id" "19428"
"classname" "light"
"_light" "128 255 0 10"
"style" "0"
"_constant_attn" "0"
"_linear_attn" "0"
"_quadratic_attn" "1"
"_distance" "0"
"targetname" "battery_light"
"spawnflags" "1"
"origin" "264 740.441 127.051"
editor
{
"color" "220 30 220"
"visgroupid" "2"
"visgroupshown" "1"
}
}
entity
{
"id" "19431"
"classname" "move_rope"
"targetname" "cord_socket"
"MoveSpeed" "64"
"Slack" "0"
"Type" "0"
"Subdiv" "2"
"Barbed" "0"
"Width" "0"
"TextureScale" "1"
"Collide" "0"
"Dangling" "1"
"Breakable" "0"
"RopeMaterial" "cable/cable.vmt"
"PositionInterpolator" "2"
"NextKey" "cord_plug"
"origin" "264 734.441 120"
editor
{
"color" "220 30 220"
"visgroupid" "2"
"visgroupshown" "1"
}
}
entity
{
"id" "19434"
"classname" "keyframe_rope"
"MoveSpeed" "64"
"Slack" "50"
"Type" "1"
"Subdiv" "8"
"Barbed" "0"
"Width" "4"
"TextureScale" "1"
"Collide" "0"
"Dangling" "0"
"Breakable" "0"
"RopeMaterial" "cable/cable.vmt"
"targetname" "cord_plug"
"parentname" "plug"
"NextKey" "cord_onObj"
"angles" "0 0 0"
"origin" "264 717.441 120"
editor
{
"color" "220 30 220"
"visgroupid" "2"
"visgroupshown" "1"
}
}
entity
{
"id" "19437"
"classname" "keyframe_rope"
"angles" "0 0 0"
"targetname" "cord_onObj"
"MoveSpeed" "64"
"Slack" "25"
"Type" "0"
"Subdiv" "8"
"Barbed" "0"
"Width" "4"
"TextureScale" "1"
"Collide" "0"
"Dangling" "0"
"Breakable" "0"
"RopeMaterial" "cable/cable.vmt"
"origin" "248 723.441 100.406"
editor
{
"color" "220 30 220"
"visgroupid" "2"
"visgroupshown" "1"
}
}
entity
{
"id" "19440"
"classname" "func_physbox"
"spawnflags" "524288"
"gibdir" "0 0 0"
"renderamt" "255"
"rendercolor" "255 255 255"
"preferredcarryangles" "0 0 0"
"origin" "264 717.44 120"
"targetname" "plug"
solid
{
"id" "19441"
side
{
"id" "1104"
"plane" "(261 720.441 123) (267 720.441 123) (267 714.441 123)"
"material" "DEV/DEV_MEASUREGENERIC01B"
"uaxis" "[1 0 0 -64] 0.046875"
"vaxis" "[0 -1 0 -118.585] 0.046875"
"rotation" "0"
"lightmapscale" "32"
"smoothing_groups" "0"
}
side
{
"id" "1105"
"plane" "(261 714.441 117) (267 714.441 117) (267 720.441 117)"
"material" "DEV/DEV_MEASUREGENERIC01B"
"uaxis" "[1 0 0 -64] 0.046875"
"vaxis" "[0 -1 0 -118.585] 0.046875"
"rotation" "0"
"lightmapscale" "32"
"smoothing_groups" "0"
}
side
{
"id" "1106"
"plane" "(261 720.441 123) (261 714.441 123) (261 714.441 117)"
"material" "DEV/DEV_MEASUREGENERIC01B"
"uaxis" "[0 1 0 118.585] 0.046875"
"vaxis" "[0 0 -1 64] 0.046875"
"rotation" "0"
"lightmapscale" "32"
"smoothing_groups" "0"
}
side
{
"id" "1107"
"plane" "(267 720.441 117) (267 714.441 117) (267 714.441 123)"
"material" "DEV/DEV_MEASUREGENERIC01B"
"uaxis" "[0 1 0 118.585] 0.046875"
"vaxis" "[0 0 -1 64] 0.046875"
"rotation" "0"
"lightmapscale" "32"
"smoothing_groups" "0"
}
side
{
"id" "1108"
"plane" "(267 720.441 123) (261 720.441 123) (261 720.441 117)"
"material" "DEV/DEV_MEASUREGENERIC01B"
"uaxis" "[1 0 0 -64] 0.046875"
"vaxis" "[0 0 -1 64] 0.046875"
"rotation" "0"
"lightmapscale" "32"
"smoothing_groups" "0"
}
side
{
"id" "1109"
"plane" "(267 714.441 117) (261 714.441 117) (261 714.441 123)"
"material" "DEV/DEV_MEASUREGENERIC01B"
"uaxis" "[1 0 0 -64] 0.046875"
"vaxis" "[0 0 -1 64] 0.046875"
"rotation" "0"
"lightmapscale" "32"
"smoothing_groups" "0"
}
editor
{
"color" "220 30 220"
"visgroupshown" "1"
}
}
editor
{
"color" "255 255 255"
"visgroupshown" "1"
}
editor
{
"color" "220 30 220"
"visgroupid" "6"
"visgroupshown" "1"
}
}





Quote
Re: Object Manipulation
Posted by Yesurbius on Fri Dec 31st at 9:51pm 2004


Sorry for the long code dump - was trying to put it within a window - not sure on the markup element to do that ... tried 'code' and obviously it did not work.




Quote
Re: Object Manipulation
Posted by Zeon on Fri Dec 31st at 10:03pm 2004


From how you describe it, it almost sounds like you need an input filter. I don't really know how to tell you how to use one (which would be why I don't write tutorials, lol), but I'll just refer you again to the kleiner plug system that you can find in dm_lockdown. Basically I would just copy all of the components (there is a logic_relay that's kind of off by its self..don't forget that one), paste them into a simple box map, and dissect it. It should show you what you might be missing...ie how to make the battery "connect".

Also, the problem you have with the cord being super stretchy sounds like you need a phys_lengthconstraint on the cord.





Quote
Re: Object Manipulation
Posted by Yesurbius on Sun Jan 2nd at 4:37am 2005


Zeon, you were right. I have been working for past few days on ripping apart the dm_lockdown plug system and rebuilding it. I wrote a tutorial as well which I am going to post in a new thread shortly titled "Tutorial: Power Plugs" / Using trigger_teleport to 'snap' physic brushes into place.

As for this thread, I had accidently clicked on 'correct' answer .. I am sorry.





Post Reply