DICE PACKS BUNDLE
  1. #1
    Blackfoot's Avatar
    Join Date
    Oct 2010
    Location
    New Jersey, USA
    Posts
    4,202
    Blog Entries
    4

    Trouble with button_stringcycler...

    I am trying to add a cycle button to a variant of the 3.5 skill tab.
    Pulling out the 'class skill' button and replacing it with one that has 4 settings for the 'type' of skill.
    In Champions there are 4 types of skills:
    Untrained - 6 or less
    Familiar Skills - 8 or less
    Background Skills - 11 + ranks or less
    Trained Skills - 9 + stat/5 + ranks or less

    Code:
    <button_checkbox name="state">
    <bounds>22,8,12,12</bounds>
    <script>
    function onValueChanged() 
    CharManager.updateSkillPoints(window.getDatabaseNode().getChild("..."));
    end
    </script>
    </button_checkbox>-->
    Replaced with this:
    Code:
    			<cycler_charskilltype name="state">
    					<bounds>22,2,12,20</bounds>
    				<script>
    					function onValueChanged()
    						window.onStatUpdate();
    -- I realize this is all wrong.. but I'm still working on this script... suggestions here would help.
    					end
    				</script>
    			</cycler_charskilltype>
    Using this template:
    Code:
    	<template name="cycler_charskilltype">
    		<button_stringcycler>
    			<parameters>
    				<labelsres>utr|fam|bg|tr</labelsres>
    				<values>untrained|familiarity|background|trained</values>
    			</parameters>
    		</button_stringcycler>
    	</template>
    This ends up looking really pretty and all.. puts it in the right spot.. nice little box and all.. but when I click it it gives me this error:
    Code:
    Script Error: [string "common/scripts/button_stringcycler.lua"]:251: bad argument #1 to 'setValue' (number expected, got string)
    and doesn't toggle through the values. I'm not sure why it looking for a number.. I copied this cycler setup from the abilities cycler.. and it is all strings.
    Last edited by Blackfoot; November 13th, 2013 at 21:40.
    Full License Operator - You must have a 'Lite' License to play in my games.
    Member and GM in the Fantasy Grounds Pathfinder Society Group.
    PFS Fantasy Grounds Forum
    FG Community Teamspeak Server: ts.fg-con.com
    Interested in Custom Character Portraits and Tokens? Contact me.

  2. #2
    The stringcycler control is attempting to write the string value of the next value in the cycle to the node with the same name as the stringcycler control. However, the error message is stating that the underlying control has the "number" data type, which means that it is being set as a number somewhere else.

    * Check for other fields/controls with the same name.
    * Check for number_linked/number_modifier fields which attempt to update when this field changes. For those field templates, they automatically create a number field to link to, unless you specify string. (See common/scripts/number_linked.lua in the CoreRPG ruleset; specifically the onInit and addSource functions) Also, the 3.5E ruleset has an example for the "number_charweapondamagetotal" template and the "number_charweaponattacktotal" template.
    * If you don't find anything with those two hints, it's probably in some Lua script code with a createChild or DB.setValue call.

    Cheers,
    JPG

  3. #3
    Blackfoot's Avatar
    Join Date
    Oct 2010
    Location
    New Jersey, USA
    Posts
    4,202
    Blog Entries
    4
    My cycler is working spiffily now, thanks again for the assist!
    Full License Operator - You must have a 'Lite' License to play in my games.
    Member and GM in the Fantasy Grounds Pathfinder Society Group.
    PFS Fantasy Grounds Forum
    FG Community Teamspeak Server: ts.fg-con.com
    Interested in Custom Character Portraits and Tokens? Contact me.

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