5E Character Create Playlist
Page 2 of 2 First 12
  1. #11
    You would have to check each step in the chain to be sure. (i.e. check ModifierStack, then ModifierStack.control, then ...)

    However, I believe in this case that the modifier stack is actually a control that is not tied to the database. (i.e. the stack does not need to be remembered between sessions.) Thus, the getDatabaseNode() call would return a nil value.

    I had assumed that you were modifying that character sheet or combat tracker, in which all numerical and non-label string fields are tied to the database.

    Perhaps you can give me an overview of what you are trying to accomplish exactly, and I can give you a better answer.

    Regards,
    JPG

  2. #12
    *facepalms* I'll bet you are exactly right.

    What I'm doing is building a means of allowing my diepool code to recognize when the modstack code has changed it's value.
    • Trying to find a community Ruleset, Extension or Information on how to complete a process? Try FGRepository.
    • PM Myself if you have new or updated community Rulesets, Extensions or Information that you'd like added to FGRepository.

  3. #13
    In that case, you will need both the modifier stack and the dice pool to be global scripts, which can be accessed from anywhere inside the LUA code.

    In most rulesets, this has already been done with the modifier stack (i.e. ModifierStack). You would just need to do it for the die pool management. Then, you would need to add an onValueChanged event handler in the relevant modifier stack control, which in turn would call the correct die pool manager code function.

    Cheers,
    JPG

  4. #14
    Ok. I'm almost entirely there. But I've run into a snag. There are multiple controls that need to be updated. Unfortunately the registerControl() function when used on the control itself doesn't work because it only registers the last control. And setting it on the underlying window would work, but then I'd have to create a list of all of the low and high pools on the entire sheet so that it can properly loop through and updated them each time. That just doesn't seem efficient to me.

    Any thoughts on a good solution?
    • Trying to find a community Ruleset, Extension or Information on how to complete a process? Try FGRepository.
    • PM Myself if you have new or updated community Rulesets, Extensions or Information that you'd like added to FGRepository.

  5. #15
    Modify the registerControl function so that it adds the control to a Lua table, and then iterate over that table whenever the value changes?

  6. #16
    BTW Happy Christmas!

  7. #17
    Ooo. Thats an excellent idea!

    Merry Christmas!
    • Trying to find a community Ruleset, Extension or Information on how to complete a process? Try FGRepository.
    • PM Myself if you have new or updated community Rulesets, Extensions or Information that you'd like added to FGRepository.

  8. #18
    That idea worked perfectly. Thank you Stuart.
    • Trying to find a community Ruleset, Extension or Information on how to complete a process? Try FGRepository.
    • PM Myself if you have new or updated community Rulesets, Extensions or Information that you'd like added to FGRepository.

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
  •  
STAR TREK 2d20

Log in

Log in