STAR TREK 2d20
  1. #1

    Question Ignoring <defaultlabel> in <button_stringcycler>

    Hi Guys,

    One for the Devs, but feel free to chip in:

    OK, so I'm using a <button_stringcycler> from the CoreRPG and everything is fine - except that the <defaultlabel> (and hence the <button_stringcycler>.defaultvalue) is giving me the sh!ts as I'm trying to code around it.

    What I'd like to be able to do is use the <button_stringcycler> and have it ignore the <defaultlabel> and only use the <labels> and <values>, but at the moment if I leave <defaultlabel> out I get a blank (ie "") option as I cycle through the values of the <button_stringcycler>.

    Is there a way of using the <button_stringcycler> in the manner I'd like (ie have I missed a tag option that will allow me to do this) or is there another template around that I haven't found yet which will do what I want?

    My only other option is to re-code a version of the <button_stringcycler> and have the <button_stringcycler>.cycleindex return to 1, not 0 as it does now.

    Any help would be appreciated.

    (And yes, I know that we can use the <defaultlabelres> instead of the <defaultlabel> (etc) - that's not the issue.)

    Cheers
    Dulux-Oz

    √(-1) 2^3 Σ Π
    ...And it was Delicious!


    Alpha-Geek
    ICT Professional
    GMing Since 1982
    NSW, Australia, UTC +10
    LinkedIn Profile: www.linkedin.com/in/mjblack

    Watch our games on Twitch: www.twitch.tv/dulux_oz

    Support Me on Patreon: www.patreon.com/duluxoz

    Past Games, etc, on my YouTube Channel: www.youtube.com/c/duluxoz

  2. #2
    Valarian's Avatar
    Join Date
    Mar 2007
    Location
    Worcestershire, UK
    Posts
    2,567
    I've found that I have to modify the template string cycler Lua script to get the labels, rather than use the <labels> and <values> tags. I've not been able to get those to work either.
    Using Ultimate license - that means anyone can play.
    Valarian's Fantasy Grounds Rulesets

  3. #3
    Quote Originally Posted by Valarian View Post
    I've found that I have to modify the template string cycler Lua script to get the labels, rather than use the <labels> and <values> tags. I've not been able to get those to work either.
    Oh, I've got them to work OK (I use <button_stringcycler>.getStringValue()) - the trouble is, when using this function and the when the cycle is set to the defaultlabel (ie <button_stringcycler>.cycleindex == 0) I get a value of "" - and THAT'S my problem, because I need to search a string containing <button_stringcycler>.getStringValue(), and when <button_stringcycler>.getStringValue() == "" the search fails.
    Dulux-Oz

    √(-1) 2^3 Σ Π
    ...And it was Delicious!


    Alpha-Geek
    ICT Professional
    GMing Since 1982
    NSW, Australia, UTC +10
    LinkedIn Profile: www.linkedin.com/in/mjblack

    Watch our games on Twitch: www.twitch.tv/dulux_oz

    Support Me on Patreon: www.patreon.com/duluxoz

    Past Games, etc, on my YouTube Channel: www.youtube.com/c/duluxoz

  4. #4
    Valarian's Avatar
    Join Date
    Mar 2007
    Location
    Worcestershire, UK
    Posts
    2,567
    I could only get it working by coding the strings and values in to the Lua script directly, copying the template string cycler script and modifying it, then calling that from the field template. IIRC, I think the template Lua script assumes a null, 0, 1 cycle.
    Using Ultimate license - that means anyone can play.
    Valarian's Fantasy Grounds Rulesets

  5. #5
    The default value is always "". The default label is just what is displayed when the value is "".

    Cheers,
    JPG

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 Character Create Playlist

Log in

Log in