Starfinder Playlist
  1. #1

    Can a checkbutton return a value?

    Hi all,


    I'm in trouble with a ruleset modification. To represent the different levels of a heathbar, i have five labels and a check type button associated at the end of each lines. Fresh, Weary, Tired, Dazed, and so on.

    What i want to do is when the checkon state is activated, it returns the value "1", so i can use this in a subsequent field to calculate the right penalty. i.e. tired = 1 for checked button x (-3 for tired state) = -3

    Actually i have a stringfield where i write "1". Can i swap it to a checkbox and have the "1" still counted? And how to do that?

    Or to simplify, have the right penalty ported over when the button is checked. i.e tired = -3

    Thanks by advance.
    Last edited by Maspalio; December 14th, 2019 at 13:32.

  2. #2
    A buttonfield is stored as a number in the database. If it has more than one state, then the states will be numbers from 0 to n-1, where n is the number of button states. You can use getValue() and setValue() on a button control to retrieve or set the state.

    You'll need to make sure that you work through the logic that you are trying to accomplish so that the data stored in the database is what you expect, and the fields that you are displaying to the user will update as you expect.

    I was not able to understand exactly what you want to do, based on your description; so I can't be more specific.

    Regards,
    JPG

  3. #3

  4. #4
    Thanks to both of you, it was helpful.

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
  •  
DICE PACKS BUNDLE

Log in

Log in