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 recently started playing this game again after about five years. Previously I had made about 20 scripts and some I wanted to run. I also had recently made over 50 scripts for NWN 1. These were mostly to add and equip or unequip armor and weapons. These scripts all worked well in NWN, so I imported them into the NWN2Toolset and re-compiled them. After I finished I placed them in the My Documents\Neverwinter Nights 2\override folder along with weapon and armor blueprints I created with the tool kit. I did this before even starting the game.

As soon as I started the game, I tried to run a script to add and equip my armor. I used DebugMode 1 and then “rs aces_add12armor” to call the script. (name carried over from NWN) I received a script error “Virtual Machine reports unsuccessful execution of script aces_add12armor for object Ace sHigh.” I rechecked my spelling and tried it again. I then tried running several scripts to install weapons. I received errors every time. I had to use giveitem <item ID> to add everything I wanted and equip them manually. Since the console was working I knew that wasn’t the problem. I went back into the toolset and rechecked my scripts and they looked ok. I checked online for similar problems and did not see anything close.

I tried running some simple scripts to see if they would work and still received errors. I tried running several cheat scripts built into the game like rs ga_party_limit(6) and rs ga_influence <#,##> and those worked perfectly. I decided to add the Advanced Script Compiler to see if there was a problem with my scripts and did not find any. Finally, I wrote a very simple test script which is below:

void main()
{
object oPC=OBJECT_SELF;
string sMsg;

sMsg="This is a test!";
FloatingTextStringOnCreature(sMsg, oPC);
}

I ran this script and also received the unsuccessful execution error. This has been very frustrating for me and I finally decided to ask for help. If anybody knows why this might be happening, I would appreciate your help!
No posts in this topic were marked as the solution yet. If you can help, add your reply
As I recall OBJECT_SELF isn’t going to be your main PC when you are using the console. Your script needs to set oPC based on your selected character not OBJECT_SELF. You should be able to find some info on this in the various scripting tutorials that are available.
avatar
KaldorSilverwand: As I recall OBJECT_SELF isn’t going to be your main PC when you are using the console. Your script needs to set oPC based on your selected character not OBJECT_SELF. You should be able to find some info on this in the various scripting tutorials that are available.
I had no trouble using OBJECT_SELF in NWN, so I thought it would work in NWN 2 as well. I have not seen anything directly related to scripts to be used on the console and oPC. I have seen oPC referred to other names, but I am not finding anything now. I did find this in the NWN2Toolset. Would object oPC = GetPrimaryPlayer(); be better?

Thanks for your help!

I tried it and it compiled ok, but still wouldn't run!

I think this may be what you were talking about:
object oPC=GetPCSpeaker();
With that I could just highlight the NPC I want to run the script on and it would work without any other changes.

Then I could use this if I needed to reference myself:
object oPlayer = GetPrimaryPlayer();
I think that will give me some new options. Now if I could only get the scripts to run.

When I first installed NWN2, I used GOG Galaxy and installed it on my F: drive. I could not save any games without the game crashing. dr.schliemann came up with a solution and that was to reinstall it on C: using the offline installer. I reinstalled it using the offline installer, but I installed it to my F: drive instead. I have been able to save my games now, but maybe that's why I can't run my scripts. I can't find any reason they are not running. Does anybody have any thoughts on the subject? I appreciate any help!
Post edited November 14, 2018 by dwharper