5E Product Walkthrough Playlist
Page 1 of 2 12 Last
  1. #1

    Effects affecting the character sheet

    Hi

    I got very often the request for an effect changing the caster level in 3.5e/PF1 (in combination with my IFTAG operator to allow the change of the caster level just for specific spells, but that's less of a problem). But this would need a major rewrite of the code (I guess, but I may not see an easier solution (in sense of having an effect, inside the character sheet I may have an other idea)). I had the idea that such an effect could instead affect the CL number field in the character sheet forcing to update all the spell actions, then I would avoid a major rewrite of the existing code (I hope? ). But for this one would need to add update handlers to look at the effects of the corresponding entry in the CT (if added to the CT). Since I saw several times on the forum that someone asked about effects changing the numbers also in the character sheet, I wondered if someone tried to code something like this? I am worrying about performance when this is possible and so I wanted to ask first whether this idea is good or not

    Thanks in advance

    Have a nice and pleasant week

    Kelrugem
    Last edited by Kelrugem; December 4th, 2019 at 02:04.

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,404
    Effects inherently impact FG actions only. They don't change the base numbers in the character sheet - and this is by design.

    Effect code triggers when an action occurs (or less commonly, an event - such as ongoing damage). Therefore, the ode that checks for effects is in the action handler LUA scripts - the scripts\manager_action_XXXX.lua files.

    Like you say, trying to update directly in the character sheet can lead to issues - having event handlers, going against the usual effect process, overriding preset values, etc..

    So, if you want to have an effect that modifies the CL, then my recommendation would be to add effect code to the relevant action/s that it would impact (there are many examples of effect code in the manager_action_... files).
    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
    Quote Originally Posted by Trenloe View Post
    Effects inherently impact FG actions only. They don't change the base numbers in the character sheet - and this is by design.

    Effect code triggers when an action occurs (or less commonly, an event - such as ongoing damage). Therefore, the ode that checks for effects is in the action handler LUA scripts - the scripts\manager_action_XXXX.lua files.

    Like you say, trying to update directly in the character sheet can lead to issues - having event handlers, going against the usual effect process, overriding preset values, etc..

    So, if you want to have an effect that modifies the CL, then my recommendation would be to add effect code to the relevant action/s that it would impact (there are many examples of effect code in the manager_action_... files).
    thank you Yeah, that is what I suspected, thanks for confirmation I tried the way of having the effect in the relevant actions but that is not really possible for such an effect because the data about, how the CL influences the spell action (damage formulas and so on), are not saved in the actions themselves. They just get the result/outcome of the values depending on CL, so, it is like that the character sheet tells the spell actions which damage dice etc. one has but not how these were calculated (like I tell you my solution of some mathematical problem but not how I derived that). Therefore I would need to save all the formulas using CL in the action rolls, too, such that an effect could recalculate all the values depending on the CL That surely needs some work and therefore I was thinking about more elegant solutions and came up with the idea of changing the CL number field instead Sadly, this idea would surely be a dangerous one
    Last edited by Kelrugem; December 4th, 2019 at 14:02.

  4. #4
    Quote Originally Posted by Kelrugem View Post
    Hi

    I got very often the request for an effect changing the caster level in 3.5e/PF1 (in combination with my IFTAG operator to allow the change of the caster level just for specific spells, but that's less of a problem). But this would need a major rewrite of the code (I guess, but I may not see an easier solution (in sense of having an effect, inside the character sheet I may have an other idea)). I had the idea that such an effect could instead affect the CL number field in the character sheet forcing to update all the spell actions, then I would avoid a major rewrite of the existing code (I hope? ). But for this one would need to add update handlers to look at the effects of the corresponding entry in the CT (if added to the CT). Since I saw several times on the forum that someone asked about effects changing the numbers also in the character sheet, I wondered if someone tried to code something like this? I am worrying about performance when this is possible and so I wanted to ask first whether this idea is good or not

    Thanks in advance

    Have a nice and pleasant week

    Kelrugem
    Actually, I did just this... well, tweaking the level to cast. It's a "ARCANE:X", "DIVINE:X" or "CLASSNAME:X" effect that is applied. Then in the spell damage/duration it calculates the damage/duration with those adjustments.

    Honestly, it doesn't require much work to do (for the CoreRPG/5e style effects) and if the PF stuff works the same then it should be pretty easy.

    Code:
      -- get sSpellType "ARCANE: X" effect modifier
      local aAddDice, nAddMod, nEffectCount = EffectManager5E.getEffectsBonus(rActor, {sSpellType:upper()}, false);
      if nEffectCount > 0 then
        local nAddTotal = StringManager.evalDice(aAddDice, nAddMod);
        nCasterLevel = nCasterLevel + nAddTotal;
      end
    Last edited by celestian; December 4th, 2019 at 15:18.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  5. #5
    Quote Originally Posted by celestian View Post
    Actually, I did just this... well, tweaking the level to cast. It's a "ARCANE:X", "DIVINE:X" or "CLASSNAME:X" effect that is applied. Then in the spell damage/duration it calculates the damage/duration with those adjustments.

    Honestly, it doesn't require much work to do (for the CoreRPG/5e style effects) and if the PF stuff works the same then it should be the same.

    Code:
      -- get sSpellType "ARCANE: X" effect modifier
      local aAddDice, nAddMod, nEffectCount = EffectManager5E.getEffectsBonus(rActor, {sSpellType:upper()}, false);
      if nEffectCount > 0 then
        local nAddTotal = StringManager.evalDice(aAddDice, nAddMod);
        nCasterLevel = nCasterLevel + nAddTotal;
      end
    Yes, but I may have to look again at the code (at the moment I was just brainstorming) In 3.5e/PF1 you have CL dependencies like "every third CL", "every odd/even CL" and so on for damage/heal dice, duration, save DC and so on (and sometimes there is also a cap for the allowed CL for the specific damage/duration etc.), at least these informations I have to save in the action, too, such that the CL adjustment coming from an effect is correctly accounted These informations are "saved in the character sheet" but in the codes of the actions themselves one only get the "results from the character sheet" about the duration etc.

    Thanks a lot It may be indeed less cumbersome than I imagine at the moment
    Last edited by Kelrugem; December 4th, 2019 at 15:29.

  6. #6
    Quote Originally Posted by Kelrugem View Post
    Yes, but I may have to look again at the code (at the moment I was just brainstorming) In 3.5e/PF1 you have CL dependencies like "every third CL", "every odd/even CL" and so on for damage/heal dice, duration, save DC and so on (and sometimes there is also a cap for the allowed CL for the specific damage/duration etc.), at least these informations I have to save in the action, too, such that the CL adjustment coming from an effect is correctly accounted

    Thanks a lot It may be indeed less cumbersome than I imagine at the moment
    You mean something like this? (this guy is a level 1 caster with fireball, yeah, just an example, normally he'd not get it till 5th and it would be 5d6 minimum)



    To be fair, since I already had caster level damage and duration (I've the same thing in duration) the effect level modification was easier. If PF doesn't already have that then you'd need to add that as well.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  7. #7
    Quote Originally Posted by celestian View Post
    You mean something like this? (this guy is a level 1 caster with fireball, yeah, just an example, normally he'd not get it till 5th and it would be 5d6 minimum)



    To be fair, since I already had caster level damage and duration (I've the same thing in duration) the effect level modification was easier. If PF doesn't already have that then you'd need to add that as well.
    hm, okay, this looks very similar to 3.5/PF1 So, I now have to revisit the code, hopefully I just misunderstood something and, at the end, everything is much easier than I thought. Thanks a lot, I appreciate it
    Last edited by Kelrugem; December 4th, 2019 at 15:43.

  8. #8
    Quote Originally Posted by Kelrugem View Post
    hm, okay, this looks very similar to 3.5/PF1 So, I now have to revisit the code, hopefully I just misunderstood something and, at the end, everything is much easier than I thought. Thanks a lot, I appreciate it
    I thought PF had it... it's actually where I got the idea on how/where to add it in the menu system. 5E doesn't.

    Look where you use the "level" for "caster level" and replace that with a variable/function where you calculate the caster's level for all adjustments.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  9. #9
    Quote Originally Posted by celestian View Post
    I thought PF had it... it's actually where I got the idea on how/where to add it in the menu system. 5E doesn't.

    Look where you use the "level" for "caster level" and replace that with a variable/function where you calculate the caster's level for all adjustments.
    thanks, I'll try that

  10. #10
    oki, tried it; in manager_spell.lua is the CL often used for defining damage dice etc.. What I thought is: When I click the damage button then the code will not run through manager_spell again to parse the damage dice, but actually this is what happens and therefore my effect worked Thanks for that, I always thought that the code for the spell parsing/definitions is not ran again when pressing the spell buttons and therefore I didn't see how one can affect the code with such an effect So, my problem was due to a wrong assumption on my side

    The only (very little) problem is the spell displays in the action tab then, the effect is not affecting them of course, but when I force an update of the spell actions (by changing the CL in the sheet or adding/changing existing damage buttons or whatever) then the displays take the effects into account which could lead to confusion in certain situations (though I now accidentally coded some sort of effect which affects the sheet without any other problems so far... )

    Is just a display problem, so not really important because the automation of damage etc. is not affected, but I want to fix this

    Thanks a lot I should simply test a bit more and not make wrong assumptions

    EDIT: oh, and testing very high numbers of CL results into an error when there are then more physical dice than FGC can show (seems to be a problem with FG itself, not with the extension)
    Last edited by Kelrugem; December 4th, 2019 at 17:30.

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 Character Create Playlist

Log in

Log in