5E Character Create Playlist
  1. #1

    Spell Slot "Check/Uncheck" posting to Chat Window?

    Hello, I have been using FG for a bit over a year and have a small question concerning coding.

    I am using the 5e Ruleset and am trying to figure out how to have Spell Slot Bubble activity reported in the Chat window.

    This is currently being accomplished with Powers like Ki and Sorc Points, and would be helpful to the DM if Spell Slot usage could be reported.

    I have attempted to locate exactly where the code is that toggles these slots, but have not been successful.

    Can one of you learned individuals point me to the .lau file(s)?

  2. #2
    The PC data for spell slots is stored at "charsheet.*.powermeta.spellslots#.max", where * is the character ID and # is the spell level. The display of the slots is managed by power_slots_cast and power_slots_prep window classes in campaign/record_power.xml.

    The counter does trigger an onValueChanged call you can use when it is changed, but it doesn't tell you whether it's going down or up. If all you care about is "change" events, then the easiest way is to add an onValueChanged trigger to "counter" control in "power_slot_cast" window class. Alternately, you could have a global script that monitors "charsheet.*.powermeta.spellslots1.max", "charsheet.*.powermeta.spellslots2.max", etc. for onUpdate events, and reports to chat window.

    If you need to know which direction the field is going based on their clicks, you would need a different approach. I would probably just repurpose the code for the individual power counters you are using for Ki/Sorcery points. Those use a special template named "counter_power". You might be able to redefine "power_slot_cast" window class with a new "counter" control that uses a new control template made by copying and customizing the "counter_power" template/script.

    Regards,
    JPG

  3. #3
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,685
    Blog Entries
    1
    Start with something you know.
    Find a word(s) or graphic that is used there and is not too common.
    Do a Find in Files search.
    Follow the results.
    Possibly leading to more Find in Files searches.
    You will find your answer.

  4. #4
    Thank you Moon Wizard for the detailed guidance.
    After spending a just a couple of days exploring and testing, I settled on 'POWER_PAGE.lau' and
    succeeded in causing chat entries to be posted whenever a PC is checking and un-checking spell slots,
    further identifying their Level and the user doing it.

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