logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Solved - Letoscript Error

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules
View previous topic :: View next topic  
Author Message
KenquinnTheInsaneOne



Joined: 25 Aug 2009
Posts: 7

PostPosted: Tue Aug 25, 2009 5:24    Post subject: Solved - Letoscript Error Reply with quote

Hello,

I am having issues getting a SetMaximumXP script working for the Aventia PW. This script was working before the the host shutdown the servers and put up the modules.

Code:
const string NWN_VAULT_DIR  = "C:/****/**** ****/NeverwinterNights/NWN/servervault";  // PATH TO SERVER VAULT
const string NWN_SOURCE_DIR = "C:/****/**** ****/NeverwinterNights/NWN/override";       // PATH TO CLASSES.2DA

void DoLetoScript( string sText )
{
    SetLocalString(GetModule(), "NWNX!LETO!SCRIPT", sText);
    WriteTimestampedLogEntry("Leto Results <: "+ GetLocalString(GetModule(), "NWNX!LETO!SCRIPT"));
}

void FindBicAndExecuteLeto(object oPC) {
   string sScript = GetLocalString(oPC, "LetoScript");
   if (sScript != "") {
      string sPath = GetLocalString(oPC, "LetoPlayerName");
      //sPath = NWN_VAULT_DIR+"/"+sPath+"/"+MaxHitPointsBicName(oPC)+".bic";
      sPath = "q<"+NWN_VAULT_DIR+"/"+sPath+"/>";
      if (sPath == "") WriteTimestampedLogEntry("MaxHitPoints Bic Path is Null");
      sScript  = "%char = "+sPath+"+FindNewestBic("+sPath+"); " + sScript;
      //sScript  = "%char= '"+sPath+"'; "+sScript;
      sScript += "%char = '>'; ";
      sScript += "close %char; ";
      WriteTimestampedLogEntry("Maxing HP For >: "+sPath+":"+ GetName(oPC));
      DelayCommand(2.0, DoLetoScript(sScript));
    }
}

void MaxHitPointsSetMax(object oPC) {
    string LS = "meta dir => '" + NWN_SOURCE_DIR + "'; $RDD = 0; for(/LvlStatList) { $HD = lookup 'classes', /~/LvlStatClass, 'HitDie'; if(/~/LvlStatClass == 37) { $RDD++; $HD = $RDD < 4  ? $HD : $RDD < 6  ? 8 : $RDD < 11 ? 10 : 12; } /~/LvlStatHitDie = $HD; }";
    SetLocalString(oPC, "LetoScript", LS);
    SetLocalString(oPC, "LetoPlayerName", GetPCPlayerName(oPC));
    SendMessageToPC(oPC,"Prepare to be Leto'ed...and thank Dragonsong!");
    DelayCommand(2.0, BootPC(oPC));
}


FindBicAndExecuteLeto() is called OnCleintExit and the MaxHitPointsSetMax() is called via a conversation.

I am using NWNX 2.61 + ODBC + NWNX-Leto 3 Build 24
Windows XP 32-bit SP 3

Getting this error in the NWNserverlog1
[Mon Aug 24 19:11:33] Maxing HP For >: q<C:/****/**** ****/NeverwinterNights/NWN/servervault/Kenquinn/>:Harmonis DeRumderler

nwnx_leto log
Code:
* Loading LetoScript.dll...
* LetoScript metamodule activated (27.81ms).
<411.3µs> Req:"SCRIPT", Param:"%char = q<C:/****/**** ****/NeverWinternights/NWN/servervault/Kenquinn/>+FindNewestBic(q<C:/****/**** ****/NeverWinternights/NWN/servervault/Kenquinn/>); meta dir => 'C:/****/**** ****/NeverWinternights/NWN/override'; $RDD = 0; for(/LvlStatList) { $HD = lookup 'classes', /~/LvlStatClass, 'HitDie'; if(/~/LvlStatClass == 37) { $RDD++; $HD = $RDD < 4  ? $HD : $RDD < 6  ? 8 : $RDD < 11 ? 10 : 12; } /~/LvlStatHitDie = $HD; }%char = '>'; close %char; "


Pos 187 which i take to mean character 187 of that line is at the end of this part of the above:
Code:
+FindNewestBic(q<C:/****/**** ****/NeverwinterNights/NWN/servervault/Kenquinn/>);


Any idea of whats wrong?

Any help would be most appreciated.

PS: You may of seen this in the Windows Technical Support forums but I deleted that post and remade it here as I meant to post it here.


Last edited by KenquinnTheInsaneOne on Tue Mar 29, 2011 19:13; edited 6 times in total
Back to top
View user's profile Send private message
Lokey



Joined: 02 Jan 2005
Posts: 158

PostPosted: Tue Aug 25, 2009 7:46    Post subject: Reply with quote

[redacted] is not a pretty file name. Would need to be delimited and not by ' which I think is what letoscript replaces with with q<>. So perhaps try qq<>? Also windows paths are \ which means \N is going to be a challenge Sad

Note that 1.69 has a max hitpoint ini switch, but imagine you use leto for other things too.

ETA nwnx version and letoscript version are ok.
_________________
Neversummer PW NWNx powered mayhem Wink
Back to top
View user's profile Send private message
FunkySwerve



Joined: 02 Jun 2005
Posts: 377

PostPosted: Tue Aug 25, 2009 21:44    Post subject: Reply with quote

I suspect Lokey is right about the apostrophe issue. Further, you need to make sure you have the appropriate classes 2da in the folder it's looking in - the host who upped the mod may not have mentioned that. It's looking in the 2da to see what the proper hit die is for the character.

Funky
Back to top
View user's profile Send private message
KenquinnTheInsaneOne



Joined: 25 Aug 2009
Posts: 7

PostPosted: Tue Aug 25, 2009 23:11    Post subject: Reply with quote

FunkySwerve wrote:
I suspect Lokey is right about the apostrophe issue. Further, you need to make sure you have the appropriate classes 2da in the folder it's looking in - the host who upped the mod may not have mentioned that. It's looking in the 2da to see what the proper hit die is for the character.

Funky
I worked on it for about a day before I came here and asked I checked that the source folder does have the classes.d2a file in it.

The ini switch for maxing HPs are level up is on right now however it is more convenient if you can just do it with the press of a button. Instead of having to relevel any character you want to max HPs on.

Anyways I went and redid the directory name it did edit the character but it was resetting all the HitDice to 0. I took a look back at the code and noted the .2DA directory was pointed to the override folder and not the source folder.

It is now working after redirected the NWN folder to the source folder

Thank you both for the help
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group