Frictional Games Forum (read-only)

Full Version: Model editor - Can Attach Character
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When defining body properties inside the model editor, there is an option for "Can Attach Character". From the naming, I am assuming this would mean i could actually attach this entity to the player somehow, if I were to check this option.

The only method that seems like it could do this is the following:
But this doesn't work, which I don't find surprising as the "Player" entity seems to only be considered when passed in as the parent in collision functions.

Of course, this may not be the correct interpretation of this option. It could, in fact, be suggesting that if that body were attached to something like a grunt it would prevent the entity from glitching out.

Is either of these two interpretations correct? If the first one is correct, how to I achieve the actual attach to the character?
I think character refers to physical objects in general. Hence when some objects are refered to as char or non-char, which is why the "attach to character" is checked by default. So if it wasn't checked, you wouldn't be able to attach it to any other object. You could probably test that to see if it's true.

If you are looking for a way to attach an object to the player, perhaps:

ConnectEntities(string& asName, string& asMainEntity, string& asConnectEntity, bool abInvertStateSent, int alStatesUsed, string& asCallbackFunc);

would work, since the player is considered an entity I think.
ConnectEntities doesn't weld the two objects together like the Attach functions - to my knowledge it just connects the States of the two entites - e.g: if one breaks the other gets an impulse.

Regarding the Can Attach Character property, Attachments work fine irrespective of that setting being enabled, yet they will not attach to enemies on either setting. Additionally, just tested my second theory and that is a no-go either, the grunt still glitches out if you define a body and attach the mesh to it. Also tested treating the player as a "sticky area" in-case something odd like that worked, which it didn't.

I really am at a loss as to what this option actually does?
Maybe it's supposed to be "can attack character?" As in, when the body contacts you it does damage? Although grunt's don't have bodies defined by the user...maybe other entities can cause damage too. I kinda doubt it's that though.
Bumping this up in-case somebody can help me decipher the meaning of this option. I don't really want to go with the hacktastic solution I have come up with to the player-sticking problem, and would appreciate ruling out this method.
Finally worked out what this does!

This setting when checked makes the object apply a frictional force to the player when it is moving - in other words, it applies the object's motion to the player as if the player were attached to the object. For example, imagine a wheel spinning around like a carousel, and the player standing on the edge: if this option was checked the player would move around with the wheel, and if not, the player would not move due to the motion of the object.
U saying that the player would spin around with the wheel as child? Could you give a clearer explanation please?

Could make some cool puzzles with that. Do I hear booby traps?
(08-18-2011, 02:39 AM)nemesis567 Wrote: [ -> ]U saying that the player would spin around with the wheel as child? Could you give a clearer explanation please?

Imagine what would happen if you stood on the edge of a carousel in motion. You would rotate around with it yes? This is what "can attach character" does - when the player is in contact with the object, the player will move with it correctly - the player is treated as if he is "attached" at that point on the object if he remains still. If "can attach character" is not checked, then the object will spin, but the player will remain still, giving the illusion of hovering slightly off the object (when all that is happening is that there is 0 friction between the player and the object). This probably applies to tranlational motion as-well as rotation motion, but i haven't needed to test it with that yet.


Could make some cool puzzles with that. Do I hear booby traps?
I've been using it to make a rotating platform as part of a jumping section for the teamnesia project Wink. Found it out totally by accident when one entity moved the player with it's motion and a different entity didn't.

You found exactly what I've been doing a thousand tweaks to create.