Frictional Games Forum (read-only)

Full Version: Connect Area to Entity
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Try this: Create multiple areas across the section of the map in which the monster can be. In each area create an inactive ragdoll. Use GetEntitiesCollide() to check if the monster is in each area upon death (for loops will do that trick nicely) and then set the appropriate ragdoll active. That's the only solution I can think of.
Instead of creating an inactive ragdoll, CreateEntityAtArea() can be used I think. But either way, ragdoll's facing direction is not given.
Yeah but that'll freeze up the screen for a second, Tanshaydar.
Not if the entity is not reached first time. If there is an active or inactive entity in the map, it's already cached. At least, this is how I experienced. I'm not keen to use CreateEntityAtArea for my own reasons.
I tried a similar approach to yours before, palistov, in order to implement a hypothermia mechanic for an old project (that was until I figured out other means of implementing the mechanic via scripts), and while it technically worked, it was really ugly and inefficient.
You could build a dynamic collision triggered position tracking system with respect to a static object off the map acting as the origin, with the aim of following the monster around, then upon whatever event attaching to the origin using the position of the enemy (relative to the origin). I was planning on building a system like this a while back to track the players position, but I never got around to it.
The general idea was to pick a cube size which is equal to the diameter of the target body, then use Attaching to the origin to remove and create cubes as necessary based on the collisions to track the target. Subdivision can then be used when you need a more precise answer using the cube position mean as a starting point.

Getting the rotation of the enemy is a problem with this system, though, also Attached props do not have physics enabled or collisions.
(08-14-2011, 10:33 PM)Phoroneus Wrote: [ -> ]Bad news. While I've got the code working properly, enemies do not count as props, so nothing can be attached to them.
This may touch on what Apjjm wrote, but depending on how the monster is killed, you could probably pull it off. If you're killing the monster with a weapon, like a sword, then you should be able to attach the ragdoll to the weapon and hopefully RemoveAttachedPropFromProp() does nothing more than the description of the function.
(08-15-2011, 02:46 AM)Your Computer Wrote: [ -> ]
(08-14-2011, 10:33 PM)Phoroneus Wrote: [ -> ]Bad news. While I've got the code working properly, enemies do not count as props, so nothing can be attached to them.
This may touch on what Apjjm wrote, but depending on how the monster is killed, you could probably pull it off. If you're killing the monster with a weapon, like a sword, then you should be able to attach the ragdoll to the weapon and hopefully RemoveAttachedPropFromProp() does nothing more than the description of the function.

This does work. The only thing left to do is sort out the facing. I could try to get it to recognize physics (e.g. momentum of the monster) but I've spent enough time on this for one day, I think.
I stand corrected: the AttachPropToProp doesn't make the object appear as I thought. The success was caused inadvertently by having an inactive ragdoll entity in my test map. Back to the drawing board, I suppose. Tongue
Pages: 1 2