View previous topic :: View next topic |
Author |
Message |
Will_Constantine
Joined: 12 Aug 2007 Posts: 9
|
Posted: Tue Oct 30, 2007 19:47 Post subject: Persistent variables not working |
|
|
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 |
|
|
Squatting Monk
Joined: 28 Jun 2007 Posts: 76
|
Posted: Wed Oct 31, 2007 4:14 Post subject: |
|
|
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 |
|
|
Will_Constantine
Joined: 12 Aug 2007 Posts: 9
|
Posted: Wed Oct 31, 2007 4:53 Post subject: |
|
|
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 |
|
|
Gryphyn
Joined: 20 Jan 2005 Posts: 431
|
Posted: Wed Oct 31, 2007 5:26 Post subject: |
|
|
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 |
|
|
Will_Constantine
Joined: 12 Aug 2007 Posts: 9
|
Posted: Wed Oct 31, 2007 5:44 Post subject: |
|
|
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 |
|
|
Gryphyn
Joined: 20 Jan 2005 Posts: 431
|
Posted: Wed Oct 31, 2007 6:15 Post subject: |
|
|
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 |
|
|
Squatting Monk
Joined: 28 Jun 2007 Posts: 76
|
Posted: Mon Nov 05, 2007 5:12 Post subject: |
|
|
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 |
|
|
|