Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-21-2007, 03:12 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Appearance

HTML Code:
function savePlayer(curPlayer)
{
  temp.saveStuff = {"headimg", "bodyimg", "shieldimg", 
                    "attr[1]", "colors[0]", "colors[1]", 
                    "colors[3]", "colors[4]"};
  for (temp.curSave: temp.saveStuff)
  {
    makevar("temp.saveAccount.PD" @ temp.curSave) = makevar("temp.curPlayer." @ temp.curSave);
  }
  /*
    Finish rest of the script...
  */
}
All pretty much works, other than the colors of what the player is wearing. It's all done serverside, however it doesn't want to save what the player's currently wearing, color-wise that is.
Anyone have any idea why it seems to ignore the colors part?

Here's what it's saving:
PHP Code:
PDattr[1]=0
PDbodyimg
=body.png
PDcolors
[0]=0
PDcolors
[1]=0
PDcolors
[3]=0
PDcolors
[4]=0
PDheadimg
=head19.png
PDshieldimg
=no-shield.png 
Reply With Quote
  #2  
Old 01-21-2007, 03:12 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Color parts only work clientsided for some odd reason..
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #3  
Old 01-21-2007, 03:14 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by xXziroXx View Post
Color parts only work clientsided for some odd reason..
Oh. Explains alot... Would it be possible for it to work serverside or would I need to create pointless flags! <--Question aimed at Stefan
Reply With Quote
  #4  
Old 01-23-2007, 10:09 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by Chandler View Post
Oh. Explains alot... Would it be possible for it to work serverside or would I need to create pointless flags! <--Question aimed at Stefan
Hey, should I do this then...? Any other suggestions, anyone? Thanks
Reply With Quote
  #5  
Old 01-23-2007, 10:19 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Why don't you just save the players outfit clientside and send it serverside?
Reply With Quote
  #6  
Old 01-23-2007, 10:21 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by Gambet View Post
Why don't you just save the players outfit clientside and send it serverside?
Why would I do that? I'd rather just create the player's clothing inside a string, then save that string. Why would I need to send it to the server? I could just read it from the string?
Thanks...
Reply With Quote
  #7  
Old 01-23-2007, 10:26 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by Chandler View Post
Why would I do that? I'd rather just create the player's clothing inside a string, then save that string. Why would I need to send it to the server? I could just read it from the string?
Thanks...


Create a string array containing the players outfit clientside and send it serverside to be saved.
Reply With Quote
  #8  
Old 01-23-2007, 10:28 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by Gambet View Post
Create a string array containing the players outfit clientside and send it serverside to be saved.
You're totally avoiding what I've already said... However, I do thank you for trying to think of something that hasn't already been mentioned! Thanks again
Reply With Quote
  #9  
Old 01-23-2007, 10:53 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Huh? What am I avoiding?

I'm understanding that you can't read the player's colors serverside, so I'm suggesting to save that information clientside so that you could read it then send it over to the serverside to be saved.

Unless I'm confused about what your problem is?
Reply With Quote
  #10  
Old 01-23-2007, 10:57 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by Chandler View Post
Oh. Explains alot... Would it be possible for it to work serverside or would I need to create pointless flags! <--Question aimed at Stefan
Yeah, you just mentioned this ^
Reply With Quote
  #11  
Old 01-23-2007, 11:00 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by Chandler View Post
Yeah, you just mentioned this ^

Well it wouldn't be creating extra pointless flags, since you're already creating an array of information on the serverside.

I'm just suggestions changing that array over to clientside and sending the final product serverside to be saved.
Reply With Quote
  #12  
Old 01-23-2007, 11:05 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
No need to create a flag at all, just send the attributes etc. in an action to serverside and read the data from the params.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #13  
Old 01-23-2007, 11:06 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
It's not about serverside or clientside. Stuff like "colors[0]" is not working for dynamic variable names: http://wiki.graal.net/index.php/Crea...ring_variables
I am sure there is some way around that though, just requires a little bit more scripting.
Reply With Quote
  #14  
Old 01-24-2007, 09:38 AM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
ok, I shall do as I stated above, about several posts before. Thanks!
Reply With Quote
Reply

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 12:46 AM.


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