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

×
I am playing Neverwinter Nights (1) Diamond Edition.

https://nwn.fandom.com/wiki/Custom_text_macro

As it says here, that function is only to write custom text but it also mentions it is possible to use console commands if you start with ##.

I am playing a sorcerer and I want to click a button and it will cast
1. Mage armor on me
2. Stoneskin for me
3. Mage armor for my familiar (pixie)
4. Stoneskin for my familiar.

I was wondering if anyone here knows a way to do that.

Thanks in advance.
Engin.

EDIT: For solution, go to this post
Post edited September 25, 2019 by Engerek01
No unfortunately there's no console command that can add things to the action queu. I am pretty lazy myself and use autohotkey to buff. Bind the spells as normal to ctrl/shift/F1-F12, and it's very easy to make a script that does those key presses and clicks on portraits for targeting.
You could use something like this Rod of Fast Buffing (thanks to Sknymick on the NWN forums for helping me find it!). It's a bit basic, I've seen more elaborate fast buff items, but I can't find them at the Vault at the moment. The downside is that I think it works only on yourself, not your familiar.
Post edited September 23, 2019 by Leroux
avatar
Leroux: You could use something like this Rod of Fast Buffing (thanks to Sknymick on the NWN forums for helping me find it!). It's a bit basic, I've seen more elaborate fast buff items, but I can't find them at the Vault at the moment. The downside is that I think it works only on yourself, not your familiar.
Thanks a lot. That looks like exactly what I need. How does it work tho? I don't have much experience with mods and I didn't understand the explanation on the page. With the mods I used before, all I had to do is copy files to appropriate folders.
Well, the easiest method would be to download the module version zip file, put the .mod into the module folder and the .ncs and .uti file into the override folder, then start the rodoffastbuffing module with your character, take the rod out of the chest, put it into your character's inventory, and export the character. Whenever you choose to play a module with that character then, the rod will already be in the inventory.

The downsides to this are that (a) this won't help you if you're already in the midst of a campaign, and (b) it looks like the module only offers the regular rod and not the improved "extended" rod (below it).

So, if I understand the instructions correctly, you might have to introduce the rod into the campaign you're currently playing by loading the campaign's module into the toolset. You can find it under bin/win32/nwtoolset.exe for the EE, or in the main folder as "NWN Aurora Toolset" for NWN Diamond. You'd put the .erf file from the extrodfastcast.zip into the .erf folder, then start the toolset, choose the module you're playing, then choose "File/Import" in the menu and select the extrodfastcast.erf from the .erf folder. This will make the item and its script part of the module. Save the module (but keep a backup, to be on the safe side), quit the toolset, start NWN, load your game and use the console to spawn the item. Should be: ##dm_spawnitem extrodfastcast . In theory the item should appear at the spot under your mouse cursor then, you can pick it up and use it by casting your spells on it.

But that's only the theory, as far as I understand it, I haven't tried this myself.
Post edited September 24, 2019 by Leroux
avatar
Leroux: Well, the easiest method would be to download the module version zip file, put the .mod into the module folder and the .ncs and .uti file into the override folder, then start the rodoffastbuffing module with your character, take the rod out of the chest, put it into your character's inventory, and export the character. Whenever you choose to play a module with that character then, the rod will already be in the inventory.

The downsides to this are that (a) this won't help you if you're already in the midst of a campaign, and (b) it looks like the module only offers the regular rod and not the improved "extended" rod (below it).

So, if I understand the instructions correctly, you might have to introduce the rod into the campaign you're currently playing by loading the campaign's module into the toolset. You can find it under bin/win32/nwtoolset.exe for the EE, or in the main folder as "NWN Aurora Toolset" for NWN Diamond. You'd put the .erf file from the extrodfastcast.zip into the .erf folder, then start the toolset, choose the module you're playing, then choose "File/Import" in the menu and select the extrodfastcast.erf from the .erf folder. This will make the item and its script part of the module. Save the module (but keep a backup, to be on the safe side), quit the toolset, start NWN, load your game and use the console to spawn the item. Should be: ##dm_spawnitem extrodfastcast . In theory the item should appear at the spot under your mouse cursor then, you can pick it up and use it by casting your spells on it.

But that's only the theory, as far as I understand it, I haven't tried this myself.
Thank you very much for the detailed explanation. I was afraid that I had to use the toolset, mainly because I am using Linux and Toolset has problems with it. But I'll try it when I boot windows and see how it works :)

And yea, I am already close to chapter 2 and I have no intention of starting over :)

EDIT: I tried it and I was able to summon the item. However, whenever I try to cast a spell on it, I get the "Failure-Object is not a valid target for this spell" error. I am playing the OC.
Post edited September 24, 2019 by Engerek01
Hm, I'm sorry to hear that. I don't really know that much about the toolset and scripts myself. If you're willing to register at the NW Vault forums, I'm sure the people over there could help you out better than me, they are pretty knowledgeable about NWN.
avatar
Leroux: Hm, I'm sorry to hear that. I don't really know that much about the toolset and scripts myself. If you're willing to register at the NW Vault forums, I'm sure the people over there could help you out better than me, they are pretty knowledgeable about NWN.
Still, thanks a lot for your help. You were really helpful. I'll try those forums and I'll write here if I can find an answer.
EDIT: I was going to choose your first post as SOLUTION but silly me forgot to mark the topic as question. :(
Post edited September 24, 2019 by Engerek01
avatar
Engerek01: EDIT: I was going to choose your first post as SOLUTION but silly me forgot to mark the topic as question. :(
What, no XP reward?! I wish I'd know, before I was roleplaying the helpful goody two-shoes! ;)

Nah, it's all good, you're welcome. :) I hope you'll find the real solution over at NW Vault.
###### 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 :)))
Wow, that's a lot more complicated than I thought ... XD

Good to hear you got it to work nevertheless. Thanks for sharing your findings!
avatar
Leroux: What, no XP reward?! I wish I'd know, before I was roleplaying the helpful goody two-shoes! ;)

Nah, it's all good, you're welcome. :) I hope you'll find the real solution over at NW Vault.
Hehe. Sorry, you'll have to do an other quest to level up :)

avatar
Leroux: Wow, that's a lot more complicated than I thought ... XD

Good to hear you got it to work nevertheless. Thanks for sharing your findings!
You are welcome and thank you again. The information I shared is a collection of maybe 10 different sources and my own findings with trial and error. It was weird to see that everyone on net shared only part of the solution saying "rest is easy". Well, it wasn't easy so I decided to combine them into one complete guide. And I wouldn't be able to do it without you :)
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.
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));
}
}
}
in this case cast mage and stoneskin on you and your familiar if it's there.
Post edited September 26, 2019 by tristanlist
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 in this case cast mage and stoneskin on you and your familiar if it's there.
We have very different definitions for "easy" and people like you are the reason I had to write the guide above. Your message doesn't show me much just like your first message. You don't tell me where, when, what and how. Saying "it is easy" is not an answer. Actually, one of the guides I found was defining exactly people like you and how they confuse new players.

Besides, if I understood your suggestions correctly, I have to change those scripts every time I want to change which spells to cast or add new scripts. With Rod of fast buffing, it takes 10 seconds to re-organize the order and spells. Following my guide takes about 10 minutes in total, is final and works perfectly while your suggestion is... I don't even know what it is hence totally useless for me.
lol, let's hear some more about your open disgust for "people like me" who, when you evince a willingness to add content to a module, cheerily write the script for you that does precisely what you want and tell you exactly which event handler to put it on.