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 04-17-2007, 08:53 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Copylevel

Doesn't seem to work... the folder exists, with a file already in the folder.

Here's the code: (Database)


HTML Code:
public function copyLevel(origionalName, newName)
{
  temp.levelChecks = {{temp.origionalName, ""}, {temp.newName, true}};
  for (temp.currentLevel: temp.levelChecks)
  {
    if (findlevel(temp.currentLevel[0]) == temp.currentLevel[1])
    {
      temp.alreadyExists = true;
      break;
    }
  }
  if (temp.alreadyExists)
  {
    return false;
  }
  temp.filePath = "levels/world/sanddungeon/";
  copylevel(temp.filePath @ temp.origionalName, temp.filePath @ temp.newName);
  
  echo("CREATED NEW LEVEL!");
}
function onCreated()
{
  this.copyLevel("v_cavelevel.nw", "v_cavelevels.nw");
}
The error that it produces: (via NC)

HTML Code:
The script of NPC Control_LevelGenerator has been updated by Chandler
GraalScript: Loop limit exceeded at line 4 in script of Control_LevelGenerator
Anyone know of why?

Here's the FTP
Attached Thumbnails
Click image for larger version

Name:	fileShow.png
Views:	131
Size:	11.0 KB
ID:	40635  
Reply With Quote
  #2  
Old 04-17-2007, 09:02 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
because you are reusing the same function over and over again o_o
You redefined the copylevel function therefor you shouldn't be calling it inside of itself.
__________________
Do it with a DON!
Reply With Quote
  #3  
Old 04-17-2007, 09:06 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Oh duh, I made my own function and one already exists. Thanks!
Reply With Quote
  #4  
Old 04-17-2007, 09:23 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
No problem
It is reasons like that that I almost always head my functions with either on, do, gui or fn
Depending on the purpose of the function of course.

(In your case I would probably call it doCopyLevel())
__________________
Do it with a DON!
Reply With Quote
  #5  
Old 04-17-2007, 09:48 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by zokemon View Post
No problem
It is reasons like that that I almost always head my functions with either on, do, gui or fn
Depending on the purpose of the function of course.

(In your case I would probably call it doCopyLevel())
Yeah.
It's weird, I thought there was some error with copy level. I do things like this all of the time :[
Thank you
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 04:23 PM.


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