Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   problems with saving files (https://forums.graalonline.com/forums/showthread.php?t=71063)

Chompy 12-28-2006 04:40 PM

problems with saving files
 
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

xXziroXx 12-28-2006 09:38 PM

Close the file browser and open it again.

Chompy 12-28-2006 09:40 PM

Quote:

Originally Posted by xXziroXx (Post 1258174)
Close the file browser and open it again.

Still not working, anyone know what the problem is?

Chompy 12-30-2006 04:56 PM

bump, anyone know the answer for this, or have suggestions?

Chompy 01-01-2007 05:50 PM

Quote:

Originally Posted by Chompy (Post 1258831)
bump, anyone know the answer for this, or have suggestions?

Bump

excaliber7388 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...ad.php?t=70966
I know I can't help you...sorry.

Chompy 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 >_<

Cyrioux 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:

NPC Code:
function onplayerenters(){
myVar = "HELLO PLANET";
myVar.savestring("levels/file.txt", 0);
player.chat.loadstring("levels/file.txt");
client.text.loadstring("levels/file.txt");
}



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?

Andy0687 01-18-2007 03:47 AM

Are you triggering this from a GS2 GUI Buy button?

Admins 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
PHP Code:

temp.var.loadstring(filename);
player.chat temp.var; 


Cyrioux 01-18-2007 04:25 AM

Read-Write rights for NPC Server - done.

Now I see 'em... Thanks.





-now this error is gone, too- :/


All times are GMT +2. The time now is 09:57 AM.

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