It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
avatar
Engerek01: ###### STEPS TO ENABLE ROD OF FAST BUFFING FOR OFFICIAL CAMPAIGNS #######

Using this mod turned out to be rather complicated for official campaigns so I'll try to make it as simple as possible. The problem arise because you have to enable Tag-Based Scripting in a Module. Here I will write down what I did.

1. Go to the vault and download the "Rod of Fast Bugging (extended rod of fast buffing)"
https://neverwintervault.org/project/nwn1/prefab/item/rod-fast-buffing

2. Unzip the file and copy "extrodfastcast.erf" into the "erf" folder inside NWN installation directory.

3.Open nwnplayer.ini
add those under [Game Options]. I am not sure if this step is necessary but I read that this enables to modify original campaigns.

CODEWORD=hacktastic
CODEWORD XP1=ffrodriguez
CODEWORD XP2=barkeater

4.I suggest taking backup of the entire "nwm" folder. We are going to have to modify every official campaign.

5. Open the toolset (nwtoolset.exe inside the installation folder) and click "open an existing module"

6. From the window select "Campaign Modules" on the lower part and select chapter you wish to modify (you took backup of the nwn folder right?) I will select "chapter1" now.

7. It will probably give a warning about "requiring expansions". Click YES.

8. Once the module is done loading, select "File>>Import" and select "extrodfastcast.erf" inside the erf folder. Click ok. This will make both the item and the script part of the module.

Save the module but unfortunately we are not done yet. We have to enable "Tag-Based Scripting" for the Module.

9. Still in the toolset EDIT>> Module Properties>> Events

There are 2 events that we need to change.

OnActivateItem ---> x2_mod_def_act
OnModuleLoad ---> x2_mod_def_load

OnModuleLoad will be probably empty but OnActiveItem is a problem since it already has a script called "m1_itemact" there. That's why we are going to write a custom script that loads both.

Take a note of what is written beside OnActiveItem and close without saving.

10. On the left side you will see "Scripts". Right click it and select "New"

11. The script editor will open. Fill it like this. (ignore the ---- parts)

--------- SCRIPT For Chapter 1--------------
void main()
{
ExecuteScript("m1_itemact", OBJECT_SELF);
ExecuteScript("x2_mod_def_act", OBJECT_SELF);
}

--------- SCRIPT For Chapter 1E--------------
void main()
{
ExecuteScript("m1q6moduleit", OBJECT_SELF);
ExecuteScript("x2_mod_def_act", OBJECT_SELF);
}

--------- SCRIPT For Chapter 2--------------
void main()
{
ExecuteScript("m2activated", OBJECT_SELF);
ExecuteScript("x2_mod_def_act", OBJECT_SELF);
}

--------- SCRIPT For Chapter 2E--------------
void main()
{
ExecuteScript("m2qe_moduleact", OBJECT_SELF);
ExecuteScript("x2_mod_def_act", OBJECT_SELF);
}

--------- SCRIPT For Chapter 2E (for OnModuleLoad save as custom_rofb2)--------------
void main()
{
ExecuteScript("m2qe_aarinto2", OBJECT_SELF);
ExecuteScript("x2_mod_def_load", OBJECT_SELF);
}

--------- SCRIPT For Chapter 3--------------
void main()
{
ExecuteScript("m3q1modactivat", OBJECT_SELF);
ExecuteScript("x2_mod_def_act", OBJECT_SELF);
}

--------- SCRIPT For Chapter 4--------------
void main()
{
ExecuteScript("m4_recall", OBJECT_SELF);
ExecuteScript("x2_mod_def_act", OBJECT_SELF);
}
--------- SCRIPT END --------------

I saved my scripts as "custom_rofb" as in Custom for Rod Of Fast Buffing. You may need to click "Save and Compile" if it has not done so automatically. You can use the same name for your script for all campaigns because modules are independent from each other. Exit the script.

12. To return to events "EDIT>> Module Properties>> Events" and change those keys respectively.

