Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   copylevel() (https://forums.graalonline.com/forums/showthread.php?t=66247)

xXziroXx 05-26-2006 03:25 PM

copylevel()
 
Could anyone give me a working example of it? Ive used this command in GS1 before, but for some reason I just couldnt get it to work yesterday (tried both GS1, GS2 with both a Weapon and a DB NPC).

Warcaptain 05-26-2006 04:53 PM

copylevel("path/to/level","new/path/to/copy")

new/path/to/copy has to be a different folder than the first
ie:
copylevel("levels/onlinestartlocal.graal","levels/backup/onlinestartlocal.graal");

xXziroXx 05-26-2006 06:46 PM

Somewhere in the serversided part of the NPC System/Main:


NPC Code:

echo( "Copying level..");
copylevel( "levels/genlevel1.nw", "levels/generated/genlevel1.nw");



also tried

NPC Code:

echo( "Copying level..");
copylevel( "genlevel1.nw", "generated/genlevel1.nw");




Nothing worked, and the "Copying level.." text is shown on RC.

xXziroXx 05-30-2006 02:07 PM

*bump*

Still not working for me..

ApothiX 05-30-2006 02:11 PM

do you have savelevels=true in your serveroptions?

xXziroXx 05-30-2006 03:16 PM

savelevels=false

Changing to true.. now let me test if it works!


EDIT: Didnt work..

ApothiX 05-31-2006 02:43 AM

does the generated/ folder exist? That might be one of the reasons it's not working.

Warcaptain 05-31-2006 07:03 AM

savelevels=true is only for updateboard2.

There has to be a file already in the folder you are copying to.

ApothiX 05-31-2006 02:08 PM

Quote:

Originally Posted by Warcaptain
savelevels=true is only for updateboard2.

There has to be a file already in the folder you are copying to.

There doesn't have to be a file in the directory for the directory to exist.

Warcaptain 05-31-2006 08:59 PM

Quote:

Originally Posted by ApothiX
There doesn't have to be a file in the directory for the directory to exist.

The directory will exist in the file browser, but without a file in it it does not physically exist. The only function that makes new folders, to my knowlege, is savevars/lines. copylevel will NOT. You need a placeholder file, that takes up some form of space. ie: not a 0kb file.

xXziroXx 05-31-2006 09:17 PM

Quote:

Originally Posted by Warcaptain
The directory will exist in the file browser, but without a file in it it does not physically exist. The only function that makes new folders, to my knowlege, is savevars/lines. copylevel will NOT. You need a placeholder file, that takes up some form of space. ie: not a 0kb file.

That would be correct. Didnt work untill I put a file into the folder, and well - now it works.

ApothiX 06-01-2006 01:39 AM

Quote:

Originally Posted by Warcaptain
The directory will exist in the file browser, but without a file in it it does not physically exist. The only function that makes new folders, to my knowlege, is savevars/lines. copylevel will NOT. You need a placeholder file, that takes up some form of space. ie: not a 0kb file.

If you put a file in it originally, and then delete the file, the directory will still exist. Which is why it is handy to have the 'delete folder' option on RC2.


All times are GMT +2. The time now is 03:30 PM.

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