STAR TREK 2d20
Page 1 of 2 12 Last
  1. #1

    Windowclass script working differently in 3.3.6?

    In my Strain/Injury HP Variant extension for 3.5/PF I modify the client_ct_entry windowclass as follows:

    Code:
    	<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:

    Code:
    	<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:

    Code:
    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:

    Code:
    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:

    Code:
    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.
    Last edited by darrenan; August 3rd, 2018 at 03:52.

  2. #2

  3. #3
    my question is very specific. It has to do with the specific windowclass and its associated script file as explained in post #1. All the template changes were easy to track down and resolve. I don't think that is the issue in this case.

  4. #4

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096
    darrennan, it sounds to me like you have an unpacked ruleset problem? Otherwise, I don't see how it can be happening assuming your lua file doesn't in fact reference the deleted control.

  5. #5
    nope, no unpacked ruleset in my rulesets directory.

    rulesets dir.png

  6. #6
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,656
    Blog Entries
    1
    You are deleting the number_clientct_nonlethal so the 3.5e script cannot find it.

    EDIT: Ok - I understand what you are saying now.

  7. #7
    Attaching the current version of the extension if that helps.

    StrainInjury.ext

    EDIT: In case I wasn't clear, the script error only happens on the client side, not on the host side.

  8. #8
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,656
    Blog Entries
    1
    I dont know if this **might** help....
    https://www.fantasygrounds.com/forum...l=1#post397382
    I had a merge=delete issue a little while ago that was resolved by completely closing and relaunching FG... just maybe...

  9. #9

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096
    Oh. Well, apparently, there are some changes in window_classes for the combat tracker on the client side. There may be some code elsewhere that is only executed for client that needs that node to be there. See if there is another file with that name in the code base that is nested under a client side ct window?

  10. #10
    Quote Originally Posted by damned View Post
    I dont know if this **might** help....
    https://www.fantasygrounds.com/forum...l=1#post397382
    I had a merge=delete issue a little while ago that was resolved by completely closing and relaunching FG... just maybe...
    I don't have any actual code in my extension.xml, other than script file declarations. My extension is modeled on the 3.5 ruleset and follows the same organizational patterns and practices.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
FG Spreadshirt Swag

Log in

Log in