Starfinder Playlist
  1. #1

    Updating information in tabs

    So I'm trying to get my ruleset to update something on tab2 when I update the value of something on tab1. Specifically, I have attributes on the main tab of the character sheet, Strength, Dexterity, etc. And then I have skills on the second tab of the character sheet. When I change the value of the dexterity on the main tab, then switch back to the skills tab, the original dex value is still being used instead of the new one. It only updates when I change something on the skills tab.

    I have the skills tab set up as a windowlist, with each skill being a 'window' inside the windowlist. The stat is being shown as part of the calculation for the roll inside the skill. I'm just trying to get the main tab to be able to call the update() function from the skills tab, but I can't seem to figure out how to access it.

    If I can't call the function from outside the scope of the tab, can I at least have it run when the player switches to that tab? I can only get it to run one time upon first opening the character sheet for the first time during the session, and after that it only runs when I actually update one of the values inside that tab.

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,402
    You're best doing things like this through the database. If the data in tab1 is tied to a database field (I assume it is) then make sure that the data in tab2 is tied to the same database field, then it'll be automatically updated.
    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!

  3. #3
    Thanks for your help! Unfortunately, the problem I have with using the same database field, is that each skill in the windowlist of tab2 uses a different ability. So I would have to dynamically create the source for the database fields in tab2 based on value of the 'statname' field. Is there a way to do this?

  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,402
    You can create a control (and assign it's source) using: https://fantasygroundsunity.atlassia...#createControl
    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!

  5. #5
    SOLVED!

    I tried creating the control dynamically, like you suggested with the createControl function. This worked exactly the same as before, and it would not update it's value when the original source node changed. It stayed at the value it was set to when created.

    However, after some more trial and error, I found that I could create six invisible fields inside tab2 with the same datasource as each of the stats (strength, dexterity, etc). These fields automatically updated when the original source nodes changed.
    This then allowed me to use the onValueChanged functions of those fields to update the relevant skills.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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