View previous topic :: View next topic |
Author |
Message |
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Fri Dec 19, 2008 12:05 Post subject: Letoscript issues in Shayan's Subrace Engine 2.6beta |
|
|
I am asking my question here, because I think Shayan's forum is dis-used, or perhaps forgotten about.
My Issue is
1) I have a Shayan's Subrace Engine Module (V2.6 beta)
2) I have enabled leto from within the engine
3) I have correctly set feats to be added in the subrace
4) I get portalled by the subrace engine when it is applying the feats.
5) I am portalled back in, and ..... No feat has been added.
Here are the leto scripts from inside the module
Code: |
int LetoPingPong();
string LetoScript(string script)
{
// Stores a var in the module which NWNX LETO then takes and works with.
SetLocalString(GetModule(), "NWNX!LETO!SCRIPT", script);
// Gets the var now changed by NWNX LETO back from the module and returns it.
return GetLocalString(GetModule(), "NWNX!LETO!SCRIPT");
}
string LetoOpen(string file, string handler = "")
{
if(handler == "")
{
handler = "TEMP";
}
return "%"+handler+" = q<"+file+">;";
}
int LetoPingPong()
{
string Test = LetoScript("print q<PingPong>;");
if(Test == "PingPong")
{
return TRUE;
}
return FALSE;
}
string LetoClose(string handler = "")
{
if(handler == "")
{
handler = "TEMP";
}
return "close %"+handler+";";
}
string LetoSave(string file, string handler = "")
{
if(handler == "")
{
handler = "TEMP";
}
return "%"+handler+" = q?>"+file+"?;";
}
string LETO_ModifyProperty(string sProperty, int iModifier, int Set)
{
if(!Set)
{
return "/"+sProperty+" = /"+sProperty+"+"+IntToString(iModifier)+";";
}
else
{
return "/"+sProperty+" = "+ IntToString(iModifier)+ ";";
}
}
string LETO_ModifyWings(int iWing_Number)
{ //"<if:<Wings> ne " + IntToString(iWing_Number) + "><gff:set 'Wings' {value="+IntToString(iWing_Number)+"}></if>"
return "/Wings = " + IntToString(iWing_Number)+";";
}
string LETO_ModifyTail(int iTail_Number)
{
return "/Tail = " + IntToString(iTail_Number)+";";
}
string LETO_ModifyPortrait(string sPortrait)
{
if(sPortrait == "")
{ return ""; }
return "/Portrait = " + sPortrait +";";
}
string LETO_ModifyFeat(int iFeat, int Remove)
{
string sScript;
if(Remove == 0)
{
sScript = "add /FeatList/Feat, type => gffWord, value => " + IntToString(iFeat) + ";" + "add /LvlStatList/[0]/FeatList/Feat, type => gffWord, value => " + IntToString(iFeat) + ";";
}
else
{
sScript = "replace 'Feat', "+IntToString(iFeat)+", DeleteParent;";
}
return sScript;
}
string LETO_ModifySkill(int iSkill, int iModifier, int Set)
{
if(Set == 0)
{
return "/SkillList/["+IntToString(iSkill)+"]/Rank = /SkillList/["+IntToString(iSkill)+"]/Rank+"+IntToString(iModifier)+";" + "/LvlStatList/[0]/SkillList/["+IntToString(iSkill)+"]/Rank = /SkillList/["+IntToString(iSkill)+"]/Rank+"+IntToString(iModifier)+";";
}
else
{
return "/SkillList/["+IntToString(iSkill)+"]/Rank = " + IntToString(iModifier) + ";" + "/LvlStatList/[0]/SkillList/["+IntToString(iSkill)+"]/Rank = "+IntToString(iModifier)+";";
}
}
string LETO_SetMovementSpeed(int iSpeed)
{
if(iSpeed == MOVEMENT_SPEED_CURRENT)
{
return "";
}
else
{
return "/MovementRate = "+IntToString(iSpeed)+";";
}
}
string LETO_SetSoundSet(int iSoundSetReference)
{
if(iSoundSetReference == -1)
{ return ""; }
return "/SoundSetFile = " + IntToString(iSoundSetReference)+";";
}
string GetBicFileName(object oPC)
{
string sChar, sBicName;
string sPCName = GetStringLowerCase(GetName(oPC));
int i, iNameLength = GetStringLength(sPCName);
for(i=0; i < iNameLength; i++) {
sChar = GetSubString(sPCName, i, 1);
if (TestStringAgainstPattern("(*a|*n|*w|'|-|_)", sChar)) {
if (sChar != " ") sBicName += sChar;
}
}
return GetStringLeft(sBicName, 15) + ".bic";
}
string LETO_GetBicPath(object oPC);
string LETO_GetBicPath(object oPC)
{
string PlayerName = GetLocalString(oPC, "SUBR_PlayerName");
string BicFolderPath = "";
if(!USE_LOCAL_VAULT_CHARACTERS)
{
BicFolderPath = NWNPATH+"servervault/"+PlayerName+"/";
}
else
{
BicFolderPath = NWNPATH+"localvault/";
}
ExportSingleCharacter(oPC);
string BicFilePath = LetoScript("print q<" + BicFolderPath + "> + " +
"FindNewestBic q<" + BicFolderPath + ">;");
return BicFilePath;
}
string SetDocumentedLevel(int level = 1)
{
return "/Lootable = "+IntToString(level)+";";
}
int GetDocumentedLevel(object oPC)
{
return StringToInt(LetoScript(LetoOpen(LETO_GetBicPath(oPC)) + "print /Lootable;" + LetoClose()));
}
void DeleteBicFile(string file)
{
PrintString(LetoScript("FileDelete q<" + file + ">"));
}
string LETO_SetBicTag(string BicFile)
{
return "/Tag = " + BicFile+";";
}
string LETO_ModifyHitPoints(int iHP, int Set)
{
string sScript;
if(Set == 0)
{
sScript += "/HitPoints = /HitPoints+" + IntToString(iHP)+";";
sScript += "/LvlStatList/[0]/LvlStatHitDie = /LvlStatList/[0]/LvlStatHitDie+" + IntToString(iHP)+";";
sScript += "/MaxHitPoints = /MaxHitPoints+"+ IntToString(iHP)+";";
sScript += "/CurrentHitPoints = /CurrentHitPoints+" + IntToString(iHP)+";";
sScript += "/PregameCurrent = /PregameCurrent+" + IntToString(iHP)+";";
return sScript;
}
else
{
string sScript;
sScript += "/HitPoints = " + IntToString(iHP)+";";
sScript += "/LvlStatList/[0]/LvlStatHitDie = " + IntToString(iHP)+";";
sScript += "/MaxHitPoints = "+ IntToString(iHP)+";";
sScript += "/CurrentHitPoints = " + IntToString(iHP)+";";
sScript += "/PregameCurrent = " + IntToString(iHP)+";";
return sScript;
}
|
Here is the function from within the subrace engine for adding of feats.
Code: |
string CheckAndModifyFeats(object oPC, string SubraceTag, int Level)
{
string script = "";
string SubraceTag1 = SubraceTag + "_" + IntToString(Level);
int FeatCount = GetLocalInt(oPC, SubraceTag1 + "_" + SUBRACE_BONUS_FEAT_COUNT);
if(FeatCount > 0)
{
while(FeatCount != 0)
{
int Feat = GetLocalGroupFlagValue(oPC, SubraceTag1 + "_" + IntToString(FeatCount) + "_" + SUBRACE_BONUS_FEAT_FLAGS, SUBRACE_BONUS_FEAT_FLAG);
int Remove = GetLocalGroupFlagValue(oPC, SubraceTag1 + "_" + IntToString(FeatCount) + "_" + SUBRACE_BONUS_FEAT_FLAGS, SUBRACE_BONUS_FEAT_REMOVE_FLAG);
FeatCount--;
script += LETO_ModifyFeat(Feat, Remove);
}
}
return script;
}
|
Now
As mentioned, I am correctly portalled, however, no feats are added.
My logs show the following.
Quote: |
NWNX-Leto module (build 03 - FF)
(c) 2004 by David Frauzel (dragonsong), dragon@weathersong.net
Information and support: http://weathersong.infopop.cc
* Loading LetoScript.dll...
* LetoScript metamodule activated (2.516ms).
<258.5s> Req:"SCRIPT", Param:"print q<C:/servers/NWN/servervault/servervault/Baaleos/> + FindNewestBic q<C:/servers/NWN/servervault/servervault/Baaleos/>;"
<262.8s> Req:"SCRIPT", Param:"%char= q!C:/servers/NWN/servervault/servervault/Baaleos/!; add /FeatList/Feat, type => gffWord, value => 315;add /LvlStatList/[0]/FeatList/Feat, type => gffWord, value => 315;%char = '>'; close %char; "
<236.3s> Req:"SCRIPT", Param:"print q<C:/servers/NWN/servervault/servervault/Baaleos/> + FindNewestBic q<C:/servers/NWN/servervault/servervault/Baaleos/>;"
<340.1s> Req:"SCRIPT", Param:"%char= q!C:/servers/NWN/servervault/servervault/Baaleos/!; add /FeatList/Feat, type => gffWord, value => 433;add /LvlStatList/[0]/FeatList/Feat, type => gffWord, value => 433;%char = '>'; close %char; "
|
I am noticing that in the leto log, that it does not mention my specific bic, only the folder. Can anyone confirm if this is normal behavior?
Note - I have heard that the Subrace engine is incompatible with the newer feats of nwn - However, it should be able to cope with Hide in Plain sight, or Evil Domain powers...surely? (thats what is attempting to be added)
I notice that the LETO_GetBicPath(object oPC) function, seems to attempt to get the bic path from a variable stored on the PC. I am not sure if I have seen this being stored before, would this likely be the cause of my issue?
Has anyone experienced this, or know how to resolve?
Note - I know I am using an old version of the subrace engine, however, I attempted to update it to 3.0 once before, and it broke alot more things than it added. Eg - Vampire appearances never changed or anything. |
|
Back to top |
|
|
Fireboar
Joined: 17 Feb 2008 Posts: 323
|
Posted: Fri Dec 19, 2008 14:28 Post subject: |
|
|
Which version of letoscript are you using? It should be version 3+24. It looks like the function FindNewestBic isn't returning anything, probably because of an older version of Letoscript. |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Fri Dec 19, 2008 14:49 Post subject: No Idea |
|
|
My letoscript dll is version : 0.4.0.16 - (taken from the file properties)
Note - My mod also has Simtools, and the leto functions to 'safe delete' character bic's does work.
But I suppose all that does is rename a file, not alter it.
So I guess that can't be a clear indicator of what is working and what is not.
Where can I get the most recent letoscript.dll
Note - The nwnx_leto.dll does not display a file version in the properties.
Tonight I will test the other leto functions in simtools, to see if they can alter the stats on characters, if it can, then that will tell me that it is a nwn script issue, and not a dll issue, since they both use the same dll files. If however it cannot alter the stats of my character, then that will tell me that it is a dll issue, and I require new files.
Can you suggest any other diagnostic steps, or changes I should make to get this working?
I have lots of great ideas for subraces, that require letoscript.
The subrace I am trying to get this working for is a 'wraith' race, Just want to get them hide in plain sight(simulates a ghost phasing in and out of existance) and evil domain powers(cause their evil...duh) for the time being, but with letoscript, so much more could be possible. |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Fri Dec 19, 2008 21:32 Post subject: Results |
|
|
Results -
Higher Ground Leveling System - LETO WORKS
SIMTOOLS - Leto Not working
Shayans Subrace Engine - Not working
I deduce that my dll files are fine from this.
Things I have noticed.
This is the function that shayan's runs when I exit due to a leto change.
Code: |
void SubraceOnClientLeave()
{
object oPC = GetExitingObject();
string subrace = GetStringLowerCase(GetSubRace(oPC));
if(subrace == "")
{ return; }
if(!ENABLE_LETO)
{ return; }
int Level = GetPlayerLevel(oPC);
int LetoChanges = GetLocalInt(oPC, "SUBRACE_NEEDS_TO_RELOG");
if(LetoChanges)
{
string SubraceTag = SUBRACE_TAG + "_" + subrace;
string BicFile = LETO_GetBicPath(oPC);
string ScriptForLeto = GetLocalString(oPC, "LETO_SCRIPT_TO_FILE");
//string ScriptForLeto = LetoSubraceModifications(oPC, SubraceTag, Level);
WriteTimestampedLogEntry("*Subrace Engine LETOScript call for " + GetName(oPC) + " | " + GetLocalString(oPC, "SUBR_PlayerName") + " | " + BicFile + "* ");
string LetoError = LetoScript("%char= q!"+BicFile+"!; "+ScriptForLeto+"%char = '>'; close %char; ");
if(LetoError != "")
{
WriteTimestampedLogEntry("*Subrace Engine LETOScript Error: " + LetoError + "*");
}
}
}
|
It is getting my BIC path from this function
Code: |
string LETO_GetBicPath(object oPC)
{
string PlayerName = GetLocalString(oPC, "SUBR_PlayerName");
string BicFolderPath = "";
if(!USE_LOCAL_VAULT_CHARACTERS)
{
BicFolderPath = NWNPATH+"servervault/"+PlayerName+"/";
}
else
{
BicFolderPath = NWNPATH+"localvault/";
}
ExportSingleCharacter(oPC);
string BicFilePath = LetoScript("print q<" + BicFolderPath + "> + " +
"FindNewestBic q<" + BicFolderPath + ">;");
return BicFilePath;
}
|
In this you can see that it gets the name to look for from a variable called
SUBR_PlayerName
Which is set on the client login script...
Code: |
void SubraceOnClientEnter()
{
object oPC = GetEnteringObject();
if(!GetIsPC(oPC))
{ return; }
int infoLoaded = GetLocalInt(oPC, SUBRACE_INFO_LOADED_ON_PC);
string subrace = GetStringLowerCase(GetSubRace(oPC));
if(!infoLoaded)
{
SetLocalString(oPC, "SUBR_PlayerName", GetPCPlayerName(oPC));
if(subrace == "")
{ return; }
DelayCommand(1.0, InitiateSubraceChecking(oPC));
}
else if(infoLoaded && RELOAD_SUBRACE_INFORMATION_UPON_RELOGIN)
{
DeleteLocalInt(oPC, SUBRACE_INFO_LOADED_ON_PC);
DelayCommand(1.0, LoadSubraceInfoOnPC(oPC, subrace));
DelayCommand(2.0, ApplyPermanentSubraceSpellResistance(subrace, oPC));
DelayCommand(3.0, ApplyPermanentSubraceAppearance(subrace, oPC));
}
else
{
DelayCommand(1.0, ReapplySubraceAbilities(oPC));
}
DeleteLocalInt(oPC, "SUBRACE_NEEDS_TO_RELOG");
}
|
I am now piecing together parts of HGLL feat feat function, to see if I can get the Shayan's Subrace engine working.
It is not easy.. |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Fri Dec 19, 2008 21:49 Post subject: latest test |
|
|
Quote: | ....[Fri Dec 19 19:34:17] Baaleos Left as a Player (0 players left)
[Fri Dec 19 19:34:17] *Subrace Engine LETOScript call for test | Baaleos | C:/servers/NWN/servervault/servervault/Baaleos/*
Connection Attempt made by Baaleos (QLUQNUDK)
[Fri Dec 19 19:34:18] Baaleos (QLUQNUDK) Joined as Player 1
|
Quote: |
NWNX-Leto module (build 03 - FF)
(c) 2004 by David Frauzel (dragonsong), dragon@weathersong.net
Information and support: http://weathersong.infopop.cc
* Loading LetoScript.dll...
* LetoScript metamodule activated (2.532ms).
<260.6s> Req:"SCRIPT", Param:"print q<C:/servers/NWN/servervault/servervault/Baaleos/> + FindNewestBic q<C:/servers/NWN/servervault/servervault/Baaleos/>;"
<263.2s> Req:"SCRIPT", Param:"%char= q!C:/servers/NWN/servervault/servervault/Baaleos/!; add /FeatList/Feat, type => gffWord, value => 315;add /LvlStatList/[0]/FeatList/Feat, type => gffWord, value => 315;%char = '>'; close %char; "
|
Still no Joy
I did however check with simtools to see the variable being stored on my character.
It did indeed have stored the details of the leto changes, which tells me that the problem is with the client leave script.
Which appears here.
Code: |
void SubraceOnClientLeave()
{
object oPC = GetExitingObject();
string subrace = GetStringLowerCase(GetSubRace(oPC));
if(subrace == "")
{ return; }
if(!ENABLE_LETO)
{ return; }
int Level = GetPlayerLevel(oPC);
int LetoChanges = GetLocalInt(oPC, "SUBRACE_NEEDS_TO_RELOG");
if(LetoChanges)
{
string SubraceTag = SUBRACE_TAG + "_" + subrace;
string BicFile = LETO_GetBicPath(oPC);
string ScriptForLeto = GetLocalString(oPC, "LETO_SCRIPT_TO_FILE");
//string ScriptForLeto = LetoSubraceModifications(oPC, SubraceTag, Level);
WriteTimestampedLogEntry("*Subrace Engine LETOScript call for " + GetName(oPC) + " | " + GetLocalString(oPC, "SUBR_PlayerName") + " | " + BicFile + "* ");
string LetoError = LetoScript("%char= q!"+BicFile+"!; "+ScriptForLeto+"%char = '>'; close %char; ");
if(LetoError != "")
{
WriteTimestampedLogEntry("*Subrace Engine LETOScript Error: " + LetoError + "*");
}
}
}
|
The HGLL client leave script looks like this...
Code: |
#include "hgll_func_inc"
void main()
{
object PC = GetExitingObject();
object M = GetModule();
string Script = GetLocalString(PC, "LetoScript");
if( Script != "" )
{
SetLocalString(PC, "LetoScript", "");
LetoScript(Script);
}
}
|
Im gonna try and splice in some of HGLL into the Shayans Subrace Leave Function. |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Fri Dec 19, 2008 22:16 Post subject: Didnt work :-( |
|
|
Me out of ideas...
|
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Fri Dec 19, 2008 22:30 Post subject: |
|
|
Quote: |
* Loading LetoScript.dll...
* LetoScript metamodule activated (2.512ms).
<327.8s> Req:"SCRIPT", Param:"print q<C:/servers/NWN/servervault/Baaleos/> + FindNewestBic q<C:/servers/NWN/servervault/Baaleos/>;"
<358.8s> Req:"SCRIPT", Param:"$RealFile = q<C:/servers/NWN/servervault/Baaleos/test2.bic>;$EditFile = $RealFile + '.utc';FileRename $RealFile, $EditFile;"
<214.9s> Req:"SCRIPT", Param:"print q<C:/servers/NWN/servervault/servervault/Baaleos/> + FindNewestBic q<C:/servers/NWN/servervault/servervault/Baaleos/>;"
<143.8s> Req:"SCRIPT", Param:"add /FeatList/Feat, type => gffWord, value => 315;add /LvlStatList/[0]/FeatList/Feat, type => gffWord, value => 315;"
<313.6s> Req:"SCRIPT", Param:"%char= q!C:/servers/NWN/servervault/servervault/Baaleos/!; add /FeatList/Feat, type => gffWord, value => 315;add /LvlStatList/[0]/FeatList/Feat, type => gffWord, value => 315;%char = '>'; close %char; "
<264.7s> Req:"SCRIPT", Param:"print q<C:/servers/NWN/servervault/Baaleos/> + FindNewestBic q<C:/servers/NWN/servervault/Baaleos/>;"
<
Simtools edits here
21.30ms> Req:"SCRIPT", Param:"$RealFile = q<C:/servers/NWN/servervault/Baaleos/testwraith1.bic>;$EditFile = $RealFile + '.utc';FileRename $RealFile, $EditFile;%bic = $EditFile or die;/Str = 50;%bic = '>';close %bic;FileRename $EditFile, $RealFile;"
|
Ok - Now Simtools is working. I can see the difference in log file.
You can see the entry above the simtool one, which was the subrace, it is actually printing FindNewestBic - when I think that is meant to be a funciton call to tell it to locate the FindNewestBic file... Anyone able to help me out? My brain is confuzzeled. |
|
Back to top |
|
|
Fireboar
Joined: 17 Feb 2008 Posts: 323
|
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Sat Dec 20, 2008 16:09 Post subject: Not DLL issue |
|
|
Simtools started working because I changed a const int back to FALSE.
I took your advise, and installed the letoscript, and nwx_leto.dll files from the link.
They are version 3.24 - the version I had before that was 3.26 apparently.
Would that not make the version installed now older?
Anyhow... it made no difference.
Quote: |
NWNX-Leto module (build 03 - FF)
(c) 2004 by David Frauzel (dragonsong), dragon@weathersong.net
Information and support: http://weathersong.infopop.cc
* Loading LetoScript.dll...
* LetoScript metamodule activated (17.80ms).
<274.7s> Req:"SCRIPT", Param:"print q<C:/servers/NWN/servervault/servervault/Baaleos/> + FindNewestBic q<C:/servers/NWN/servervault/servervault/Baaleos/>;"
<161.1s> Req:"SCRIPT", Param:"add /FeatList/Feat, type => gffWord, value => 315;add /LvlStatList/[0]/FeatList/Feat, type => gffWord, value => 315;"
<397.7s> Req:"SCRIPT", Param:"%char= q!C:/servers/NWN/servervault/servervault/Baaleos/!; add /FeatList/Feat, type => gffWord, value => 315;add /LvlStatList/[0]/FeatList/Feat, type => gffWord, value => 315;%char = '>'; close %char; "
|
thats from the leto log,
this is from the generic log.
Quote: |
.......[Sat Dec 20 14:04:31] Baaleos Left as a Player (1 players left)
[Sat Dec 20 14:04:31] *Subrace Engine LETOScript call for Test wraith2 | Baaleos | C:/servers/NWN/servervault/servervault/Baaleos/*
[Sat Dec 20 14:04:31] Debug Message - Following var was on PCadd /FeatList/Feat, type => gffWord, value => 315;add /LvlStatList/[0]/FeatList/Feat, type => gffWord, value => 315;.
Connection Attempt made by Baaleos (QLUQNUDK)
|
Still no Evil Domain powers being created, or Hide in Plain sight. |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Sat Dec 20, 2008 16:52 Post subject: WOOOT |
|
|
I got it working.
There was something seriously flawed with the Subrace Engines GetBicPath function, I dunno what though, since it looked like it was doing the same thing as Simtools and HGLL.
I merely copied the contents of Simtools GetPathToBic function into the Shayans Subrace engine version, and it seems to be working. Now My Wraith gets Evil Domain Powers. Coool
Quote: |
string GetPathToBic(object PC)
{
string VaultPath = VAULTPATH_CHAT;
string Player = GetPCPlayerName(PC);
string BicPath = VaultPath + Player + "/";
return Leto("print q<" + BicPath + "> + " + "FindNewestBic q<" + BicPath + ">;");
}
|
Thanks Funkyswerve for making HGLL and Simtools - which gave me the code I need to fix the subrace engine,
and thanks to everyone else who helped.
Tata. Lol |
|
Back to top |
|
|
Fireboar
Joined: 17 Feb 2008 Posts: 323
|
Posted: Sun Dec 21, 2008 16:29 Post subject: |
|
|
Oh, well 3+26 is incredibly bugged, 3+24 is the latest stable version so you shouldn't use a different one.
Anyway, glad you got it working. |
|
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
|