Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Attaching entities
DRedshot Offline
Senior Member

Posts: 374
Threads: 23
Joined: Jun 2011
Reputation: 11
#1
Attaching entities

I'd like to attach two entities together, so they behave as one entity. I cannot use a sticky area, because the entities will be moving up and down a rope

I have tried AddAttachedPropToProp, but due to it's nature it looks horrible. The attached prop falls through the floor, and it makes the whole thing look messy.

Is there another way to do this without making the second entity lose it's physics properties?

Thanks!

Edit: Solved! I just attached the entities by modifying the bodies so they interlocked Big Grin
For now it works fine, and doesn't seem as buggy as I first thought. Tested a good 10-20 times, and still no bodies have glitched through each other so i'd say it works Smile

(This post was last modified: 04-14-2012, 09:49 PM by DRedshot.)
04-14-2012, 03:15 AM
Find
Putmalk Offline
Senior Member

Posts: 290
Threads: 13
Joined: Apr 2012
Reputation: 15
#2
RE: Attaching entities

Are we talking about attaching like a bucket to a rope? Then yes, you have to use AddAttachedPropToProp, like I do here:



at around 2:10.

04-14-2012, 03:40 AM
Find
DRedshot Offline
Senior Member

Posts: 374
Threads: 23
Joined: Jun 2011
Reputation: 11
#3
RE: Attaching entities

Ugh, I was really hoping I could have done it another way. It doesn't look so bad on yours, because buckets are light, and it's in mid-air when you attach it too.
The problem is, the thing I am attaching is a heavy weight (like in the control room-cistern map) It looks so unnatural when it swings along with the other entity.
I'll explain in a bit more detail below. (slight Spoilers!)
Spoiler below!

I have a rope, at the end of the rope is a hook. This hook is attached to a heavy weight, and the hook with heavy weight is used as a counterweight/pulley mechanism.

The hook is attached to the rope as a end body, so it has physics. However, when I want to attach the weight to the hook, it loses physics properties, clips through the floor, and loses all of it's mass...

The scripting all works, it's just not very good to look at :/

Thanks for the reply anyways Smile

(This post was last modified: 04-14-2012, 12:34 PM by DRedshot.)
04-14-2012, 03:48 AM
Find
Putmalk Offline
Senior Member

Posts: 290
Threads: 13
Joined: Apr 2012
Reputation: 15
#4
RE: Attaching entities

The rope area should have an EndBody of an invisible_box_mass, then attach the prop to the invisible box. It should use the box's physics, not the prop's. It will be as light as the bucket.

04-14-2012, 03:55 AM
Find
DRedshot Offline
Senior Member

Posts: 374
Threads: 23
Joined: Jun 2011
Reputation: 11
#5
RE: Attaching entities

Ahhh, I see what you mean.
The invisible box's size would have to be adjusted each time an object is added though, otherwise either
A - Clipping would occur when the weight is added.
B - There would be an invisible mass surrounding some distance from the hook before the weight is added.

Also, the invisible box behaves strangely :/
It spins freely in all directions when it's on the end of the rope.

(This post was last modified: 04-14-2012, 04:14 AM by DRedshot.)
04-14-2012, 04:11 AM
Find
Putmalk Offline
Senior Member

Posts: 290
Threads: 13
Joined: Apr 2012
Reputation: 15
#6
RE: Attaching entities

Are you sure you didn't set it up right? My invisible box does not behave strangely at all, it follows Newton's laws: it's stationary when I don't touch it. Smile

And I don't know if it's possible to resize objects via script...you might be able to attach different items to it or just ignore the clipping.

04-14-2012, 04:14 AM
Find
DRedshot Offline
Senior Member

Posts: 374
Threads: 23
Joined: Jun 2011
Reputation: 11
#7
RE: Attaching entities

(04-14-2012, 04:14 AM)Putmalk Wrote: Are you sure you didn't set it up right? My invisible box does not behave strangely at all, it follows Newton's laws: it's stationary when I don't touch it. Smile

And I don't know if it's possible to resize objects via script...you might be able to attach different items to it or just ignore the clipping.
It's fine if I don't touch it, or leave it alone for a good 30 seconds, but interacting with the box makes it slowly revolve for ages, often making the attached props invert (which looks a bit wierd Tongue). Unfortunately, interacting with the rope is an important part of the puzzle.
It might be possible to work-around the clipping, or maybe keep the weight as an entity until it is pushed down the rope. I'll decide on which one i'll do later, I'm going to have a break for a while, thanks for helping.


(This post was last modified: 04-14-2012, 04:31 AM by DRedshot.)
04-14-2012, 04:30 AM
Find




Users browsing this thread: 1 Guest(s)