ROTOFire 0 Posted January 28, 2017 Hey all, I've been toying with the idea of making Grenade Save DC scale off the user's attributes, like force powers do. (5+level+relevant att mod). I was thinking intelligence? Anyway, in looking through the utis for the grenades, it looks like the DC is set in the script for the grenade. I found the source script in KT, and in looking at the grenade script, I can see where the DC is established. My question comes in here: What, if anything, is safe to mess with in these scripts? If I copy the whole script into something like notepad, and save it differently, can I edit it and put it back later? Do I have to put something in the override? And if I compile the new script will it overwrite the grenade script in the compiled script section? or do I have to overwrite that one separately? Sorry for the barrage....I know just enough programming to be dangerous messing around, but not enough to fix whatever I break Quote Share this post Link to post Share on other sites
CrashBandiTeam 18 Posted January 28, 2017 I know just enough programming to be dangerous messing around, but not enough to fix whatever I break Just Backup your stuff before break it just a tip before modding anything! 2 Quote Share this post Link to post Share on other sites
Hassat Hunter 571 Posted January 28, 2017 Depends... is it an k_inc_ file (IIRC it is?) then you need to recompile every single script that has that as #include to actually make your changes. 1 Quote Share this post Link to post Share on other sites
ROTOFire 0 Posted January 28, 2017 Depends... is it an k_inc_ file (IIRC it is?) then you need to recompile every single script that has that as #include to actually make your changes. Is there a way to do this all at once? Quote Share this post Link to post Share on other sites
Hassat Hunter 571 Posted January 28, 2017 Make a text, copy @echo off nwnnsscomp -c -g 2 *.nss pause rename it compile.bat, put in with nwnnsscomp.exe in a folder with the scripts and hit it. Quote Share this post Link to post Share on other sites
bead-v 251 Posted January 28, 2017 Maybe this will be a little TMI, but I guess it can't hurt.Grenades (and rockets, darts, powers, ..) are treated as "spells" by the game. As such you can find them in spells.2da. One of the collumns is 'impactscript', the script that fires when the spell hits. For grenades it's set to 'k_sup_grenade'. So that is the script the game fires when the grenade hits. So for every spell you want to change, check spells.2da and modify the scripts that are listed there. The game always has access to the original (global) scripts. If you export (ie copy) it, change, compile, then add it to the override, the game will use the script in the override instead. But if you remove it from the override, it will go back to using the original one. In your case, all you need to do is edit k_sup_grenade.nss, compile it to .ncs and put that into the override. Quote Share this post Link to post Share on other sites
Kexikus 994 Posted January 28, 2017 Depends... is it an k_inc_ file (IIRC it is?) then you need to recompile every single script that has that as #include to actually make your changes. Actually, he only has to compile every script that uses the edited part of the k_inc_file. That may be every single one of them, but it doesn't have to be, right? 1 Quote Share this post Link to post Share on other sites
ROTOFire 0 Posted January 28, 2017 Maybe this will be a little TMI, but I guess it can't hurt. Grenades (and rockets, darts, powers, ..) are treated as "spells" by the game. As such you can find them in spells.2da. One of the collumns is 'impactscript', the script that fires when the spell hits. For grenades it's set to 'k_sup_grenade'. So that is the script the game fires when the grenade hits. So for every spell you want to change, check spells.2da and modify the scripts that are listed there. The game always has access to the original (global) scripts. If you export (ie copy) it, change, compile, then add it to the override, the game will use the script in the override instead. But if you remove it from the override, it will go back to using the original one. In your case, all you need to do is edit k_sup_grenade.nss, compile it to .ncs and put that into the override. I had found the sup_grenade script. It is nice to know that I only need to re-compile that one, though. On another note, in the inc_force file, it looks like the save dc for force powers is set by something called "GetSpellSaveDC." so, something within that finds the relevant attribute/level of the user and returns the DC. I can't find the code inside GetSpellSaveDC, so I'm just trying things elsewhere. My though was to do something like this: DC = 5 + (get user level (hitdice)) + get user intmod. I don't know the syntax to accomplish those 2 things though, so maybe someone else does. Thanks for the help everyone! Quote Share this post Link to post Share on other sites
bead-v 251 Posted January 28, 2017 If you open up KT's Text Editor, then Script -> Script is for KotOR II, the type the function into the function filter, you get this: // 111: Get the DC to save against for a spell (5 + spell level + CHA Mod + WIS Mod). I think you'll need these functions: GetAbilityModifier() GetHitDice() Use the function filter and explore a little Quote Share this post Link to post Share on other sites