nwnx4 & XP_CHaracter

Asset Information and Discussion for Scripting, Area Design, and More

Moderators: Moderator, Developer, DM

LordLP
Posts: 213
Joined: Wed Nov 10, 2010 5:01 am

nwnx4 & XP_CHaracter

Unread post by LordLP »

So I've gone as far as setting up a dedicated NWN2 server for use in my office for my next project.

Now I got nwnx4 running like clockwork - sql databases and all. This XP_Character plugin though, I can not get it to function correctly. At one point I was able to get the 'delete bik' command to work - but that's it.

Anyone have any advice for me? It's the same plugin we use on the server.
Arcon Anatox - Councilor of the Silver Shield
Lilly Underburrow - Not much other then scared
Luna
Retired Admin
Posts: 7945
Joined: Sat May 16, 2009 3:00 pm

Re: nwnx4 & XP_CHaracter

Unread post by Luna »

I thought I had some work saved, but I can't find it.

I couldn't get it to work via nwnx_character.nss
But on the flip side I think there is a work around.
I was able to get BicFunctions.exe to work out of DOS.
I thought I had it all saved in a notepad exactly what I did, but I can't find it.
It may even have a help.. just execute it, I think the help comes up.
Or you have to get the string parameters from nwnx4_character.nss.

So in BootAndUpdateCharacter (see below).
I think you can take out that delay command which is having nwnx4 execute BicFunction.exe, and do it directly through DOS instead.
NWNX4 can run DOS programs.

Code: Select all

void BootAndUpdateCharacter( object oPC ){
--> 	// Save the changes.
	DelayCommand( 1.5, NWNXSetString( PLUGIN_NAME, "UPDATE", sBIC_Filename, 0, sBIC_Commands ) );


To run something in DOS, you use nwnx_spawn.
This is an example you can look at.
I think you could just take this code and get it running with BicFuntions.exe

Code: Select all

#include "nwnx_spawn"

void DeleteBic(string sBic);

void main()
{
	object oPC = GetPCSpeaker();
	string sBic;
	
	if (GetIsObjectValid(oPC))
	{
		sBic = GetBicFileName(oPC);
		sBic = GetSubString(sBic, 12, GetStringLength(sBic) - 12);
		sBic = SpawnEscape("C:|Documents and Settings|Administrator|My Documents|Neverwinter Nights 2|servervault|") + sBic + ".bic";
		
		sBic = SpawnQuote(sBic);
		
		BootPC(oPC);
		DelayCommand(3.0, DeleteBic(sBic));
	}
}

void DeleteBic(string sBic)
{
	string sCommand;
	
	sCommand = "cmd /c del /F /Q " + sBic;

	SpawnProgram(sCommand);
}
LordLP
Posts: 213
Joined: Wed Nov 10, 2010 5:01 am

Re: nwnx4 & XP_CHaracter

Unread post by LordLP »

I finally got it working, thanks Luna!
Arcon Anatox - Councilor of the Silver Shield
Lilly Underburrow - Not much other then scared

Return to “NWN2 Toolset Development”