-
August 3rd, 2018, 19:36 #11
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,649
Ok, here's what is happening.
StrainInjury script onInit -> 3.5E script onInit -> CoreRPG script onInit
Both StrainInjury and 3.5E scripts are calling onHealthChanged. However, when a function is defined that calls other functions, the functions are bound at load time. So, both the StrainInjury and 3.5E extensions are each calling their own onHealthChanged function.
Try these changes to the StrainInjury extension:
Code:function onInit() super.super.onInit(); onHealthChanged(); end function onFactionChanged() super.super.onFactionChanged(); updateHealthDisplay(); end
JPG
-
August 3rd, 2018, 21:48 #12
I'll give that a whirl when I get home, thanks.
-
August 4th, 2018, 05:56 #13
That fixed the scripting errors, thanks again. I think the wound-coloring inconsistency I'm seeing between the host and client sides of the CT is a bug that exists in the 3.5 ruleset which is easy to reproduce:
1. Open up a host, connect a localhost client, using a 3.5 campaign with no extensions loaded.
2. Open up the CT on the host, add any NPC. Open up the CT on the client.
3. Set the nonlethal/subdual damage field of the NPC you added to the same value as its total HP. On the host side it is colored red, on the client it is grey. Clear the nonlethal/subdual damage field.
4. Set the nonlethal/subdual damage field of the NPC you added to its total HP + 1. On the host side it is colored purple, on the client grey.
I tracked this down to the fact that on the client side the coloration is entirely based on the contents of the status control (ActorManager2.getPercentWounded) rather than duplicating the calculations performed by the host (which I think it could easily do and would return the same results as the host):
Code:local sStatus; if sNodeType == "ct" and not User.isHost() then sStatus = DB.getValue(node, "status", ""); else ... host calculates sStatus in the else block ...
It seems like the new status isn't set by the host (in ct_entry.lua, onHealthChanged) before the client side calls ActorManager2.getWoundColors in response to its onValueChanged event, so it uses the previous status to set the current color.
-
August 4th, 2018, 15:40 #14
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
Great detective work, darrenan!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks