Object Manipulation

Object Manipulation

Re: Object Manipulation Posted by Yesurbius on Fri Dec 31st 2004 at 3:07am
Yesurbius
48 posts
Posted 2004-12-31 3:07am
48 posts 5 snarkmarks Registered: Dec 31st 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.
Re: Object Manipulation Posted by Nickelplate on Fri Dec 31st 2004 at 3:16am
Nickelplate
2770 posts
Posted 2004-12-31 3:16am
2770 posts 346 snarkmarks Registered: Nov 23rd 2004 Occupation: Prince of Pleasure Location: US
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!
Re: Object Manipulation Posted by Zeon on Fri Dec 31st 2004 at 5:05am
Zeon
37 posts
Posted 2004-12-31 5:05am
Zeon
member
37 posts 14 snarkmarks Registered: Dec 22nd 2004 Location: USA
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 :wink: .

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.
Re: Object Manipulation Posted by Yesurbius on Fri Dec 31st 2004 at 5:46am
Yesurbius
48 posts
Posted 2004-12-31 5:46am
48 posts 5 snarkmarks Registered: Dec 31st 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 :wink: .
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.
Re: Object Manipulation Posted by Yesurbius on Fri Dec 31st 2004 at 9:49pm
Yesurbius
48 posts
Posted 2004-12-31 9:49pm
48 posts 5 snarkmarks Registered: Dec 31st 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!
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-->Code:<TABLE width="95%" align=center><TR><TD>

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"

}

}

</TD></TR></TABLE><!--/code-->
Re: Object Manipulation Posted by Yesurbius on Fri Dec 31st 2004 at 9:51pm
Yesurbius
48 posts
Posted 2004-12-31 9:51pm
48 posts 5 snarkmarks Registered: Dec 31st 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.
Re: Object Manipulation Posted by Zeon on Fri Dec 31st 2004 at 10:03pm
Zeon
37 posts
Posted 2004-12-31 10:03pm
Zeon
member
37 posts 14 snarkmarks Registered: Dec 22nd 2004 Location: USA
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.
Re: Object Manipulation Posted by Yesurbius on Sun Jan 2nd 2005 at 4:37am
Yesurbius
48 posts
Posted 2005-01-02 4:37am
48 posts 5 snarkmarks Registered: Dec 31st 2004
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.