Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-03-2008, 08:24 PM
The_Kez The_Kez is offline
N-Pulse Asst. Manager
The_Kez's Avatar
Join Date: Dec 2007
Posts: 106
The_Kez is on a distinguished road
Send a message via MSN to The_Kez
Some sort of resetting problem.

I'm having a problem with my client and clientr variables resetting (or something) when I reconnect. I have a couple examples of this. One is with quests (right now quest progress is held as a client var. Might hold it on the serverside later or just encrypt.) The second is our stat system, player stats determine what sorts of items the character can equip (i.e you can put 10 points in swords and have some swords to choose from to equip). Those stats are held in clientr vars.

Here's a snippet of the quest sytem:

PHP Code:
function onActionClientsidecmd p1 p2 ) {
  switch ( 
cmd ) {
  
  case 
"UpdateQuestProgress":
  for ( 
temp.i=0temp.i<client.quests_all.size(); temp.i++ )
    if ( 
client.quests_all[i][0] == p1 client.quests_all[i][1] += p2;
  break;
  
  }

Quest info is held like..
var = { {"questname",progress},{"questname",progress} };
That's used for when the player does something that affects quest progress, I can tell the system to update the progress. And it works fine, I send some quest progress and it updates it properly and everything. When I reconnect, though, all of the quest progress is lost and the float values of the client vars are set to zero.

This is what happens in the stat system. I'll have, for example, 20 mastery points in swords. I can keep adding to swords and it'll work fine. Then when I reconnect, again, it seems that the vars are reset. Because when I add into swords again, if I add 5 more mastery points into swords I'll end up with 5, instead of 25.

I have a MUD sys with which I can store this sort of stuff, right now I'm only using it to hold item information, but if it came to it I guess I could use that, I just prefer not having to revamp so much. Any ideas?
Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:46 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.