DICE PACKS BUNDLE
  1. #1

    Creating windowclass controls with script

    Hi again, I would like to add the individual armour locations I have to the character sheet xml. I was wondering if I can do this with lua. I have the armour items scripted to add armour locations and values to the character database nodes when it is equipped, then delete those locations and values when you unequip them. I would like to scan the armour locations node and then create a control to display the values on the character sheet. Sometimes there may be a value for something like "hand" and sometimes not so I would like to display only the ones that have values in them at the time. I don't want to load up the database node with useless entries or the character sheet with stuff that doesn't matter. This is why I would like to use lua to create the controls dynamically. I think I saw something like this when I was looking stuff up but I can't seem to find it now. Thanks for the help.

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,404
    For what you can do in FG LUA, look in the Developer API reference: https://www.fantasygrounds.com/refdoc/

    To look for what API methods might be available for what you'd like to do, think of the FG API in terms of objects and then reference the object where you want to do something against. In this case, you want to create a control in a window. In this case, you want to look at windowinstance - the instance of the window created from a windowclass: https://www.fantasygrounds.com/refdo...owinstance.xcp

    Then, you want to create a control, so look for something like createControl in the windowinstance interface: https://www.fantasygrounds.com/refdo...#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!

  3. #3
    In this case, I would probably just add all the controls onto the sheet in the correct positions, then show/hide them based on whether they are wearing the correct armor type. While it will create extra database nodes for each character, it seems like they would be manageable, and it would prevent having to dynamically add/remove controls.

    Regards,
    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 Product Walkthrough Playlist

Log in

Log in