View Full Version : problems with saving files

12-28-2006, 04:40 PM
Well, explaining is short:

I made a shop, it's a class, I make it trigger serverside.
From there I load an .arc file, loadvars().
I do some changes with the file, saves the file, savevars().
Then I reopen the file, with loadvars().
Then I echo what I changed, and it displays correctly.
Then I use sendtorc( "/refreshfilelist") to refresh filebrowser.

BUT, when I manually open the file in file browser, none of the changes are there...

Any thoughts, I've been having problems with this alot latly :[
I would be glad if anyone know the answer for this :O

12-28-2006, 09:38 PM
Close the file browser and open it again.

12-28-2006, 09:40 PM
Close the file browser and open it again.

Still not working, anyone know what the problem is?

12-30-2006, 04:56 PM
bump, anyone know the answer for this, or have suggestions?

01-01-2007, 05:50 PM
bump, anyone know the answer for this, or have suggestions?


01-01-2007, 07:24 PM
Are you using a script to edit files? If so, I'm having a similar problem with the text editor Joey made http://forums.graalonline.com/forums/showthread.php?t=70966
I know I can't help you...sorry.

01-02-2007, 03:55 PM
Well, I am using a class for the shop, when someone's trigger the 'buy' button,

it goes serverside and checks if player has money and such, then it joins from that
class to a other class ( join( "mud_functions"); mud_functions::addArc( params); )

I have a echo in 'mud_functions', it saves the file, and then I load the file in the same class, and it echoes correct..
and the does sendtorc( /refreshfilelist");

But, when I use a wnpc, or an other class to load the file, and echoes what I changed inside 'mud_functions' it displays the old values of the file..

Well, I hope someone can help >_<

01-18-2007, 03:36 AM
Haha chomp, my server is even more buggy! :D
I can't see the files this wicked server is creating.

I wondered where this beautiful txt files should be, so I tried the example from graal bible a little bit varied:

function onplayerenters(){
myVar.savestring("levels/file.txt", 0);

Okay... first... player.chat doesn't work - nothing happens.
client.text is my "high lag minimal timeout debug window". client.text=player.chat; brings the player.chat to this window (its just a string)

Okay... second step... debug window shows HELLO PLANET

I dunno why it is like it is, but it is.

Btw. /find file.txt doesnt work even with refreshed file list. It is just not visible... somehow the script read it out nevertheless.

Do I have to set some special server options or to set special folder rights?

01-18-2007, 03:47 AM
Are you triggering this from a GS2 GUI Buy button?

01-18-2007, 04:04 AM
After /refreshfilelist the file should be visible for /find if the file is in the levels folder. With the latest npcserver update you need to give "(npcserver)" read and write rights to the file though.
One problem with watching files can be that the server created the file in a different folder than you expect, would need to know the server name and script name to check the problem.
Player.chat can be read and written to, but is not a variable itself (it's just like a pair of functions for reading and writing), that's why you cannot use it for loadstring and similar. Do something like

player.chat = temp.var;

01-18-2007, 04:25 AM
Read-Write rights for NPC Server - done.

Now I see 'em... Thanks.

-now this error is gone, too- :/