Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Appearance (https://forums.graalonline.com/forums/showthread.php?t=71600)

Chandler 01-21-2007 03:12 PM

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 


xXziroXx 01-21-2007 03:12 PM

Color parts only work clientsided for some odd reason..

Chandler 01-21-2007 03:14 PM

Quote:

Originally Posted by xXziroXx (Post 1267099)
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

Chandler 01-23-2007 10:09 PM

Quote:

Originally Posted by Chandler (Post 1267100)
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

Gambet 01-23-2007 10:19 PM

Why don't you just save the players outfit clientside and send it serverside?

Chandler 01-23-2007 10:21 PM

Quote:

Originally Posted by Gambet (Post 1268042)
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...

Gambet 01-23-2007 10:26 PM

Quote:

Originally Posted by Chandler (Post 1268043)
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.

Chandler 01-23-2007 10:28 PM

Quote:

Originally Posted by Gambet (Post 1268044)
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

Gambet 01-23-2007 10:53 PM

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?

Chandler 01-23-2007 10:57 PM

Quote:

Originally Posted by Chandler (Post 1267100)
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 ^

Gambet 01-23-2007 11:00 PM

Quote:

Originally Posted by Chandler (Post 1268059)
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.

xXziroXx 01-23-2007 11:05 PM

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.

Admins 01-23-2007 11:06 PM

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.

Chandler 01-24-2007 09:38 AM

ok, I shall do as I stated above, about several posts before. Thanks!


All times are GMT +2. The time now is 11:23 PM.

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