Jump to content
The Dark Mod Forums

Attach entities to tdm ropes how?


AluminumHaste

Recommended Posts

I created a chandelier out of brushes and torch models and used moveable torch flame entities and bound them to each other.

 

I also created a rope entity in the editor (150 units long). Now I was wondering if I could attach the chandelier to the end of the rope so that it could swing on the rope. Is this currently not possible? I tried binding the entity to the rope but that didn't work (used keyword "bind").

Any help is appreciated.

 

 

 

PS also I would like to apologize to everyone else who posted in this forum and has had their threads chased off the first page because I've posted so many new threads. :blush:

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

No worries. Anyway, this is how to make a swinging rope and bind to it. I just made this to make sure and it swings fine...

 

Don't use one of the rope entities, Instead

 

. make a patch cylinder about 1.5 by 1.5 and as long as you want.

. Give it the rope texture. Not sure what's available to you at the moment but improvise for now.

. Assign it the entity func_pendulum. Not sure where it might be in your list but you can just type it in.

. Give it a name, eg, swingrope.

. Press V for vertex mode and move its origin up to the top of the rope. That will be its point of rotation.

. Assign a property/value speed 3 (change this later but its the degrees either side of the swing. The speed depends on this angle.

. Create a model chandelier just below it, lined up where you want.

. To the model add the property/value bind swingrope.

Link to comment
Share on other sites

No worries. Anyway, this is how to make a swinging rope and bind to it. I just made this to make sure and it swings fine...

 

Don't use one of the rope entities, Instead

 

. make a patch cylinder about 1.5 by 1.5 and as long as you want.

. Give it the rope texture. Not sure what's available to you at the moment but improvise for now.

. Assign it the entity func_pendulum. Not sure where it might be in your list but you can just type it in.

. Give it a name, eg, swingrope.

. Press V for vertex mode and move its origin up to the top of the rope. That will be its point of rotation.

. Assign a property/value speed 3 (change this later but its the degrees either side of the swing. The speed depends on this angle.

. Create a model chandelier just below it, lined up where you want.

. To the model add the property/value bind swingrope.

 

That just sounds like it will just swing back and forth, I want it to hang there like normal but swing on a rope/chain when someone hits it with stuff or jumps on it etc.

I remember in Doom 3 in the bathroom if you shot the lights hanging from the ceiling, then it would swing on the rope.

Is this what you are talking about?

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

No more time to look at this tonight but this might be of interest. I've not seen it myself yet so no idea if it's of any use in this situation....

 

http://www.doom3world.org/phpbb2/viewtopic.php?t=5793

 

Damn that link doesn't work anymore.

EDIT: Okay found another link, they are using an entity that is just that, a lightfixture attached to a bone joint for the physics engine to compute.

Hey your darkmod ropes have bones right? In the video he uses the keyword "bindtoJoint" does darkmod still have that functionality? Can I just attach the lamp entity to one of the bones of the rope?

Edited by AluminumHaste

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Yeah, maybe try one of the joints but need to look to find what the joint names are for ropes, maybe bone1, etc? Meanwhile...

 

I have got something working using a moveable entity. I used a moveable crate bound to a rope entity. But its offset from the rope was odd. I thought it had disappeared but noticed its shadow on extreme swings. So I moved the crate about halfway up the rope and about a half rope's length to one side and then it appeared in game roughly at the bottom of the rope. At game start they writhe about together. If I fire a rope arrow they also move in sync. Needs some more experimenting though. Can't see a lot of interaction if I bump or jump on the rope. Other AI seem to interact better with the rope arrows I've noticed, I mean insofar as moving them, setting them swinging. I'll have another look later and see if I can make a moveable chandelier. Not sure it's ever going to be pretty though.

Link to comment
Share on other sites

Further thoughts. I think the rope physics are designed for a free rope so writhe and sway quite a bit. I wonder if a better approach for what you want is a switchable pendulum using s & r? The player jumps onto the chandelier and it starts to sway. He moves away and it stops. Ideally after a delay. The first part should be simple. I can look at that if you want. And switching it off when moving away is simple. But ideally it wants a delay, in fact to gradually slow. Also of course the pendulum only goes in the one set plane. Still...

Link to comment
Share on other sites

Got this reasonably good now. It swings well at game start and does interact a little when you jump to the rope though I think the crate has no collision at the moment. Needs more work but clearly possible.

post-400-1207223242_thumb.jpg

 

Okay I noticed that for all the ropes I made all the lengths all have their last 2 bones named: Bone_91 and Bone_92 regardless of how many bones there are.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

I found it went a bit crazy when I tried the end bone. I think I used bone8. Note also you need to turn the crate at an angle about 45 degrees as well as offset it to the side. No doubt we'll figure out exactly what offset and angle. Not sure why the crate loses its solidity though. I can jump on the rope and it sways a little with the crate but the crate has no substance. I'll go back and try a func static.

Link to comment
Share on other sites

Got this great now! I can actually mantle onto the chandelier from the floor (I got it low while testing) then climb on the rope or just jump for the rope. Only thing is the end of the rope is a bit curly so sometimes not quite in line. Also I found while adjusting if the rope actually touches he chandelier it can make it go a bit squiffy. But just having a hairline gap it seems reasonable.

 

By trial and error I'm close to the offset. I'll post them and see if I can figure out why.

Link to comment
Share on other sites

OK, I'm using models/darkmod/lights/extinguishable/chandelier1.lwo which is that not available to you? Are you using a brush/patch chandelier? Should still work if you make it a func_static but these numbers probably won't help much.

 

Rotation property 1 0 0 0 0.601816 -0.798637 0 0.798637 0.601816 this tilts it on one side. It was about 45 degrees but not quite but I can't remember more or less.

Offset to minus Y = 152. The rope length is 154 so this presumably is relevant.

Offset height from ground add 113.

 

Seems to me one placing the chandelier at the position and angle it would be at the max swing in that direction. Oh, yes s'obvious now when I look at game start the rope starts at that angle.

 

post-400-1207228315_thumb.jpg

Link to comment
Share on other sites

OK, I'm using models/darkmod/lights/extinguishable/chandelier1.lwo which is that not available to you? Are you using a brush/patch chandelier? Should still work if you make it a func_static but these numbers probably won't help much.

 

Rotation property 1 0 0 0 0.601816 -0.798637 0 0.798637 0.601816 this tilts it on one side. It was about 45 degrees but not quite but I can't remember more or less.

Offset to minus Y = 152. The rope length is 154 so this presumably is relevant.

Offset height from ground add 113.

 

Seems to me one placing the chandelier at the position and angle it would be at the max swing in that direction. Oh, yes s'obvious now when I look at game start the rope starts at that angle.

 

post-400-1207228315_thumb.jpg

 

Okay I got around the part about having to offset by using the longest rope (400) and rotating it so it's straight up and down (more or less), and attached a block of wood to the bottom joint, then attached a hanging lantern to the block of wood, then attached a light to the lantern. When I went in game it all worked without having that crazy offset and the rope going all nuts.

One thing though, the block of wood isn't actually attached physically to the end of the rope, it's almost touching it.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

The problem with the rope going crazy is probably due to clipping. The lowest rope body will clip into the chandelier's clipmodel (regardless of its visual representation - also a patch cylinder won't help) and you'll get the same effect as when the rope is clipping into a moveable crate, for instance.

 

One could try to set the rope to nonsolid (I think you'll need a separate AF for that, but I'm not sure), but this would probably prevent the rope from being climbable. Ishtvan is our AF expert, so he'll know more about it.

Link to comment
Share on other sites

You won't believe this but I've now combined this with a pendulum so it permanently has a slight swing. I placed the patch cylinder rope func_pendulum I described earlier just above the entity rope. I then bound the entity rope to the pendulum rope. It starts of with big swings as normal but then settles down to the pendulum swing. This is so cool. I need to move the pendulum rope origin for best effect. It seems to be setting the entity rope swinging slightly separately so it looks like one giant rope slightly oscillating, like an extra big bone.

 

So you could probably bind your rope to an overhead rope/block with a sliding door function. The player frobs it and hauls in the chandelier for cleaning etc. Then climb on it and frob again to move it out. Then jumps to the next chandelier etc. Tarzan eat your heart out. All kinds of possibilities with ropes.

Link to comment
Share on other sites

@greebo: I think I'd prefer to have a tiny nonsolid link between solid rope and solid chandelier to cover the gap.

You can try this yourself, by opening af\env_rope.af and edit the bodies "bone9" or "bone91" (these around lines 110, I think).

 

Add this to the body (within the curly braces, after "density"):

clipMask none

 

Does this work?

Link to comment
Share on other sites

No, doesn't seem to help when I put it on the last one in the af, bone91. I notice there is no bone92 in there although it shows in-game as the last bone. So I tried adding that to the af but got an error so assume that is intentional. Maybe I should upload my test map greebo for you to have a look at?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 1 reply
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...