Cure Potions

Discussion in 'General Modification' started by Rudy, Feb 19, 2013.

Remove all ads!
  1. Rudy

    Rudy Established Member

    Joined:
    Jan 30, 2005
    Messages:
    345
    Likes Received:
    2
    Re: Creating a Spell Spreadsheet

    Does editing the source files in that folder actually have an in-game result? Don't they need to be recompiled or something? I'm not sure how to go about that.
     
  2. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Re: Creating a Spell Spreadsheet

    Yes, everything in ToEE is in override mode. If you're getting the files from data/scr (presumably) from within your game installation, i.e. the modded files, then you need only edit them and then test in-game. If you're getting them from the dats, i.e. files that haven't been modded yet, then you need to copy those files from the dats into your ToEE installation and then edit them and then test in-game. CLW I see is already among the modded files, so just edit it, save, and test.

    TFE-X is set by default to delete all combined script files upon launch, forcing the game to recombine them as necessary with each go, so don't worry about the changes not showing up.
     
  3. Rudy

    Rudy Established Member

    Joined:
    Jan 30, 2005
    Messages:
    345
    Likes Received:
    2
    Re: Creating a Spell Spreadsheet

    Oh, cool! Ok, I shall go testing away.
     
  4. Rudy

    Rudy Established Member

    Joined:
    Jan 30, 2005
    Messages:
    345
    Likes Received:
    2
    Re: Creating a Spell Spreadsheet

    Ok, there's good news and bad news.

    The good news is that I was right about that command in the code being the source of the problem for healing potions and scrolls.

    Changing it to "spell.caster_level" DOES make potions correctly access the caster level of the potion itself, rather than the caster level of the user, which was zero (the default casting class for a potion was domain_special, so all PCs had a caster level of zero for it).

    The further good news is that this ALSO resolves the problems with the healing domain, both making domain healing spells add caster level correctly (rather than being cast at caster level zero), and actually adding the domain bonus of +1 caster level bonus to healing spells. (If you wish, I can explain why this fixed this problem as well, but it's a bit wordy)

    The bad news doesn't have to do with healing potions directly, but potions in general.

    So, a little background is necessary: the caster level specified in protos.tab for items is only the default; this would be what the item would be created with if you created it via the console, for example. So, potions of cure light wounds have a default caster level of 1, "'Cure Light Wounds' domain_special 1". If you create them via the console, they will now correctly heal between 2 and 9 hp (with the code change I made).

    However, the caster level of potions is set based on the creator's caster level. If I have my 5th level cleric create a potion of cure light wounds, it will be created at caster level 5, so that it will now heal between 6 and 13 hit points. (For whatever strange reason, caster level of items only increases in odd increments: a 4th level cleric creates a level 3 cure light wounds potion).

    This applies to all potions, not just cure ones. It wouldn't be a problem, except that potions are *supposed* to get more expensive if you create them at a higher caster level. As it is, if my 15th level wizard creates a potion of Enlarge person, it will last for 15minutes, but cost as much as a 1st level potion would. This seems to be a core engine issue, and I'm not sure it's fixable. It's not a disastrous problem, it simply means that high level casters can create powerful potions for far less gold/exp than they should be able to.

    The same thing goes for scrolls: the caster level increases with the creator, which is fine, but the cost does not, which is not fine.

    The further annoyance is that cure light wounds potions of different caster levels will stack in your inventory. I don't know what happens in this case. ???

    Finally, I don't have an answer as to what was causing the occasional rare 13hp healing from a cure light wounds potion, but I do know it never occurred with crafted potions. So, my suspicion is that some of the found healing potions that occasionally healed more had some strange variable set. It would be very difficult to test.

    In short, the code change I suggested SHOULD be done as it resolves many issues without introducing new ones. I'll think about if there is any way to increase the cost of potions/scrolls with their caster level, but I don't see much hope of that.

    The alternative, of course, would be to force scrolls/potions to be created at minimum caster level, but this would involve getting at the part of the code that actually creates the item, and I don't think that's feasible.

    EDIT: The upside to the downside is that this mitigates the issue of wizards being able to scribe scrolls at a lower level that they can cast them at: if my 3rd level wizard scribes a scroll of fireball, it will only do 3d6 damage.
     
  5. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Re: Creating a Spell Spreadsheet

    Interesting ... we'll have to think about that.
     
  6. Gehennis

    Gehennis Established Member

    Joined:
    Sep 15, 2012
    Messages:
    685
    Likes Received:
    15
    Re: Creating a Spell Spreadsheet

    All I know sir is that you're giving me more things to play with- thank you! :thumbsup:
     
  7. Daryk

    Daryk Veteran Member

    Joined:
    Jan 14, 2012
    Messages:
    1,177
    Likes Received:
    34
    Re: Creating a Spell Spreadsheet

    Great work, Rudy! I agree your code change should be implemented. Given the limited scaling available to potions, I don't think it will introduce a game breaking imbalance. Sure, it will be an exploit, but one of limited impact.
     
  8. Rudy

    Rudy Established Member

    Joined:
    Jan 30, 2005
    Messages:
    345
    Likes Received:
    2
    Re: Creating a Spell Spreadsheet

    So, I successfully extracted the files (I was actually able to extract only ToEE4), and came across something rather curious: The cure spells from the DAT file all use spell.caster_level. Which implies that for some reason somewhere along the lines this mod made the change to cure spells so that they used the caster level of the item user, rather than the caster level of the item. (Mind you, the vast majority of spells still correctly use spell.caster_level, so this was a change made selectively to cure spells).

    Any idea why that change might have been made, or by whom? The only rationale I can come up with is that someone thought it was better to have the potions all at caster level zero than to have them at a caster level that scaled with the potion creator. In that case, though, it would be odd that they only did it to cure potions.
     
  9. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Re: Creating a Spell Spreadsheet

    Well I can't find any reference to it in all the release notes. That's one unfortunate thing about much of our work here - poor documentation.

    We'll have to have another think about that. Maybe when Ted gets back he can shine some light on it (heh, pun). The thing that stands out however is that most all of the modders gone by were very intelligent people and didn't do thinks randomly or for bogus reasons, so that makes me think there's a good reason for it to be that way. I've never been a spells guy though so I have no idea what it might be.
     
  10. Rudy

    Rudy Established Member

    Joined:
    Jan 30, 2005
    Messages:
    345
    Likes Received:
    2
    Re: Creating a Spell Spreadsheet

    Ok; that makes sense. My core suspicion is that someone thought that it was better to have cure potions with caster level zero than have them with a caster level scaling with the creator: in other words, better that they be underpowered than overpowered. This is bourne out by the fact that whoever did it left Cure Critical Wounds alone, perhaps thinking that making the bonus on the 4th level spell zero was a bit too much of a nerf. Nonetheless, I agree with at least waiting to hear from Ted. If you end up not wanting to make the change then I'll probably still provide the edited spell files for whomever wants them.
     
  11. hellblazer

    hellblazer Established Member

    Joined:
    Feb 27, 2006
    Messages:
    227
    Likes Received:
    0
    Did we ever find out which file Rudy is talking about?
     
  12. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Doing a little research on this, this change was introduced between 3.0.4 and 4.0.0, most likely in Livonya's mod.

    Evidence*:
    - there was no file for Cure X Wounds in 3.0.4
    - Livonya's Mod 1.5 included the "new" version
    - The cure files' "last modified" attributes are Jan 23rd & March 24th 2005, which (a) predate Darmagon's work on Cure Moderate Wounds (July 23rd) and (b) are contemporary with Livonya's activity on her mod.

    Furthermore, it appears to be identical to the pre-troika patch version (i.e. what's found in ToEE3.dat and not ToEE4.dat), other than additional scripting for giving NPCs caster levels for potion drinking purposes.

    My guess is that it's just an accidental revert to the vanilla file, or perhaps to one of the earlier mod versions (I have seen a complaint about this in Oct 2003), I have seen no other reason specified for it.

    * note - not trying to get a conviction or anything ;) just trying to track down the origins of this controversial yet undocumented change

    ----------------

    Bottom line is that the suggested change is likely to be beneficial, at least in solving the 1HP bug. Thanks to gazra and grinner666 (and other past members) for bringing this to attention.

    Also, in case someone should advocate keeping it as is, I should also note that newly brewed potions have the Cleric Domain, not Domain Special. (this may be overridden when stacked with previous potions; I'm just pointing out that the current situation is not perfect in terms of the above stated intentions)

    Furthermore, as pointed out above, it is buggy in that casting a Heal spell from the Domain radial selection can result in errors. This is because spell.caster_class can return gibberish sometimes (when such a casting is made), thus yielding a gibberish number (negative at times), which results in 0 bonus.
     
    Last edited: May 31, 2014
Our Host!