pete_smith1229 Posted October 1, 2022 Share Posted October 1, 2022 (edited) I've created a spell which executes the first effect. Is it possible for when the caster is suffering from fatigue, a second effect is cast? Using NI, I can get the second effect to happen for other conditions using the CAST SPELL ON CONDITION parameter by calling a second spell containing the second effect but I can't find an option for the second spell to trigger with the fatigue condition so I'm wondering if this is possible. Edited October 1, 2022 by pete_smith1229 Quote Link to comment
subtledoctor Posted October 1, 2022 Share Posted October 1, 2022 (edited) You need to add a line to SPLPROT.2da checking for the value you want* in the FATIGUE stat. Fatigue is stat #30 so: APPEND ~splprot.2da~ ~FATIGUE_OVER_xx%TAB%30%TAB%xx%TAB%4~ UNLESS ~FATIGUE_OVER_xx~ * I don't know what value constitutes "fatigued," maybe someone around here knows or you can find it on the internet? but once you know what value you want to use as your threshold, replace the three instances of "xx" in that line with your value. Then you need to figure out the line number of SPLPROT you added. This can be different in everyone's install, so you need to check in Weidu: COPY_EXISTING ~splprot.2da~ ~override~ COUNT_2DA_COLS cols READ_2DA_ENTRIES_NOW rows cols FOR (row = 1; row < rows; ++row) BEGIN READ_2DA_ENTRY_FORMER rows row 0 ~stat~ PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~FATIGUE_OVER_xx~) BEGIN SET fatigue_row = %row% END END BUT_ONLY (Note you need the same replacement for "xx" here.) That sets the “%fatigue_row%” variable to represent your fatigue threshold. Then you can add an effect to one spell, which conditionally casts a second spell when fatigue is equal to or greater than your desired value: COPY_EXISTING ~spell_1.spl~ ~override~ LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter2 = %fatigue_row% timing = 1 STR_VAR resource = ~spell_2~ END Edited October 1, 2022 by subtledoctor Quote Link to comment
pete_smith1229 Posted October 1, 2022 Author Share Posted October 1, 2022 @subtledoctor You've really helped me a lot lately and I appreciate it greatly, thank you. I'll follow your advice and see how far I get. There's a few threads in this forum which describe fatigue so I'll investigate and report back. Quote Link to comment
jastey Posted October 2, 2022 Share Posted October 2, 2022 I don't know whether this is relevant to this idea (I don't understand a word subtledoctor posted). Just a heads up that some mods, for example my "7th party member" NPC mods use fatigue for detection of whether the group rested. I.e. they check for fatigue = 0, do their things, wait 15-20 s and then increase fatigue by 1 if no other mod didn't do so already. Just to let you know that there is mods that tinker with the fatigue value (and also need fatigue = 0 after a rest for at least 15 s). Quote Link to comment
pete_smith1229 Posted October 2, 2022 Author Share Posted October 2, 2022 @jastey Thanks, I read some of the posts in your 7th member thread. I'm not running any other mods (I'm modding IW:EE so there's not many compared to BG:EE) so hopefully the fatigue variable won't be an issue (if I get it to work!). Quote Link to comment
pete_smith1229 Posted October 2, 2022 Author Share Posted October 2, 2022 (edited) According to the wiki, 7 seems to be the threshold value when a character suffers fatigue. @subtledoctor I replaced the "xx" with "7" and the script works absolutely perfectly. Thanks again! Edited October 2, 2022 by pete_smith1229 typo Quote Link to comment
subtledoctor Posted October 2, 2022 Share Posted October 2, 2022 Nice! And don't worry about compatibility, it won't be an issue unless you use this to detect fatigue = 0 in order to test for whether the party has rested. Now that you've got it working, the only thing I might suggest for compatibility would be to add your modder prefix to the "FATIGUE_OVER_7" phrase at the beginning of the line you add to SPLPROT.2da. E.g. I would personally make it "D5_FATIGUE_OVER_7"just to avoidany possible conflict if someone else adds a line with "FATIGUE_OVER_7." Granted the chance of that actually happening is extremely small...but adding a modder prefix makes it guaranteed safe. Quote Link to comment
pete_smith1229 Posted October 3, 2022 Author Share Posted October 3, 2022 @subtledoctor Ahhh, was too busy focused on my own mod and not taking into account other mods which may also change the same parameters. That's a great tip, thanks again! Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.