This forum is locked and will eventually go offline. If you have feedback to share you can find us in our Discord channel "MythoLogic Interactive" https://discord.gg/nECKnbT7gk
Forum rules
Forum rules
Add IPlayer.CurrentThrownItem.IsActivated
Forum rules
By using the forum you agree to the following rules.
By using the forum you agree to the following rules.
-
NearHuscarl
- Superfighter

- Posts: 97
- Joined: Thu Feb 07, 2019 4:36 am
Add IPlayer.CurrentThrownItem.IsActivated
Some throwable weapons can be activated before being thrown. IPlayer.CurrentThrownItem.IsActivated returns true when the throwable weapon the player is holding is activated (grenades, c4, molotov, mine). Returns false when not activated or when player is holding weapons that cannot be activated (shuriken).
0 x

- Danger Ross
- Superfighter

- Posts: 154
- Joined: Thu Mar 31, 2016 12:56 am
- Title: Dangerous
- SFD Alias: Danger Ross
- Started SFD: 14 june 2012 (launch day)
- Location: California
- Gender:
- Age: 25
You can keep track of that information through virtualkey inputs. that's what I do that in my current project.
Once IPlayer.IsThrowingMode is added you'll be able to filter throwing the item from activating it as well.
This addition isn't necessary.
Once IPlayer.IsThrowingMode is added you'll be able to filter throwing the item from activating it as well.
This addition isn't necessary.
0 x
sorry bucko, you can't punch with swords 
-
NearHuscarl
- Superfighter

- Posts: 97
- Joined: Thu Feb 07, 2019 4:36 am
Currently the way I do is to check if the player presses the attack key while holding the throwable weapon, turn the flag on if they do, and then compare with the current throwable weapon items left to turn the flag off. It's not working with /ia 1 because the current ammo never changes
Also the reason why I have to compare the the current throwable wpn ammo instead of checking whether the player's released the attack key is because the player can hold the grenade until it explodes without releasing the attack key.
So there are 2 ways to solve the problem. You can either add IPlayer.CurrentThrownItem.IsActivated or/and expose the grenade cook time so I can turn off the flag when the grenade goes off
Also the reason why I have to compare the the current throwable wpn ammo instead of checking whether the player's released the attack key is because the player can hold the grenade until it explodes without releasing the attack key.
So there are 2 ways to solve the problem. You can either add IPlayer.CurrentThrownItem.IsActivated or/and expose the grenade cook time so I can turn off the flag when the grenade goes off
0 x

- Gurt
- Lead Programmer

- Posts: 1887
- Joined: Sun Feb 28, 2016 3:22 pm
- Title: Lead programmer
- Started SFD: Made it!
- Location: Sweden
- Gender:
- Age: 36
Added after v.1.3.5:
ScriptAPI: Added IPlayer.IsHoldingActiveThrowable, IPlayer.GetActiveThrowableWeaponItem(), IPlayer.SetActiveThrowableTimer(..), IPlayer.DisarmActiveThrowable(..) to be able to read and disarm current active throwables on a player.
ScriptAPI: Updated IPlayer.Disarm(..), it will now disarm any active throwables first if you disarm Thrown weapon items. Included an optional 'out IObject disarmedActiveThrowable' parameter to be able to read the disarmed active throwable (if any) - this returns the same object as calling IPlayer.DisarmActiveThrowable() first. This is done to keep backwards compatibility with existing Disarm calls.
ScriptAPI: Added IObjectGrenadeThrown.GetExplosionTimer(), IObjectGrenadeThrown.SetExplosionTimer() to be able to change the explosion timer on thrown grenades (and reactivate them by calling SetExplosionTimer after the first timer runs out).
ScriptAPI: Added IPlayer.IsHoldingActiveThrowable, IPlayer.GetActiveThrowableWeaponItem(), IPlayer.SetActiveThrowableTimer(..), IPlayer.DisarmActiveThrowable(..) to be able to read and disarm current active throwables on a player.
ScriptAPI: Updated IPlayer.Disarm(..), it will now disarm any active throwables first if you disarm Thrown weapon items. Included an optional 'out IObject disarmedActiveThrowable' parameter to be able to read the disarmed active throwable (if any) - this returns the same object as calling IPlayer.DisarmActiveThrowable() first. This is done to keep backwards compatibility with existing Disarm calls.
ScriptAPI: Added IObjectGrenadeThrown.GetExplosionTimer(), IObjectGrenadeThrown.SetExplosionTimer() to be able to change the explosion timer on thrown grenades (and reactivate them by calling SetExplosionTimer after the first timer runs out).
2 x
Gurt