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 12-11-2007, 02:27 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Help With Savelines

How do i get savelines() to save in a specified folder.
PHP Code:
savelines("levels/folder/stuffs/stuff.ini",0); 
I want it to save in the folder "levels/folder/stuffs/" as "stuff.ini", but instead it goes to "stuff.ini" and saves it into scriptfiles/ folder. How do I get itinto that "levels/folder/stuffs/" folder?

Current code:
PHP Code:
function onCreated(){
  
temp.array = new[2];
  
temp.array[0] = "hi";
  
temp.array[1]= "stuffs";
  
temp.array.savelines("levels/sunnyville/mud/mystuff.ini",0);

__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #2  
Old 12-11-2007, 04:07 AM
oo_jazz_oo oo_jazz_oo is offline
Jazz teh Awesome
oo_jazz_oo's Avatar
Join Date: Jul 2006
Location: California
Posts: 596
oo_jazz_oo is a jewel in the roughoo_jazz_oo is a jewel in the rough
Send a message via MSN to oo_jazz_oo
You need to make sure the npc server has folder rights to w/e your saving to.
rw levels/folder/stuffs/*
rw levels/sunnyville/mud/*
Reply With Quote
  #3  
Old 12-11-2007, 04:38 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
I did
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #4  
Old 12-11-2007, 04:40 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
If it is saving the files to the scriptfiles folder, I'd say you didn't. Post your NPC-Server folder rights here.
Reply With Quote
  #5  
Old 12-11-2007, 10:35 PM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
NPC Code:
rw levels/esteria/mud/*
rw levels/mud/*
rw levels/sunnyville/mud/*

__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #6  
Old 12-11-2007, 11:07 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Switch View Post
NPC Code:
rw levels/esteria/mud/*
rw levels/mud/*
rw levels/sunnyville/mud/*

I commonly have this problem. It's really annoying.

Go in this order, and if it doesn't work, go down the line. If it works, stop.

1) Restart the npc-server
/npcshutdown and /npcstart ... never use /npckill

2) Change the rights to rw levels/sunnyville/mud/*.ini ... sometimes this will fix it. (ALSO: There are some file types you can't save as, but I'm pretty sure .ini is okay ... did you try .txt or .arc?)

3) Try saving in a different folder to see if that works.

4) Get a global to restart the gserver ... this is a last resort, but usually fixes it.

5) Go cry a river. (just kidding)


Also, this once fixed this for me ... change the 0 to false, so you have something like
arr.saveLines( "dir/dir2/dir3/file.ini", false );
__________________
Reply With Quote
  #7  
Old 12-11-2007, 11:12 PM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Well I don't really know that after the , does, can you tell me?

Edit: None of them worked, not even the "False", anyway. Haven't tried getting a global to restart gserver yet. But still can you tell me what after the , does?
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #8  
Old 12-11-2007, 11:16 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Switch View Post
Well I don't really know that after the , does, can you tell me?
Whether to overwrite the file.

true appends, false replaces.

PHP Code:
temp.arr = { "foo" };
temp.arr.saveLines"control/foo.txt"false ); 
Would replace whatever is in control/foo.txt with "foo".

PHP Code:
temp.arr = { "foo" };
temp.arr.saveLines"control/foo.txt"true ); 
would simply add "foo" to the end of whatever was already in that file, or replace it if nothing.

Generally you want to replace, but for logs, append.
__________________
Reply With Quote
  #9  
Old 12-12-2007, 12:11 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Yeah this is a mud so it's gonna replace.
But still, it won't work. And after I realised I've been changing the rights on npcserver instead of (npcserver) [lol ] I tried again, now it's not working AT ALL, not even to scriptfiles/
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #10  
Old 12-12-2007, 12:46 AM
Kyranki Kyranki is offline
Freelance Coder
Join Date: Aug 2007
Location: At the end of the rainbow, in the pot of gold.
Posts: 202
Kyranki is on a distinguished road
Send a message via AIM to Kyranki Send a message via MSN to Kyranki
Silly duck, you need an object to actually parse the information to an ini file. I.E. An inifile object maybe and inikeys? o_O
__________________
Stan.
Reply With Quote
  #11  
Old 12-12-2007, 01:12 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Ah nevermind guys. After I found out and told you guys that I used npcserver instead of (npcserver) and it wasn't working, when I tried deleting it (in prep for changing it all to sunnyville instead of the combined) i noticed they were hidden. Thanks for the halp (Yes, I mean to say halp, DO NOT QUESTION ME!)

Edit: New error
The files always get hidden after being created in the folder it's supposed to go to. I always have to do /refreshfilelist to view them. Any suggestions?
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.

Last edited by Switch; 12-12-2007 at 04:02 AM..
Reply With Quote
  #12  
Old 12-12-2007, 05:23 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Switch View Post
Ah nevermind guys. After I found out and told you guys that I used npcserver instead of (npcserver) and it wasn't working, when I tried deleting it (in prep for changing it all to sunnyville instead of the combined) i noticed they were hidden. Thanks for the halp (Yes, I mean to say halp, DO NOT QUESTION ME!)

Edit: New error
The files always get hidden after being created in the folder it's supposed to go to. I always have to do /refreshfilelist to view them. Any suggestions?
This only tends to happen to me in levels/ subdirectories. If they're mud objects, get them out of levels/ anyway ...

I tend to get varying luck with this problem; sometimes it won't show them, but then the next few times after I refresh it may ...
__________________
Reply With Quote
  #13  
Old 12-13-2007, 03:30 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Ah ok, thanks Chris

Also, how would I create it's own folder (main folder, like levels/ is a main folder)? I gace the NPC Server rights to it, put it in folderconfig as "file mud/*.txt" etc.... but it won't show as a main folder...
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #14  
Old 12-13-2007, 03:42 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Switch View Post
Ah ok, thanks Chris

Also, how would I create it's own folder (main folder, like levels/ is a main folder)? I gace the NPC Server rights to it, put it in folderconfig as "file mud/*.txt" etc.... but it won't show as a main folder...
First, get it out of folder config. That's only for things in levels/

Next, add it to yourself and place a file in it. Make sure it's added to the NPC-Server, and it should be working fine.
__________________
Reply With Quote
  #15  
Old 12-13-2007, 04:09 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Thanks
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
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 04:00 PM.


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