Doom3world

The world is yours! Doom 3 - Quake 4 - ET:QW - Prey - Rage
It is currently Fri May 24, 2013 5:36 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 20 posts ] 
Author Message
 Post subject: Binding articulated figure to worldspawn and idMoveable
PostPosted: Wed Apr 11, 2012 4:20 am 
Offline
picked up 75 health

Joined: Thu Aug 19, 2004 3:50 am
Posts: 81
I'm trying to create a setup with an articulated figure rope. I'd like one end of the rope anchored to a wall, and the other end attached to an idMoveable (i.e. barrel, crate). Here's an illustration of what I'm attempting:

Image
(It can be seen as something like a ball & chain attached to a wall, or a sideways chandelier)


When I attach my rope to the idMoveable, it does attach successfully:
Code:
entity myMoveable = sys.getEntity( "myMoveable" );
myRope.setKey( "bindConstraint name1", "ballAndSocket bone16 bone16" );         
myRope.bind( myMoveable );
The problem is, the entire rope gets attached: when I move the idMoveable around, the end of the rope rips out of the wall and follows the idMoveable around. It seems objects can only have one "bind" associated with them.

(The most straight-forward implementation would be to convert the entire thing into a single articulated figure mesh. But, I'd like for the player to be able to attach & reattach things to the rope, so converting the entire thing into a single mesh unfortunately isn't an option.)

Anyone have a scripting solution to this, or should I start digging around the SDK?

_________________
Blendo Games


Top
 Profile E-mail  
 
 Post subject: Re: Binding articulated figure to worldspawn and idMoveable
PostPosted: Wed Apr 11, 2012 6:59 am 
Offline
Invisibility
User avatar

Joined: Fri Aug 13, 2004 4:39 pm
Posts: 3654
Location: Right there! Look!
This should help: viewtopic.php?t=3529&highlight=bindconstraint

_________________
Check out GRIMM Quest for the Gatherer's Key!
Grimm's Youtube Channel

Follow Grimm Quest on Twitter!


Top
 Profile E-mail  
 
 Post subject: Re: Binding articulated figure to worldspawn and idMoveable
PostPosted: Wed Apr 11, 2012 7:49 am 
Offline
picked up 75 health

Joined: Thu Aug 19, 2004 3:50 am
Posts: 81
Thanks for the tip! I'm using bindConstraint to attach a specific joint to my idMoveable. But, my problem is I can't figure out how to have an articulated figure be anchored to two separate things (the wall and the idMoveable).

Also, the accompanying "bind" call seems to be all-or-nothing - it slaves the entire entity to the master, not just a part of it. Unless I'm misunderstanding how bindConstraint works?


Top
 Profile E-mail  
 
 Post subject: Re: Binding articulated figure to worldspawn and idMoveable
PostPosted: Wed Apr 11, 2012 12:34 pm 
Offline
Very Senior Forum Poster
User avatar

Joined: Sun May 29, 2005 10:02 pm
Posts: 7082
Location: Here, not there.
Take a look at the hanging lights. They're AF's & can have a bulb bound to them but they stay where you put them.

You could also modify the previous idmovable and add the chain to it & the bones. Then just use that entity instead of two.

_________________
Fuzzy Logic Inc
PAINTBALL DOOM 3!!!!
Check out my Q2 server! q2server.fuzzylogicinc.com :D
Doom 3, Paintball! d3server.fuzzylogicinc.com


Top
 Profile E-mail  
 
 Post subject: Re: Binding articulated figure to worldspawn and idMoveable
PostPosted: Wed Apr 11, 2012 5:33 pm 
Offline
picked up 75 health

Joined: Thu Aug 19, 2004 3:50 am
Posts: 81
@The Happy Friar - it seems for Doom3's hanging lights, the bulb is the child & the light fixture chain is the parent.

In my particular case, I need that relationship flipped - the attached object (the bulb) to be the parent, and the chain to be the child (so that when the object moves, the chain follows suit). But the problem is when I slave the chain to the object, the chain no longer has any attachment to worldspawn.

Unfortunately, I can't merge the two objects into one mesh - for gameplay reasons, I'd like for the player to be able to attach and reattach idMoveables to the end of the chain.

