Graal Forums

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

Deas_Voice 09-12-2009 04:49 PM

CopyLevel() help
 
well, i have done copylevel() before and it worked but now that i tried to use it again, it won't work.

Weapon:
PHP Code:

function onCreated() {
  
copylevel"test.nw""insides/test_" player.account ".nw" );
  
with findplayer"Deas_Voice" ) ) {
    
setlevel2"test_" player.account ".nw"player.xplayer.y);
  }


FolderConfig:
NPC Code:
level  insides/*.nw



NPC-Server Folder Rights:
NPC Code:
r levels/*.nw
rw levels/insides/*.nw



..and yes, insides/ does exists, it have 1 level inside it already.

xXziroXx 09-12-2009 04:59 PM

onCreated() on serverside is an event that doesn't have a player scope, and since you're trying to read 'player.account' in it, it reads it as '0'.

Tigairius 09-12-2009 05:01 PM

Also, make sure you lowercase the player.account because levels can't contain capital letters. This might be helpful.

Deas_Voice 09-12-2009 05:12 PM

Quote:

Originally Posted by xXziroXx (Post 1522535)
onCreated() on serverside is an event that doesn't have a player scope, and since you're trying to read 'player.account' in it, it reads it as '0'.

i tried onActionServerSide() too and triggerd it from clientside by onPlayerChats().
will try again but from clientside and send player.account from the clientside.

Quote:

Originally Posted by Tigairius (Post 1522536)
Also, make sure you lowercase the player.account because levels can't contain capital letters. This might be helpful.

hmm, lowercase you say? that's not true, because i used player.account before in CopyLevel(), and i already read the how-to.

fowlplay4 09-12-2009 05:22 PM

Try adding this to your folder config.

level *.nw

If you still aren't having any luck just store the test.nw in your insides folder, and use:

PHP Code:

function onPlayerEnters() {
  
copylevel("insides/test.nw""insides/inside_" player.account ".nw");



xXziroXx 09-12-2009 05:27 PM

Quote:

Originally Posted by fowlplay4 (Post 1522542)
If you still aren't having any luck just store the test.nw in your insides folder, and use:

I thought the destination folder had to be a subfolder to the original folder? At least it used to work like that :(

Deas_Voice 09-12-2009 05:27 PM

Quote:

Originally Posted by fowlplay4 (Post 1522542)
Try adding this to your folder config.

level *.nw

it's already added by default.
Quote:

Originally Posted by fowlplay4 (Post 1522542)
If you still aren't having any luck just store the test.nw in your insides folder, and use:

it did work moving the test level to the sub-folder. :oo:

*Edit:
Weapon:
PHP Code:

function onActionServerSidecommandacc ) {
  switch ( 
command ) {
    case 
"Copy":
      
copylevel"test.nw""insides/test_" acc ".nw" );
      
temp.findplayeracc );
        
temp.f.setlevel2"test_" acc ".nw"temp.f.xtemp.f.y);
    break;
  }
}
//#CLIENTSIDE
function onPlayerChats() {
  if ( 
player.chat == "/copy" ) {
    
triggerserver("gui"name"Copy"player.account); 
  }


still getting failed when trying to warp to the level ( and the level isn't copied )

Deas_Voice 09-12-2009 05:33 PM

ah, i got it working, thanks everyone :)

fowlplay4 09-12-2009 05:47 PM

Quote:

Originally Posted by xXziroXx (Post 1522543)
I thought the destination folder had to be a subfolder to the original folder? At least it used to work like that :(

Nope, Zodiac's instance levels are copied from the base levels in the same folder.

Also Deas, you don't need to send your account in the trigger :P

You can use player.account just fine.

xXziroXx 09-12-2009 06:01 PM

Quote:

Originally Posted by fowlplay4 (Post 1522552)
Nope, Zodiac's instance levels are copied from the base levels in the same folder.

Guess they changed it sometime after 2005 then ^^

Deas_Voice 09-12-2009 06:29 PM

Quote:

Originally Posted by fowlplay4 (Post 1522552)
Also Deas, you don't need to send your account in the trigger :P

You can use player.account just fine.

i know i can, but just i don't understand what i did wrong.
( i had player.account on serverside but i'm not sure if that was the problem. )

LoneAngelIbesu 09-13-2009 05:04 PM

I'm not sure why this wasn't working for you. I just tested it on Valikorlia and it works just fine. Mind enlightening others, who might have the same problem? The only thing I could guess is that the levels have to be in the same folder.

Deas_Voice 09-13-2009 07:21 PM

Quote:

Originally Posted by LoneAngelIbesu (Post 1522839)
I'm not sure why this wasn't working for you. I just tested it on Valikorlia and it works just fine. Mind enlightening others, who might have the same problem? The only thing I could guess is that the levels have to be in the same folder.

well, i'm not sure what i did to make it work, but the levels doesn't need to be in the same folder, i have 1 level in levels/ and copies that level to levels/insides/.
sorry.


All times are GMT +2. The time now is 08:48 PM.

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