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
Connect Area to Entity
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#11
RE: Connect Area to Entity

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.

08-14-2011, 11:31 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#12
RE: Connect Area to Entity

Instead of creating an inactive ragdoll, CreateEntityAtArea() can be used I think. But either way, ragdoll's facing direction is not given.

(This post was last modified: 08-14-2011, 11:37 PM by Tanshaydar.)
08-14-2011, 11:36 PM
Website Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#13
RE: Connect Area to Entity

Yeah but that'll freeze up the screen for a second, Tanshaydar.

08-14-2011, 11:37 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#14
RE: Connect Area to Entity

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.

(This post was last modified: 08-14-2011, 11:41 PM by Tanshaydar.)
08-14-2011, 11:40 PM
Website Find
Phoroneus Offline
Member

Posts: 141
Threads: 12
Joined: Feb 2011
Reputation: 0
#15
RE: Connect Area to Entity

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.

[Image: at_9365860.png]

Follow Harvest.
08-15-2011, 01:01 AM
Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#16
RE: Connect Area to Entity

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.
(This post was last modified: 08-15-2011, 02:07 AM by Apjjm.)
08-15-2011, 01:52 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#17
RE: Connect Area to Entity

(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.

Tutorials: From Noob to Pro
(This post was last modified: 08-15-2011, 02:46 AM by Your Computer.)
08-15-2011, 02:46 AM
Website Find
Phoroneus Offline
Member

Posts: 141
Threads: 12
Joined: Feb 2011
Reputation: 0
#18
RE: Connect Area to Entity

(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

[Image: at_9365860.png]

Follow Harvest.
(This post was last modified: 08-15-2011, 09:54 AM by Phoroneus.)
08-15-2011, 09:42 AM
Find




Users browsing this thread: 1 Guest(s)