DICE PACKS BUNDLE
Page 1 of 2 12 Last
  1. #1

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096

    Extension String Resource Failure

    I am trying to add a button similar to the button on the right image in the Story window to the Tables window on the left. The button I have works when you press it, but the text is missing.

    Image1.png

    The template for the story window "Templates" button is below:


    Code:
    	<template name="button_storytemplate">
    		<button_text_sm>
    			<anchored to="buttonanchor" width="80">
    				<top />
    				<left anchor="right" relation="relative" offset="5" />
    			</anchored>
    			<state textres="story_button_templates" />
    			<script>
    				function onButtonPress()
    					Interface.openWindow("masterindex", "storytemplate");
    				end
    			</script>
    		</button_text_sm>
    	</template>
    Now that string resource is contained in the strings_campaign.xml file as:

    Code:
    	<string name="story_button_templates">Templates</string>
    Below is my generator.xml file that has the template for my button:

    Code:
    <?xml version="1.0" encoding="iso-8859-1"?>
    
    
    <!-- 
      Template and interface materials for generators.
    -->
    
    
    <root>
    	<icon name="button_generators" file="button_generators.png" />
    	<!-- General -->
    	<template name="button_generators">
    		<button_text_sm>
    			<anchored to="buttonanchor" width="80">
    				<top />
    				<left anchor="right" relation="relative" offset="5" />
    			</anchored>
    			<state textres="generator_button_templates" />
    			<script>
    				function onButtonPress()
    					Interface.openWindow("masterindex", "generators");
    				end
    			</script>
    		</button_text_sm>
    	</template>
    
    
    </root>
    It is included by my extension file:

    Code:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <root version="2.8" logo="button_generators.png">
      <properties>
        <name>Generators</name>
        <version>0.1</version>
        <author>Bidmaron</author>
        <description>Adds functionality to the built-in tables of Fantasy Grounds and augments Story Templates with Generators having additional functionality</description>
        <!--<ruleset>
    		<name>CoreRPG</name>
    		<minrelease>3</minrelease>
        </ruleset>-->
      </properties>
      
    	<announcement text="Generators - v0.1 for FG V3.3.3 CoreRPG ruleset by Bidmaron.  \rCopyright 2016 Smiteworks USA, LLC." font="emotefont" icon="button_generators"/> 
    	
      <base>
      
    	<includefile source="generator.xml" />
    
    
    	<!-- String resources -->
    	includefile source="strings_super_table.xml"
    
    
    	<!-- Extension loading script - writes info to chat window and contains custom code -->
    	<script name="Tables_Plus" file="Tables Plus.lua" />  	
      </base>
    </root>
    And that file also includes my string resources:[/COLOR]

    Code:
    <?xml version="1.0" encoding="iso-8859-1"?>
    
    
    <!-- 
      String resources for Super Table.
    -->
    
    
    <root>
    	<string name="option_label_TABLEBEHAVIOR">Table Roll Behavior</string>
    	<string name="option_val_chat_IA">Chat Animation</string>
    	<string name="option_val_sync">No Animation</string>
    	<string name="option_val_legacy">Legacy</string>
    	<string name="column_separator">;</string>
    	<string name="row_separator">&#xD;</string>
    	<string name="roll_separator"></string>
    	<string name="generator_button_templates">Generators</string>
    	<!--error messages-->
    	<string name="table_error_format_illegal">Font formatting cannot be used inside a frame, or table.</string>
    	<string name="table_error_nested_format">Font formatting cannot be nested inside the same formatting.</string>
    	<string name="repeat_missing_target">Multiple roll specification is missing subtable definition.</string>
    	<string name="missing_endif">If statement missing the 'endif' terminator.</string>
    	<string name="missing_loop">While statement missing the 'loop' statement.</string>
    	<string name="missing_while_loop">Loop statement present without the while statement to start the loop.</string>
    	<string name="missing_while_break">Break statement present without the while statement to start a loop.</string>
    	<string name="missing_if_else">Else statement present without the if statement.</string>
    	<string name="missing_if_endif">Endif statement present without the if statement.</string>
    	<string name="roll_missing">Unable to locate the table or generator roll </string>
    	<string name="unidentified_caller">Generator roll code invoked from an unidentified source.</string>
    	<string name="roll_in_progress">Attempt to initiate another table or generator sequence when there is already a table or generator in progress.</string>
    	<string name="bad_roll_status">Invalid status of table roll process.</string>
    </root>
    So I am just stymied not figuring out why my button doesn't have the word "Generators" in it. What am I missing?
    Attached Images Attached Images
    Last edited by Bidmaron; October 31st, 2017 at 04:35.

  2. #2

  3. #3

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096
    thanks for the look, damned, but the template is identical to the working one in the story window except for the window it chains to (which works) and the string resource called out for the button.

  4. #4
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,678
    Blog Entries
    1
    you are anchoring to something called buttonanchor
    if buttonanchor doesnt exist it has nothing to base its positioning on.

    Code:
    		<genericcontrol name="buttonanchor">
    			<anchored to="contentanchor" width="170" height="0">
    				<top anchor="bottom" offset="15" />
    				<left />
    			</anchored>
    		</genericcontrol>

  5. #5
    Change the textres to a static text and see if it displays. If not, the problem is probably anchoring. If it does, then the problem is probably with the string resource (and we can continue).
    I never claimed to be sane. Besides, it's more fun this way.

  6. #6

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096
    Ok I will give it a go. Seems like the button wouldn’t be there either if it were an anchoring problem but let me check.

  7. #7
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,678
    Blog Entries
    1
    Quote Originally Posted by Bidmaron View Post
    Ok I will give it a go. Seems like the button wouldn’t be there either if it were an anchoring problem but let me check.
    the button and the text are not anchored to the same thing.
    my guess is you either dont have buttonanchor or its not where you think it is.
    there are other possibilities but we cant see the rest of your code.

  8. #8

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096
    It will be tonight if I get done with Halloween festivities in time.

  9. #9
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,404
    Quote Originally Posted by Bidmaron View Post
    Code:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <root version="2.8" logo="button_generators.png">
      <properties>
        <name>Generators</name>
        <version>0.1</version>
        <author>Bidmaron</author>
        <description>Adds functionality to the built-in tables of Fantasy Grounds and augments Story Templates with Generators having additional functionality</description>
        <!--<ruleset>
    		<name>CoreRPG</name>
    		<minrelease>3</minrelease>
        </ruleset>-->
      </properties>
      
    	<announcement text="Generators - v0.1 for FG V3.3.3 CoreRPG ruleset by Bidmaron.  \rCopyright 2016 Smiteworks USA, LLC." font="emotefont" icon="button_generators"/> 
    	
      <base>
      
    	<includefile source="generator.xml" />
    
    
    	<!-- String resources -->
    	includefile source="strings_super_table.xml"
    
    
    	<!-- Extension loading script - writes info to chat window and contains custom code -->
    	<script name="Tables_Plus" file="Tables Plus.lua" />  	
      </base>
    </root>
    ?
    Missing < > around includefile source="strings_super_table.xml" ??
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  10. #10

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096
    Thanks. Will check but I am getting no console error on it so I think that was probably cut and paste error on my post. At work and cannot check until tonight.

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
  •  
5E Product Walkthrough Playlist

Log in

Log in