View previous topic :: View next topic |
Author |
Message |
KenquinnTheInsaneOne
Joined: 25 Aug 2009 Posts: 7
|
Posted: Tue Aug 25, 2009 5:24 Post subject: Solved - Letoscript Error |
|
|
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 |
|
|
Lokey
Joined: 02 Jan 2005 Posts: 158
|
Posted: Tue Aug 25, 2009 7:46 Post subject: |
|
|
[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
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 |
|
Back to top |
|
|
FunkySwerve
Joined: 02 Jun 2005 Posts: 377
|
Posted: Tue Aug 25, 2009 21:44 Post subject: |
|
|
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 |
|
|
KenquinnTheInsaneOne
Joined: 25 Aug 2009 Posts: 7
|
Posted: Tue Aug 25, 2009 23:11 Post subject: |
|
|
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 |
|
|
|
|
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
|