Page 1 of 1

Scripting Question

Posted: Mon Jul 12, 2010 8:40 pm
by Mer`Zikain
Heya, been a while. Still working on module(s). One of these days I'll finish one...

Aaaanyway, at one time I had a module setup where it would store my character state (level, equipment, etc...) and location. I may have used something like NWNX2 and just forgot that was what did it or maybe I used a script I was pointed to when asking how to do it. In any case, I can't remember how it's done.

With the location I was using NBDE and just storing the location in the database then when the player rejoined I was pulling the value out and made them jump to that location. For some reason that's not working now, but it could be a problem with my code.

Any ideas or suggestions how I should do this?

Thanks in advance :D

Re: Scripting Question

Posted: Tue Jul 13, 2010 7:10 am
by driller
If I remember correctly, NBDE uses an invisible NPC or such to store variables on, which in turn is saved to the standard Bioware database. Make sure that this NPC is in the module somewhere and you are using the flush command to save him to the db.

-driller
Mer`Zikain wrote:Heya, been a while. Still working on module(s). One of these days I'll finish one...

Aaaanyway, at one time I had a module setup where it would store my character state (level, equipment, etc...) and location. I may have used something like NWNX2 and just forgot that was what did it or maybe I used a script I was pointed to when asking how to do it. In any case, I can't remember how it's done.

With the location I was using NBDE and just storing the location in the database then when the player rejoined I was pulling the value out and made them jump to that location. For some reason that's not working now, but it could be a problem with my code.

Any ideas or suggestions how I should do this?

Thanks in advance :D

Re: Scripting Question

Posted: Wed Jul 14, 2010 7:03 pm
by Mer`Zikain
Yeah it uses a placeable to store the info and it's already in its own area that is imported when you import the NBDE erf file. My problem with the location saver was just stupidity, I was storing the player location when they enter a new area first off. I just forgot that when they enter the starting area it shouldn't store THAT location... I moved and modified the script and it works fine now.

But storing the PC state, I'm not sure how that would work with NBDE. I could store the object that is the PC but then when they log back in I can't exactly take their PC and replace it with that object.

Re: Scripting Question

Posted: Wed Jul 14, 2010 7:08 pm
by driller
Why not just use ExportSingleCharacter?

-driller
Mer`Zikain wrote:Yeah it uses a placeable to store the info and it's already in its own area that is imported when you import the NBDE erf file. My problem with the location saver was just stupidity, I was storing the player location when they enter a new area first off. I just forgot that when they enter the starting area it shouldn't store THAT location... I moved and modified the script and it works fine now.

But storing the PC state, I'm not sure how that would work with NBDE. I could store the object that is the PC but then when they log back in I can't exactly take their PC and replace it with that object.

Re: Scripting Question

Posted: Wed Jul 14, 2010 9:14 pm
by Mer`Zikain
I used that a few years ago but if I recall I just ended up with a bunch of charactername[#].bic files. Not sure how I'd delete the current one before exporting a new one.

Re: Scripting Question

Posted: Thu Jul 15, 2010 7:18 am
by driller
Set the BackupSavedChars in the nwnplayer.ini to 0.

-driller
Mer`Zikain wrote:I used that a few years ago but if I recall I just ended up with a bunch of charactername[#].bic files. Not sure how I'd delete the current one before exporting a new one.

Re: Scripting Question

Posted: Thu Jul 15, 2010 7:54 pm
by Mer`Zikain
That still gets me an extra .bic for the character with the last character in the name being replaced with a number.

Re: Scripting Question

Posted: Thu Jul 15, 2010 8:46 pm
by driller
Is that so bad?

-driller
Mer`Zikain wrote:That still gets me an extra .bic for the character with the last character in the name being replaced with a number.

Re: Scripting Question

Posted: Thu Jul 15, 2010 8:54 pm
by Mer`Zikain
Well it does have the potential of making a mess out of the vaults, though not really too much to worry about storage-wise. Still, I'd prefer a more efficient method. I wish I could remember how I did it before. It must have been from hosting the module through NWNX2 or something similar.

Re: Scripting Question

Posted: Thu Jul 15, 2010 9:23 pm
by driller
So does a guy that makes 200 characters, it all relative. I find it doubtful that any method to keep track of the PC and his items would be more efficient than the bic.

-driller
Mer`Zikain wrote:Well it does have the potential of making a mess out of the vaults, though not really too much to worry about storage-wise. Still, I'd prefer a more efficient method. I wish I could remember how I did it before. It must have been from hosting the module through NWNX2 or something similar.

Re: Scripting Question

Posted: Fri Jul 16, 2010 9:52 am
by Mer`Zikain
Yeah I'm not denying that, I'm just trying to keep it to a single .bic for each character. Plus I don't like the exporting character message when using that script.

How does BSK keep track of PCs?

Re: Scripting Question

Posted: Fri Jul 16, 2010 10:05 am
by driller
Locations are saved to a mySQL db. The characters themselves are saved via exporting.
I don't see how else you could track character progress other than with exporting.
Maybe I am not understanding what you are saying.

-driller
Mer`Zikain wrote:Yeah I'm not denying that, I'm just trying to keep it to a single .bic for each character. Plus I don't like the exporting character message when using that script.

How does BSK keep track of PCs?

Re: Scripting Question

Posted: Fri Jul 16, 2010 12:17 pm
by Mer`Zikain
You have (or at least had at one point) a conversation script that allowed a player to delete their character. I was assuming that there was some other method of storing the character than using the export function and creating a duplicate bic file. I guess if that's not the case your delete script was using some kind of file name matching to get all characternameX.bic files and remove them? Otherwise they would just come back with the previous character in the bic stack.

But again I don't know enough about the server portion of this so maybe there's something that makes that process easier...

Anyway, beyond the above rambling, if you're using export as well, how do you suppress the export message that gets sent to the user when their character is exported? That's the only thing that really bugs me about that function. I've never seen that message on BSK so I thought you were doing it some other way.

Re: Scripting Question

Posted: Fri Jul 16, 2010 1:06 pm
by driller
I don't think the message displays when you run it from the server.

-driller
Mer`Zikain wrote:You have (or at least had at one point) a conversation script that allowed a player to delete their character. I was assuming that there was some other method of storing the character than using the export function and creating a duplicate bic file. I guess if that's not the case your delete script was using some kind of file name matching to get all characternameX.bic files and remove them? Otherwise they would just come back with the previous character in the bic stack.

But again I don't know enough about the server portion of this so maybe there's something that makes that process easier...

Anyway, beyond the above rambling, if you're using export as well, how do you suppress the export message that gets sent to the user when their character is exported? That's the only thing that really bugs me about that function. I've never seen that message on BSK so I thought you were doing it some other way.