OnActivateItem ---> custom_rofb (that's the one we made)
OnModuleLoad ---> x2_mod_def_load (custom_rofb2 for Chapter2E)

easier way is to click v icon near the key and type a few words so you can select the script with mouse click.

13. Save the module and do steps 6-12 for all chapters.

NOTE: If you are in the middle of a game, skip to step 15 to learn how to modify your save file. You can start a new game as in Step 14 just to make sure you have done fine so far.

14. Start NWN and start a new game. You will need to use the console to spawn the item. This will spawn the item at your mouse cursor. You can have as many as you like.
Codes directly from chat (without opening console)
##DebugMode 1
##dm_spawnitem extrodfastcast
##DebugMode 0

Now you can pick it up and cast your defensive spells on it. It will cast those spells at once when you use it. Note that the rod can only be used at yourself and your familiar (or henchmen?) so even if you can put fireballs in it, it won't target anyone else.

15. If you started a new game, you can skip that part. However, If you want to implement the item to an existing save, you have to modify the save file first. If you don't, you can still spawn the rod but will get a "*Failure, the object is not a valid target for this spell*" error message.

I used Leto-1.69 program for editing the save file.

Make a backup of your save that you will edit.
Start Leto.
Menu>>File>>Open
Change "Files of Type" to "package files"
Navigate to your "saves" folder under NWN open the .sav file for the save you want to edit.
In the "Select Resource" page, go down and select "Module IFO"

Your character's Name etc will appear on the screen.

Menu>>Tools>>Advanced Editor.
Again go all the way down and select "Module IFO"

Mod_OnActivtItem --> custom_rofb (or whatever you named your custom script)
Mod_OnModLoad --> x2_mod_def_load (custom_rofb2 for chapter2E, or whatever you named it)

Find those keys and change respectively. You can do this by first selecting the key and then double clicking the Value. (Right Click-->Edit Value works too)

Once you are done, CTRL+S to save. and click OK on the popup window.
Once again change "save as type" to "Into package file" and then choose the .sav file you opened earlier. Click Save and click YES for the warning.
Go all the way down and select "Module Info" and press OK to finalize the save.

Close every page. Now you are ready to go back to step 14 and use the info there to spawn your rod of fast cast.

That was easy right?
Enjoy :)))
That is the most complete explanation of how to enable tag based scripting I have ever read. :)

(You can skip the codeword parts by copying the .nwm files over to the module folder and renaming them .mod. That way, when you auto update, your work won't be overwritten by the originals (if indeed, that is how GOG updates work.))

Have fun :)




avatar
Engerek01: ###### STEPS TO ENABLE ROD OF FAST BUFFING FOR OFFICIAL CAMPAIGNS #######

Using this mod turned out to be rather complicated for official campaigns so I'll try to make it as simple as possible. The problem arise because you have to enable Tag-Based Scripting in a Module. Here I will write down what I did.
avatar
tristanlist: Yeah, um. I didn't even suggest adding scripts to every module because I figured you wanted something easy.

To do it with scripts you don't even need a rod of fast buffing. Modules listen to the chat while you play, so you can add a script to the OnPlayerChat event in the module properties. It will hear shouts and act accordingly (such as adding a list of legit spellcasts to your action queue).

Your character can just yell something like "squee" and

void main()
{
string sMsg = GetPCChatMessage();
if (sMsg == "squee")
{
object oPC = GetPCChatSpeaker();
object oFam = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oPC);
AssignCommand(oPC, ActionCastSpellAtObject(102, oPC));
AssignCommand(oPC, ActionCastSpellAtObject(172, oPC));
if (oFam != OBJECT_INVALID)
{
AssignCommand(oPC, ActionCastSpellAtObject(102, oFam));
AssignCommand(oPC, ActionCastSpellAtObject(172, oFam));
}
}
}
avatar
tristanlist: in this case cast mage and stoneskin on you and your familiar if it's there.
That is also an elegant solution, with a little forethought as to which spells you might want to cast. Could you point us to an easily accessible spell id list?

Have fun :)
Post edited September 30, 2019 by shia_luck
avatar
shia_luck: That is also an elegant solution, with a little forethought as to which spells you might want to cast. Could you point us to an easily accessible spell id list?

Have fun :)
Since then I had been messing around with the issue, because it would be interesting to make a script that parses the chatline to get whatever spells. This way, you can use a custom shout macro like the OP originally suggested, making it quick to execute. I seem to have managed to write something somewhat useful with about 80 lines of script.

As above this script goes in the OnPlayerChat event handler in module properties.

