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 
 
weird problem

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules
View previous topic :: View next topic  
Author Message
black_dog_z



Joined: 17 Apr 2005
Posts: 2

PostPosted: Sun Apr 17, 2005 20:20    Post subject: weird problem Reply with quote

ok 2 things, first i intalled my sql and nwnx easily that part was no problem the walkthrough needs to be updated though as Jeroen_Broekhuizen...MySQL12 file has been udated since then and some of the things they want were hard to figure out with the new version. now everything appears to work fine except in both the demo mod and my module im trying to make persistant the info seems to store fine as it dosnt error but when recalling the info it dosnt work. im trying to figure out what i did wrong here is my code for the script
Code:

   #include "aps_include"
   void main()
   {
   object oPC = GetPCSpeaker();
   int   nwuse1 = (GetPersistentInt(OBJECT_SELF,"wuse1")+1);
   int   nwuse2 = (GetPersistentInt(OBJECT_SELF,"wuse2")+1);
   int   nwuse3 = (GetPersistentInt(OBJECT_SELF,"wuse3")+1);
   int   nwuse4 = (GetPersistentInt(OBJECT_SELF,"wuse4")+1);

if (GetGold(oPC) <= 99)
   {
   AssignCommand(GetObjectByTag("innkeep1"), ActionSpeakString("You dont have enough Money. feel free to wander the lounge though."));

}

else if (nwuse1 < 2)
   {
   AssignCommand(oPC, TakeGoldFromCreature(100, oPC, TRUE));
   CreateItemOnObject("innkey1" ,oPC);
         SetPersistentInt(OBJECT_SELF,"wuse1",nwuse1++);
}
else if (nwuse2 < 2)
   {
   AssignCommand(oPC, TakeGoldFromCreature(100, oPC, TRUE));
   CreateItemOnObject("innkey2" ,oPC);
         SetPersistentInt(OBJECT_SELF,"wuse2",nwuse2++);
}
else if (nwuse3 < 2)
   {
   AssignCommand(oPC, TakeGoldFromCreature(100, oPC, TRUE));
   CreateItemOnObject("innkey3" ,oPC);
         SetPersistentInt(OBJECT_SELF,"wuse3",nwuse3++);
}
else if (nwuse4 < 2)
   {
   AssignCommand(oPC, TakeGoldFromCreature(100, oPC, TRUE));
   CreateItemOnObject("innkey4" ,oPC);
         SetPersistentInt(OBJECT_SELF,"wuse4",nwuse4++);
}
 else
AssignCommand(GetObjectByTag("innkeep1"), ActionSpeakString("We are currently out of rooms but feel free to wonder the lounge."));
}

the script keeps giving me key one but if i change the word persistant to local it works fine but isnt persistant any ideas on whats wrong? Maybe i just don't understand persistant scripting yet hopefully someone can help
_________________
It's Me the monkley!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules 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