_________________
Blendo Games


Top
 Profile E-mail  
 
 Post subject: Re: Binding articulated figure to worldspawn and idMoveable
PostPosted: Wed Apr 11, 2012 9:45 pm 
Offline
Very Senior Forum Poster
User avatar

Joined: Sun May 29, 2005 10:02 pm
Posts: 7082
Location: Here, not there.
But for the hanging lights (they don't include bulbs or a light) you bind the bulb object AND the light TO the hanging light. Not the hanging light TO the bulb/light, like you said. That's what you should to:

myMoveable.bind(myRope);

From the looks of it you're looking the info on "myMovable" (barrel) and wanting to attach it to the rope. Since you know the rope's name (it's placed via the editor, after all) you can do the same type of lookup just change what you bind to.

Unless there's something I'm missing.

_________________
Fuzzy Logic Inc
PAINTBALL DOOM 3!!!!
Check out my Q2 server! q2server.fuzzylogicinc.com :D
Doom 3, Paintball! d3server.fuzzylogicinc.com


Top
 Profile E-mail  
 
 Post subject: Re: Binding articulated figure to worldspawn and idMoveable
PostPosted: Wed Apr 11, 2012 11:30 pm 
Offline
picked up 75 health

Joined: Thu Aug 19, 2004 3:50 am
Posts: 81
@The Happy Friar - I made a short video of my test case-
http://youtu.be/m5H8LajiT6A

The four crates are set up in different ways:

BOX 1: Normal box, nothing bound to/from it.

BOX 2: bound via: myMoveable.bind(myRope);
When player pushes against the box, the box does not react in any way.

BOX 3: bound via: myMoveable.bindToJoint( myRope, "bone5", false );
No reaction from box, identical to box 2.

BOX 4: bound via:
myRope.setKey( "bindConstraint name1", "ballAndSocket bone4 bone4" );
myRope.bind(myMoveable);

The box does react when I push against it. However, it pushes the entire rope fixture away from its original spot.

My goal is to make a "chandelier"-type setup where I can push/interact with the box, but keep the rope fixture attached to both the ceiling & the box. Child objects seem to have limited physics, which is why I was attempting to flip the child/parent relationship.

_________________
Blendo Games


Top
 Profile E-mail  
 
 Post subject: Re: Binding articulated figure to worldspawn and idMoveable
PostPosted: Thu Apr 12, 2012 3:07 am 
Offline
Very Senior Forum Poster
User avatar

Joined: Sun May 29, 2005 10:02 pm
Posts: 7082
Location: Here, not there.
I get a message saying the video is private.

_________________
Fuzzy Logic Inc
PAINTBALL DOOM 3!!!!
Check out my Q2 server! q2server.fuzzylogicinc.com :D
Doom 3, Paintball! d3server.fuzzylogicinc.com


Top
 Profile E-mail  
 
 Post subject: Re: Binding articulated figure to worldspawn and idMoveable
PostPosted: Thu Apr 12, 2012 3:59 am 
Offline
picked up 75 health

Joined: Thu Aug 19, 2004 3:50 am
Posts: 81
Whoops! Video should be viewable now.


Top
 Profile E-mail  
 
 Post subject: Re: Binding articulated figure to worldspawn and idMoveable
PostPosted: Thu Apr 12, 2012 5:10 am 
Offline
Very Senior Forum Poster
User avatar

Joined: Sun May 29, 2005 10:02 pm
Posts: 7082
Location: Here, not there.
Ok, I see what it is doing: just like how the box wouldn't move when you pushed it when it was bound to the light but it did move when you moved the light, in the last case the box is moving the light but I bet if you moved the light it wouldn't move.

Ok, I got this to work... in the editor:

I took an env_hellchain & a movable_cartonbox1. In the editor I placed the box at the bottom of the chain. for the box I did this:
bind env_hellchain_1
bindtojoint joint8

This bound it to the chain and specifically to the joint8 bone. It worked as expected.

Doesn't help for "on the fly" binding though, this is what I did in the script:
$moveable_cartonbox1_1.bindToJoint($env_hellchain_1, "joint8", 1);

That worked perfectly.

I'm betting your issue is the lack of "$" in front of your entity names.

_________________
Fuzzy Logic Inc
PAINTBALL DOOM 3!!!!
Check out my Q2 server! q2server.fuzzylogicinc.com :D
Doom 3, Paintball! d3server.fuzzylogicinc.com


Top
 Profile E-mail  
 
 Post subject: Re: Binding articulated figure to worldspawn and idMoveable
PostPosted: Thu Apr 12, 2012 7:03 am 
Offline
picked up 75 health

Joined: Mon Feb 07, 2011 4:19 am
Posts: 81
@The Happy Friar
That won't solve the problem. If you shoot to the box, the chain won't move. I guess this is what blender81 is talking about, you cannot move the parent by moving its child.
Also, I've took a look to the SDK and it seems that you cannot bind an entity to two other entities simultaneously, this would mean that if you bind a child entity to its master, you lose any previous bind of the child. This is the reason why the chain ( or rope or whatever else ) detaches from its original anchor point in the 4th binding of the video.

I guess you cannot do anything without some work on the SDK, but I'd like to take a look if we can do something with some tricks.

Regards


Top
 Profile E-mail  
 
 Post subject: Re: Binding articulated figure to worldspawn and idMoveable
PostPosted: Thu Apr 12, 2012 8:31 am 
Offline
picked up 75 health

Joined: Thu Aug 19, 2004 3:50 am
Posts: 81
I copied your setup, and I still seem to be having the same issue - in your test map, does the box react when you walk against it? If so, can you upload your .map and .script file? When my box is slaved to the chain, my box has no reaction when I bump up against it.

Here's a video of what I'm seeing:
http://youtu.be/TXogWChteok

I get the impression that child objects are treated like second-class citizens. In the video, my slaved box constantly sinks into geometry, but its parent chain never penetrates any world brushes.

The parented box/slaved chain likewise seem to show the same behavior - the parented box never penetrates world geometry, but the slave chain constantly does.

(I also double-checked my script - it does have the $ marks; I neglected to include them in my previous post)

@doomtrinity - punching/shooting the box actually does make the chain react, though only in certain cases (such as a hanging chandelier setup). It starts to act very squirrelly in other situations, such as a ball-and-chain attached to a wall.

I've also been poking through the SDK. The BindConstraint tags are able to constrain an object at multiple joints, but as you said, the problem is that they'll all be slaved to one singular master.

_________________
Blendo Games


Top
 Profile E-mail  
 
 Post subject: Re: Binding articulated figure to worldspawn and idMoveable
PostPosted: Thu Apr 12, 2012 12:31 pm 
Offline
Very Senior Forum Poster
User avatar

Joined: Sun May 29, 2005 10:02 pm
Posts: 7082
Location: Here, not there.
If the box isn't moving when shot it's because it's not activated for physics yet. It may need to be touched.

I'll upload my map/script after work. Before you didn't mention you didn't want to child to not penetrate geometry.

I'm also pretty sure you can have a chain of bind setup, I've done it before but I don't remember what the point was or how it reacted.

_________________
Fuzzy Logic Inc
PAINTBALL DOOM 3!!!!
Check out my Q2 server! q2server.fuzzylogicinc.com :D
Doom 3, Paintball! d3server.fuzzylogicinc.com


Top
 Profile E-mail  
 
 Post subject: Re: Binding articulated figure to worldspawn and idMoveable
PostPosted: Thu Apr 12, 2012 8:12 pm 
Offline
Very Senior Forum Poster
User avatar

Joined: Sun May 29, 2005 10:02 pm
Posts: 7082
Location: Here, not there.
Here's my test map. Things to remember:
*AF's only work on objects with bones, the boxes don't have bones.
*The physics is expected to work in a "real" situation, not a "fake" one with the use of "G_dragentity" to pull/push things unrealistically.
*Physics is disabled until the objected is activated via touching.

Attachment:
File comment: Example map & script
lensgrid.zip [3.62 KB]
Downloaded 29 times

_________________
Fuzzy Logic Inc
PAINTBALL DOOM 3!!!!
Check out my Q2 server! q2server.fuzzylogicinc.com :D
Doom 3, Paintball! d3server.fuzzylogicinc.com


Top
 Profile E-mail  
 
 Post subject: Re: Binding articulated figure to worldspawn and idMoveable
PostPosted: Thu Apr 12, 2012 9:05 pm 
Offline
picked up 75 health

Joined: Thu Aug 19, 2004 3:50 am
Posts: 81
@The Happy Friar - thanks for the test map!

The boxes do react to punching, but do not react to other physics impulses (walking into them, shooting them). Does your build show something different?

Here's a video of what I'm seeing:
http://youtu.be/UZ98ggkUXUA


Top
 Profile E-mail  
 
 Post subject: Re: Binding articulated figure to worldspawn and idMoveable
PostPosted: Thu Apr 12, 2012 9:14 pm 
Offline
Very Senior Forum Poster
User avatar

Joined: Sun May 29, 2005 10:02 pm
Posts: 7082
Location: Here, not there.
Yes, mine react when I walk in to them. I'm using the latest D3 patch, I don't have the Steam one. Even if they don't react at first, after you hit them they should react to walking in to them.

_________________
Fuzzy Logic Inc
PAINTBALL DOOM 3!!!!
Check out my Q2 server! q2server.fuzzylogicinc.com :D
Doom 3, Paintball! d3server.fuzzylogicinc.com


Top
 Profile E-mail  
 
 Post subject: Re: Binding articulated figure to worldspawn and idMoveable
PostPosted: Thu Apr 12, 2012 9:46 pm 
Offline
picked up 75 health

Joined: Thu Aug 19, 2004 3:50 am
Posts: 81
That's so strange - perhaps it's a difference with the builds? My console reads 1.3.1.1304

I've tried it with default Doom3 & RoE on Steam, and my own compiled executable, and they all display the same behavior. I'll have to dig in and see what's causing this difference.


Top
 Profile E-mail  
 
 Post subject: Re: Binding articulated figure to worldspawn and idMoveable
PostPosted: Thu Apr 12, 2012 11:32 pm 
Offline
Very Senior Forum Poster
User avatar

Joined: Sun May 29, 2005 10:02 pm
Posts: 7082
Location: Here, not there.
Maybe I have a custom def for something in my edit folder.

If I did then it might work for me because it uses the entity's mass to determine how it moves. Since punching has more force it moves more mass. Rockets to do. The pistol doesn't. Etc.

_________________
Fuzzy Logic Inc
PAINTBALL DOOM 3!!!!
Check out my Q2 server! q2server.fuzzylogicinc.com :D
Doom 3, Paintball! d3server.fuzzylogicinc.com


Top
 Profile E-mail  
 
 Post subject: Re: Binding articulated figure to worldspawn and idMoveable
PostPosted: Sat Apr 14, 2012 11:27 pm 
Offline
is sad because his cool title went away
User avatar

Joined: Tue Sep 07, 2004 6:23 pm
Posts: 711
Location: Bracknell UK
Quote:
(The most straight-forward implementation would be to convert the entire thing into a single articulated figure mesh. But, I'd like for the player to be able to attach & reattach things to the rope, so converting the entire thing into a single mesh unfortunately isn't an option.)


Do you have a limited number of entities you would like atttached to the rope? maybe could make it into one entity with all models incorporated at the end and hide/show them with skins?

Could maybe also fake it through scripting, attach the moveable to the end (or model of, hiding original moveable), place a clip model same bounds at end to stop the child falling through the geometry (as childs seem to do) and fake the moveable part while its attached using a forcefield again same bounds as model plus a couple of units.

Just a couple of quick ideas for a fix.


Top
 Profile  
 
 Post subject: Re: Binding articulated figure to worldspawn and idMoveable
PostPosted: Sun Apr 15, 2012 7:13 am 
Offline
picked up 75 health

Joined: Thu Aug 19, 2004 3:50 am
Posts: 81
S@TaNiC - those are great suggestions! For now I've decided to scale back my design and freeze all the objects once the rope+moveable are connected. It's not ideal, but I don't want to get roadblocked on this one feature for too long.

When I do find more time, I'd like to give your clip model idea a try, I think it could possibly work.


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group