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
Script Help Callback for using items on character
Buchka123 Offline
Junior Member

Posts: 14
Threads: 8
Joined: Oct 2017
Reputation: 1
#1
Callback for using items on character

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
11-05-2017, 11:01 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: Callback for using items on character

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]

(This post was last modified: 11-05-2017, 03:29 PM by Mudbill.)
11-05-2017, 03:21 PM
Find
Buchka123 Offline
Junior Member

Posts: 14
Threads: 8
Joined: Oct 2017
Reputation: 1
#3
RE: Callback for using items on character

Thank you!
11-05-2017, 05:11 PM
Find
Darkfire Offline
Senior Member

Posts: 371
Threads: 22
Joined: May 2014
Reputation: 15
#4
RE: Callback for using items on character

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.

12-04-2017, 10:23 PM
Find




Users browsing this thread: 1 Guest(s)