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 
 
Persistent variables not working

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related
View previous topic :: View next topic  
Author Message
Will_Constantine



Joined: 12 Aug 2007
Posts: 9

PostPosted: Tue Oct 30, 2007 19:47    Post subject: Persistent variables not working Reply with quote

Im sure i have my table setup properly and the mysql database. even using sqlite all my logs read everything working properly. when a player has a variable set on him/her after say completing a quest. it works fine but when the server resets or reboots or i update the module. these variables donot remain persistent and the player is able to compelte the quest again as if he/she never had in the first place. much of an exploit if you ask me.. is there some way i can get this to work properly? am i doing something wrong or is this just a function that does not work. because i thought it worked in nwn1 but i cant remember tbh.

thanks in advance
Back to top
View user's profile Send private message Visit poster's website
Squatting Monk



Joined: 28 Jun 2007
Posts: 76

PostPosted: Wed Oct 31, 2007 4:14    Post subject: Reply with quote

Hmm... can you give us an example of one of your scripts in action using the Get/SetPersistent functions? My guess is that's where the problem is, right there.
Back to top
View user's profile Send private message
Will_Constantine



Joined: 12 Aug 2007
Posts: 9

PostPosted: Wed Oct 31, 2007 4:53    Post subject: Reply with quote

yea someone in nwn forums mentioned the same thing. problem is im not familiar with setting persistent functions. this is the code as i assume it should be but it does not compile

Code:

void main()
{

object oPC = GetPCSpeaker();

SetPersistentInt(oPC, "lf_first_quest_complete", 1);

}
Back to top
View user's profile Send private message Visit poster's website
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Wed Oct 31, 2007 5:26    Post subject: Reply with quote

Will_Constantine wrote:
yea someone in nwn forums mentioned the same thing. problem is im not familiar with setting persistent functions. this is the code as i assume it should be but it does not compile

Code:

void main()
{

object oPC = GetPCSpeaker();

SetPersistentInt(oPC, "lf_first_quest_complete", 1);

}

Have you got the appropriate #include in your script?
Back to top
View user's profile Send private message
Will_Constantine



Joined: 12 Aug 2007
Posts: 9

PostPosted: Wed Oct 31, 2007 5:44    Post subject: Reply with quote

if im using hcr2 scripts what should i include?

#include hcr2_core_i ?


gonna jump the gun and give it a try.
Back to top
View user's profile Send private message Visit poster's website
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Wed Oct 31, 2007 6:15    Post subject: Reply with quote

Will_Constantine wrote:
if im using hcr2 scripts what should i include?

#include hcr2_core_i ?

gonna jump the gun and give it a try.


Not sure - but you need to be able to follow the #includes trail until you get to a script containing the SetPersistant... functions
Back to top
View user's profile Send private message
Squatting Monk



Joined: 28 Jun 2007
Posts: 76

PostPosted: Mon Nov 05, 2007 5:12    Post subject: Reply with quote

That should work, assuming you set hcr2_mysqldb_i as the persistency script for HCR2. I dunno about NWN2, but in HCR2 for NWN1 (which is what I use), the option for where to set that was in h2_persistence_c.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related 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