Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-28-2006, 04:40 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
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
__________________

Last edited by Chompy; 12-28-2006 at 07:36 PM..
Reply With Quote
  #2  
Old 12-28-2006, 09:38 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
Close the file browser and open it again.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #3  
Old 12-28-2006, 09:40 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by xXziroXx View Post
Close the file browser and open it again.
Still not working, anyone know what the problem is?
__________________

Last edited by Chompy; 12-29-2006 at 04:02 PM..
Reply With Quote
  #4  
Old 12-30-2006, 04:56 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
bump, anyone know the answer for this, or have suggestions?
__________________

Last edited by Chompy; 12-30-2006 at 09:45 PM..
Reply With Quote
  #5  
Old 01-01-2007, 05:50 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by Chompy View Post
bump, anyone know the answer for this, or have suggestions?
Bump
__________________
Reply With Quote
  #6  
Old 01-01-2007, 07:24 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
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.
Reply With Quote
  #7  
Old 01-02-2007, 03:55 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
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
__________________
Reply With Quote
  #8  
Old 01-18-2007, 03:36 AM
Cyrioux Cyrioux is offline
Registered User
Join Date: Jul 2002
Location: germany
Posts: 10
Cyrioux is on a distinguished road
Haha chomp, my server is even more buggy!
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?
Reply With Quote
  #9  
Old 01-18-2007, 03:47 AM
Andy0687 Andy0687 is offline
Enigma
Join Date: Feb 2002
Posts: 1,072
Andy0687 is on a distinguished road
Are you triggering this from a GS2 GUI Buy button?
Reply With Quote
  #10  
Old 01-18-2007, 04:04 AM
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
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; 
Reply With Quote
  #11  
Old 01-18-2007, 04:25 AM
Cyrioux Cyrioux is offline
Registered User
Join Date: Jul 2002
Location: germany
Posts: 10
Cyrioux is on a distinguished road
Read-Write rights for NPC Server - done.

Now I see 'em... Thanks.





-now this error is gone, too- :/

Last edited by Cyrioux; 01-18-2007 at 04:55 PM..
Reply With Quote
Reply


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 06:46 PM.


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