Killed because too far from a grabbable object - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: Killed because too far from a grabbable object (/thread-12026.html) |
Killed because too far from a grabbable object - Danny Boy - 12-23-2011 I have a question... is it possible to kill the player if he gets too far from a grabable object? like for example a box? like for example... i walk whit that object... but i felt like put it in the floor and continue whitout it... after i reach some distance like 10 meters the player simple dies... how can i do this IF possible? RE: Killed because too far from a grabbable object - Your Computer - 12-23-2011 I'm not sure if it is possible to create something similar and practical in order to work around the limitations of the engine (since, as far as i know, you can't attach areas to objects, and GetEntitiesCollide doesn't support Player), but how about changing the game mechanic to being forced to hold the object and when placed down the user has only a certain amount of time to pick the object right back up before dying? GetPropIsInteractedWith should be able to allow for that (though i've never used GetPropIsInteractedWith before). RE: Killed because too far from a grabbable object - Apjjm - 12-23-2011 A similar problem was faced when i was detecting the lantern for my "Observable" map & engine. Quick overview of one potential solution: Create a copy of block_box.ent - call it something like "detector.ent". Open it in the model editor and delete it's body. Create a new sphere shape and scale it to be the radius around the object the player must be within to survive. Make the sphere a body, attach the body the sub-mesh. Disable "collides character" and "collides non-character" in the body properties, give the body 0 mass. In the script for your level, use AddAttachedPropToProp to attach this detector entity to your grabbable object. Then use AddEntityCollideCallback w/ the name of the attached prop and use this to determine if the player leaves the radius of the object. E.g: Code: void OnStart() Edit: clarity. RE: Killed because too far from a grabbable object - Khyrpa - 12-23-2011 (12-23-2011, 01:44 AM)Apjjm Wrote: A similar problem was faced when i was detecting the lantern for my "Observable" map & engine.Holy mother of spaghettimonster! I can understand something you explain, and it seems simple! RE: Killed because too far from a grabbable object - Statyk - 12-24-2011 (12-23-2011, 01:44 AM)Apjjm Wrote: A similar problem was faced when i was detecting the lantern for my "Observable" map & engine.So much was said here but wow... Genius. I need to think a little further into this, I could use this trick for my campaign a bit =] RE: Killed because too far from a grabbable object - Your Computer - 12-24-2011 I could have sworn i had tested that out a long time ago and it didn't work for me then. Just tried it out now, and it worked. Not sure what i did wrong back then, but at least now i can fix a few issues i had with my Amnesia's Creed map. I remember now what i was trying to do: i was trying to attach a prop onto a monster, but couldn't because monsters aren't considered props. |