darrenan
August 3rd, 2018, 02:07
In my Strain/Injury HP Variant extension for 3.5/PF I modify the client_ct_entry windowclass as follows:
<windowclass name="client_ct_entry" merge="join">
<script file="ct/scripts/clientct_entry.lua" />
<sheetdata>
<number_clientct_injury name="injury" insertbefore="wounds" />
<number_clientct_nonlethal name="nonlethal" merge="delete" />
</sheetdata>
</windowclass>
For reference, the corresponding windowclass in the 3.5 ruleset is:
<windowclass name="client_ct_entry" merge="join">
<script file="ct/scripts/clientct_entry.lua" />
<sheetdata>
<base_clientct_health name="healthbase" insertbefore="initresult" />
<string_clientct_status name="status" insertbefore="initresult" />
<number_clientct_wounds name="wounds" insertbefore="initresult" />
<number_clientct_nonlethal name="nonlethal" insertbefore="initresult" />
<number_clientct_hptemp name="hptemp" insertbefore="initresult" />
<number_clientct_hp name="hp" insertbefore="initresult" />
</sheetdata>
</windowclass>
This worked fine in 3.3.5, but in 3.3.6 I get the following script error when a player opens up the CT:
Script Error: [string "ct/scripts/clientct_entry.lua"]:20: attempt to index global 'nonlethal' (a nil value)
This leads me to believe that the copy of ct/scripts/clientct_entry.lua from the 3.5 ruleset is being used instead of mine, because my copy does not make any reference to the nonlethal control at all:
function onHealthChanged()
local sColor = ActorManager2.getWoundColor("ct", getDatabaseNode());
wounds.setColor(sColor);
injury.setColor(sColor); <-- Line 20
status.setColor(sColor);
end
Again, for reference, here is the same function from the 3.5 ruleset showing the line that I think is generating the script error:
function onHealthChanged()
local sColor = ActorManager2.getWoundColor("ct", getDatabaseNode());
wounds.setColor(sColor);
nonlethal.setColor(sColor); <-- Line 20
status.setColor(sColor);
end
Did something change between 3.3.5 and 3.3.6 regarding the logic used to locate the script file for a windowclass like this? Can you think of any other reason why it wouldn't be using my copy of the script file?
Thanks in advance for any help. If I can provide additional info, let me know.
<windowclass name="client_ct_entry" merge="join">
<script file="ct/scripts/clientct_entry.lua" />
<sheetdata>
<number_clientct_injury name="injury" insertbefore="wounds" />
<number_clientct_nonlethal name="nonlethal" merge="delete" />
</sheetdata>
</windowclass>
For reference, the corresponding windowclass in the 3.5 ruleset is:
<windowclass name="client_ct_entry" merge="join">
<script file="ct/scripts/clientct_entry.lua" />
<sheetdata>
<base_clientct_health name="healthbase" insertbefore="initresult" />
<string_clientct_status name="status" insertbefore="initresult" />
<number_clientct_wounds name="wounds" insertbefore="initresult" />
<number_clientct_nonlethal name="nonlethal" insertbefore="initresult" />
<number_clientct_hptemp name="hptemp" insertbefore="initresult" />
<number_clientct_hp name="hp" insertbefore="initresult" />
</sheetdata>
</windowclass>
This worked fine in 3.3.5, but in 3.3.6 I get the following script error when a player opens up the CT:
Script Error: [string "ct/scripts/clientct_entry.lua"]:20: attempt to index global 'nonlethal' (a nil value)
This leads me to believe that the copy of ct/scripts/clientct_entry.lua from the 3.5 ruleset is being used instead of mine, because my copy does not make any reference to the nonlethal control at all:
function onHealthChanged()
local sColor = ActorManager2.getWoundColor("ct", getDatabaseNode());
wounds.setColor(sColor);
injury.setColor(sColor); <-- Line 20
status.setColor(sColor);
end
Again, for reference, here is the same function from the 3.5 ruleset showing the line that I think is generating the script error:
function onHealthChanged()
local sColor = ActorManager2.getWoundColor("ct", getDatabaseNode());
wounds.setColor(sColor);
nonlethal.setColor(sColor); <-- Line 20
status.setColor(sColor);
end
Did something change between 3.3.5 and 3.3.6 regarding the logic used to locate the script file for a windowclass like this? Can you think of any other reason why it wouldn't be using my copy of the script file?
Thanks in advance for any help. If I can provide additional info, let me know.