Frictional Games Forum (read-only)
[SCRIPT] Callback for using items on character - 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: [SCRIPT] Callback for using items on character (/thread-53936.html)



Callback for using items on character - Buchka123 - 11-05-2017

Hello again, is it possible to make item that can be used on character himself and for example he begins to move at double speed? Is it possible to make callback for using items on character himself? Is it possible to attach an item to character like a second lantern(Penumbras light rod)? Huh


RE: Callback for using items on character - Mudbill - 11-05-2017

If you mean on the player, then yes, but requires some setup. I don't think there are any quick and easy ways to check if a consumable item has been consumed, so you may have to use a repeating timer to continuously check for it with HasItem(). There are some issues with doing this however. It's much more safe and reliable to use an item combine callback.

As for run speed, easy enough with SetPlayerRunSpeedMul().

Attaching items to the player is possible, but I'm not certain how. I know it was done in one of the later The Small Horse parts, so might be worth checking. Perhaps it has something to do with the attach scripts.

Here's the example anyway (at 7:40 ish):
[video=youtube]https://youtu.be/HrDQtZ11UXQ?t=7m40s[/video]


RE: Callback for using items on character - Buchka123 - 11-05-2017

Thank you!


RE: Callback for using items on character - Darkfire - 12-04-2017

I think it also has to do with a certain kind of objects that move to the side when you grab them.
(In ModelEditor go to Settings-> User Defined Variables -> Type:Object -> SubType: Grab, scroll down and check "Grab Use Offset" and then play around with the numbers below)
How the object keeps being held without player's input is a mystery to me. Perhaps some rare script was used.