You give a trigger phrase (I have it as "Buffs-") followed by the Spell ID's you want to cast separated by spaces. you can add letters before or after the spellid:
x - extend spell (meta magic)
g - cast it at the ground
h - cast the spell on each henchman
f - cast on familiar
a - cast on animal companion
s - cast on preexisting summoned creature (note summons created by the shout don't exist to be targeted yet)

<<Updated Pastebin >>
changed it to read forwards and be slightly less stupid about reading the id numbers

The only particular inconvenience with this system (besides having to add a script to a module) is having to look up the spell IDs. There is one at the lexicon site [url=https://nwnlexicon.com/index.php?title=Spell_(constant_group)]here[/url]

Downloading the 12 meg offline version of the NWN script lexicon is highly recommended though.

pic related is an example
Buffs- 88f 134 524x 47x 542s
Casts Flameblade on summon
(Extended) Elemental Shield
(Extended) Acid Sheath
Premonition
Improved Invisibility on familiar
Attachments:
Post edited October 01, 2019 by tristanlist
That's very interesting :) While there is the drawback of having to attach/import a script, (this isn't something that could work from the override. is it?), doing that is a lot easier than making a module tag based friendly, in my mind at least. With macros from a keyboard the ingame typing is as easy as Loudent's Rod.

One issue might be, you have two henchies, one ranged, one melee, and you want to give one of them flame weapon. Could there be a way to distinguish between henchies? Or does the game not track them individually?

Thank you for the script :)

Have fun :)
avatar
shia_luck: That's very interesting :) While there is the drawback of having to attach/import a script, (this isn't something that could work from the override. is it?), doing that is a lot easier than making a module tag based friendly, in my mind at least. With macros from a keyboard the ingame typing is as easy as Loudent's Rod.
Yeah in fact the OP was referring to NWN's built-in macro texter. All you have to do is bind one of your magic slots to shout the line.

I investigated the possibility of making an override, which yes, would be the easiest possible implementation, but I cannot think of an override that would nest itself in the OnPlayerChat handler everywhere. This event is defined (usually left blank) for each module separately, but the relevant properties file packed in the module file has a generic name, module.ifo. Theoretically this means posting a new version of 'module.ifo' in the override directory will simply wreck every module you play, erasing starting coordinates, area lists, etc., if it is read from that location at all. It probably isn't.

But if scripts can be read from override (no experience with that) another approach might be default.nss. If you were to put a script named DEFAULT.NSS in the override directory it might execute itself on every PC heartbeat (6s) no matter what module. The script I wrote would have to be reworked to grab chatter from between heartbeats, though, and ugh.



avatar
shia_luck: One issue might be, you have two henchies, one ranged, one melee, and you want to give one of them flame weapon. Could there be a way to distinguish between henchies? Or does the game not track them individually?

Thank you for the script :)

Have fun :)
A few extra script lines and more elaborate player shout would do this. Will update the pastebin if gumption thresholds are met.
avatar
shia_luck: That's very interesting :) While there is the drawback of having to attach/import a script, (this isn't something that could work from the override. is it?), doing that is a lot easier than making a module tag based friendly, in my mind at least. With macros from a keyboard the ingame typing is as easy as Loudent's Rod.
avatar
tristanlist: Yeah in fact the OP was referring to NWN's built-in macro texter. All you have to do is bind one of your magic slots to shout the line.

I investigated the possibility of making an override, which yes, would be the easiest possible implementation, but I cannot think of an override that would nest itself in the OnPlayerChat handler everywhere. This event is defined (usually left blank) for each module separately, but the relevant properties file packed in the module file has a generic name, module.ifo. Theoretically this means posting a new version of 'module.ifo' in the override directory will simply wreck every module you play, erasing starting coordinates, area lists, etc., if it is read from that location at all. It probably isn't.

But if scripts can be read from override (no experience with that) another approach might be default.nss. If you were to put a script named DEFAULT.NSS in the override directory it might execute itself on every PC heartbeat (6s) no matter what module. The script I wrote would have to be reworked to grab chatter from between heartbeats, though, and ugh.

avatar
shia_luck: One issue might be, you have two henchies, one ranged, one melee, and you want to give one of them flame weapon. Could there be a way to distinguish between henchies? Or does the game not track them individually?

Thank you for the script :)

Have fun :)
avatar
tristanlist: A few extra script lines and more elaborate player shout would do this. Will update the pastebin if gumption thresholds are met.
Thanks for the reply. I don't know about scripts in override. And tbh, for different henchies it will only probably be one spell you would have to cast normally, so it's not a big issue at all.

Have fun :)