PC version stable 1.05
Description
Description
Details
Details
- Severity
- Tweak
- Resolution
- Open
- Reproducibility
- Always
- Operating System
- Windows 7 x64
- Operating System Version
- 6.1(7601)
- Category
- Scripting
Steps To Reproduce
- Add in my code a some operations with a new item BatteryD in my server code
- Use this operation codes:
float Energy_getted = {EntityAI Item BatteryD}.GetCompEM().GetEnergy(); float Energy_new = Energy_getted - 0.2; {EntityAI Item BatteryD}.GetCompEM().SetEnergy(Energy_new); float Energy_getted_new = {EntityAI Item BatteryD}.GetCompEM().GetEnergy(); Print("[#TESTLOG] Energy_getted: " + Energy_getted.ToString() + "Energy_new: " + Energy_new.ToString() + " Energy_getted_new: " + Energy_getted_new.ToString());
- Get in server logs:
[#TESTLOG] Energy_getted: 50 Energy_new: 49.8 Energy_getted_new: -1.65558e-25e
What this is? How this work?
Event Timeline
Comment Actions
Hello AXEL7.
We were unable to reproduce the issue, but try the following:
instead of SetEnergy method, try using something like item.GetCompEM().AddEnergy(-0.2);.
That way, it calls the appropriate events and sync functions from server side, which means the value should be correctly adjusted on both (server and client) instances of the battery, or any other item in question, for that matter, provided it uses the Energy Manager component.
[#TESTLOG] Energy_getted: 40.8Energy_new: 40.6 Energy_getted_new: 40.6 [#TESTLOG] Energy_getted: 40.6Energy_new: 40.4 Energy_getted_new: 40.4 [#TESTLOG] Energy_getted: 40.4Energy_new: 40.2 Energy_getted_new: 40.2
Regards,
Geez