Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

Exposing a getter/setter for player energy

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
JakSparro98
Superfighter
Superfighter
Posts: 530
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 25

Exposing a getter/setter for player energy

Post by JakSparro98 » Mon Jan 13, 2020 12:31 am

Today we can access player's health by invoking it's inherited method from IObject, however currently is not possible to manipulate/read the stamina/energy value, pretty weird it wasn't planned in any way, am I missing something?
1 x

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

Post by Gurt » Sat Jan 18, 2020 11:30 pm

You can only activate infinite energy using modifiers per player or use the global /ie 1 command.
You can not update the stamina value as that wouldn't reliably be predictable by the client, causing a lot of problems. If there's not a getter for the stamina already I will try to add one for the next update.
Edit: ScriptAPI: Added IPlayer.GetEnergy(), IPlayer.GetMaxEnergy() to read current energy from a player (v.1.3.4)
2 x
Gurt

Locked