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 
 
Leto Script Issue After porting to linux

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support
View previous topic :: View next topic  
Author Message
KenquinnTheInsaneOne



Joined: 25 Aug 2009
Posts: 7

PostPosted: Sat Aug 29, 2009 20:01    Post subject: Leto Script Issue After porting to linux Reply with quote

Hello I am remaking my post about this here as it was in my old post that had to do with a an issue I was having with getting letoscript running on Windows.(I deleted it there as I thought it might be confusing that the first bit of the post was about Linux.)

I am having another issue with the script I was testing it on windows until the server admin gave me privileges to access the Linux server.

Here is the script most of it. FindBicAndExecuteLeto is called on player exit and MaxHitPointsSetMax is called via a conversation.

Code:
const string NWN_VAULT_DIR  = "./servervault";  // PATH TO SERVER VAULT
const string NWN_SOURCE_DIR = "/opt/nwn/source";       // 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));
}


Leto is editing the character however it is setting all the HD to 0. I was getting this issue on my PC when I was directing the source directory to a folder without the classes.2da file.

However there is a copy of the classes.2da file in /opt/nwn/source I also used /opt/nwn/override which has the file as well. Used find -name "classes.2da" -print to make sure.

I am not very experienced in using Linux. So it may be something I have overlooked.

Server is running on Fedora 10

Any ideas on to the cause?

On a side not I know there are other ways to set MaxHPs on a linux server then leto right now however that is what were are using currently.
Back to top
View user's profile Send private message
KenquinnTheInsaneOne



Joined: 25 Aug 2009
Posts: 7

PostPosted: Tue Sep 01, 2009 21:16    Post subject: Reply with quote

Here is a copy of the leto command sent to be done.

Code:
[Tue Sep  1 15:12:13] Leto Results <: %char = q<./servervault/Kenquinn/>+FindNewestBic(q<./servervault/Kenquinn/>); meta dir => '/opt/nwn/source'; $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;


As I said before it is editing the characters but setting all the HD to 0 And I don't have a clue to as why.
Back to top
View user's profile Send private message
FunkySwerve



Joined: 02 Jun 2005
Posts: 377

PostPosted: Tue Sep 01, 2009 22:06    Post subject: Reply with quote

Your leto string is correct, it's the one we used to use. I strongly suggest using the 1.69 option instead. Regardless, it's not your problem. Please make sure that you're using leto 24, not any other version. 26 and 27 have numerous problems, and are not stable versions, which means they cause all sorts of strangeness, and often just don't work.

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



Joined: 25 Aug 2009
Posts: 7

PostPosted: Wed Sep 02, 2009 17:57    Post subject: Reply with quote

FunkySwerve wrote:
Your leto string is correct, it's the one we used to use. I strongly suggest using the 1.69 option instead. Regardless, it's not your problem. Please make sure that you're using leto 24, not any other version. 26 and 27 have numerous problems, and are not stable versions, which means they cause all sorts of strangeness, and often just don't work.

Funky
Were using the 1.69 switch but someone who will remain nameless added turned on the leto script it messed a few character up so even after releveling you are missing your level 1 HD.

I am not sure what build we are using of Leto im looking in to it but I think its was whatever was in the nwnx_easy install.

Edit: Just added the build 24 to the server no change in what is happening however the server does disappear from the list for 5 or 6 seconds is this normal?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support 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