This forum is going to be locked at the end of this year and eventually going offline. If you have feedback to share you can find us in our Discord channel "MythoLogic Interactive" https://discord.gg/nECKnbT7gk

Make sure to read the rules.

Getting objects a player threw/dropped

Here you can find ScriptAPI suggestions implemented in the game.
Forum rules
By using the forum you agree to the following rules.
Locked
User avatar
MScull
Fighter
Fighter
Posts: 33
Joined: Sun May 29, 2016 9:43 pm
Title: No Title
SFD Account: MScull
SFD Alias: Scull
Started SFD: PreAlpha 1.8.8
Location: The Netherlands
Gender:
Age: 24

Getting objects a player threw/dropped

Post by MScull » Sun Feb 12, 2017 7:31 pm

Hello!

I was wondering if there's a way to get the object a player threw/dropped. I've scrolled through the whole API, the only thing I could find something to be maybe a little bit equivalent was the method 'IPlayer.IsThrowing'. This method doesn't return the item thrown, only a boolean.

Thanks in advance.
0 x
hi

User avatar
JakSparro98
Superfighter
Superfighter
Posts: 530
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 27

Post by JakSparro98 » Mon Feb 13, 2017 12:35 am

MScull wrote:Hello!

I was wondering if there's a way to get the object a player threw/dropped. I've scrolled through the whole API, the only thing I could find something to be maybe a little bit equivalent was the method 'IPlayer.IsThrowing'. This method doesn't return the item thrown, only a boolean.

Thanks in advance.
You should collect all the weapons and throwable that are on the ground and then store only the one which has the "Is.Missile" on true, this isn't the most reliable way because also when a grenade explodes on weapons the latter are tracked as missile, but currently is the only way to achieve it.
1 x

User avatar
MScull
Fighter
Fighter
Posts: 33
Joined: Sun May 29, 2016 9:43 pm
Title: No Title
SFD Account: MScull
SFD Alias: Scull
Started SFD: PreAlpha 1.8.8
Location: The Netherlands
Gender:
Age: 24

Post by MScull » Mon Feb 13, 2017 3:53 pm

JakSparro98 wrote:
MScull wrote:Hello!

I was wondering if there's a way to get the object a player threw/dropped. I've scrolled through the whole API, the only thing I could find something to be maybe a little bit equivalent was the method 'IPlayer.IsThrowing'. This method doesn't return the item thrown, only a boolean.

Thanks in advance.
You should collect all the weapons and throwable that are on the ground and then store only the one which has the "Is.Missile" on true, this isn't the most reliable way because also when a grenade explodes on weapons the latter are tracked as missile, but currently is the only way to achieve it.
Alright, I was afraid that this was the only possible way to achieve it. Thanks for giving me an answer!
0 x
hi

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1885
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 35

Post by Gurt » Thu Mar 08, 2018 8:23 pm

Moving this to the ScriptAPI suggestions.
Edit: Possible to achieve this using the ObjectCreated callback event in recent versions.
1 x
Gurt

Locked