Thanks,
I think I figured it out, the nwndb uses a standard table template like this
http://calgacus.game...ardtemplate.bmp, if you ask for an int it returns the value in the "int" column, if you ask for a string it returns the value in the "memo" column, it uses the "varname" column values to match with the sVarName param and the playerid column values to match with the PC.
To have more than one puzzle in the same table I need to use Lighfoot8's suggestion. probably just as easy and quick to use one table per puzzle but either seems easy now.
esentially a standard cal to
GetCampaignString(string sCampaignName, string sVarName, string sString, object oPC); translates to a select like so:
select memo from sCampaignName where varname == sVarName and playerid == oPC;
***** So I cannot add my own columns to the database. :-( *****
also
GetCampaignInt(string sCampaignName, string sVarName, string sString, object oPC); translates to a select like so:
select int from sCampaignName where varname == sVarName and playerid == oPC;
PS: I was thinking of 2DA files but my strings are kinda long - maybe 1000 characters, and I also I want people to just be able to download and use new databases full of fresh puzzles without having to get a new copy of the mod file. I know I could give them 2das they could drop in their override folder so thats still an option.
So what do you think is a better option, I guess it might be easier to work wit the 2DAs.
How will the read performance compare?
The database files I will at least be able to update ingame - say to mark a given puzzle as used - so it won't get reused the next time someone plays the mod or to update a puzzle counter to indicate what puzzle to use next.
Will my override folder 2DAs take effect if dropped in after a mod has been loaded and a game saved?
Thanks
Modifié par Calgacus, 08 novembre 2010 - 04:15 .