Frictional Games Forum (read-only)
Sticky Areas - 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: Sticky Areas (/thread-9804.html)



Sticky Areas - nemesis567 - 08-16-2011

I was wondering how do you use these.(I don't mean what are they for)


RE: Sticky Areas - palistov - 08-16-2011

They're tricky little blighters, I say. If you just place one in your map, every single item you pass through it will stick to it. To avoid this, create a function and call it under the area's AttachFunction field. In this function, check to make sure it is the appropriate object you want sticky'd and then use SetAllowStickyAreaAttachment(bool bAllow); to allow it or reject it.

Positioning can be a hassle too, but that's just testing and tweaking. Other than that you shouldn't encounter any issues with them. All the other options under the Area tab are pretty straightforward. Good luck Smile

You can also script the sticky attachment but I haven't explored that method very much.


RE: Sticky Areas - Tanshaydar - 08-16-2011

I tried to use them many times, though I couldn't have a grasp on this area. So I tried some workarounds.
Though, the animation where entity gets out from player's hand and goes to its position, there is no workaround for this.

nemesis567 has reached their private message quota so your message could not be sent.


RE: Sticky Areas - nemesis567 - 08-16-2011

It's been a pain in the ass for me to make it work for starters, even more because the gun I've made is overscaled so I can't see the actual one using the sticky area mesh function. I'll now try what palistov recommended. THanks for your help.

"nemesis567 has erased a few private messages."


RE: Sticky Areas - Apjjm - 08-17-2011

Stickyareas can be used for loads of useful things. By default they only allow one object (which matches the name criteria - see below) to attach to them at a time, but you should be able to attach multiple objects through scripting. The ability to tell the sticky-area to rotate objects but not move them (or vice-versa) is extremely useful in producing "secret" doors, as you don't need to use a separate specialised entity (though the entity may have to have a main physics body defined in it's properties), but instead just activate the area / allow attachment and let the area rotate/move the prop for you.

Use is as simple as defining the attachable object name (or part of the object name - the game does partial string matching to determine if an object is allowed to attach, for example if your object was called "bookcase_1" and the area attached objects with "ok" in them, "bookcase_1" would be attached), and tweaking the parameters until it looks nice. The two function callback settings also have uses too, for example if you want to know if the player has pulled something out of a socket.


RE: Sticky Areas - nemesis567 - 08-17-2011

Thanks a lot Apjjm, that name thing looks pretty damn usefull.