Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   Reset Tiledefs (https://forums.graalonline.com/forums/showthread.php?t=134259994)

fowlplay4 07-29-2010 05:55 PM

Reset Tiledefs
 
Due to Zodiac's old tiledef system being completely inefficient, it made a complete mess of the file. So I wrote this function to clean it.

PHP Code:

//#CLIENTSIDE

function resetTileDefs() {
  
temp.tiledefs.loadlines("levels/tiledefs/tiledefs" getservername() @ ".txt");
  for (
temp.tiledeftemp.tiledefs) {
    
temp.lvl temp.tiledef[1];
    
removetiledefs(temp.lvl);
  }



xXziroXx 07-29-2010 06:16 PM

Quote:

Originally Posted by fowlplay4 (Post 1590271)
Due to Zodiac's old tiledef system being completely inefficient, it made a complete mess of the file. So I wrote this function to clean it.

PHP Code:

//#CLIENTSIDE

function resetTileDefs() {
  
temp.tiledefs.loadlines("levels/tiledefs/tiledefs" getservername() @ ".txt");
  for (
temp.tiledeftemp.tiledefs) {
    
temp.lvl temp.tiledef[1];
    
removetiledefs(temp.lvl);
  }



I'm pretty sure this is your entire script:

removetiledefs("");

DustyPorViva 07-29-2010 06:17 PM

removetiledefs("");

?

fowlplay4 07-29-2010 06:29 PM

Quote:

Originally Posted by xXziroXx (Post 1590275)
I'm pretty sure this is your entire script:

removetiledefs("");

o rly now, well I also had some logic in there since I only wanted to remove certain parts. Live and learn I guess.

DustyPorViva 07-29-2010 06:34 PM

Quote:

Originally Posted by fowlplay4 (Post 1590279)
o rly now, well I also had some logic in there since I only wanted to remove certain parts. Live and learn I guess.

The parameter is for a prefix, thus you can use removetiledefs("overworld_"), or whatever, to remove certain tiledefs.

fowlplay4 07-29-2010 06:40 PM

Quote:

Originally Posted by DustyPorViva (Post 1590280)
The parameter is for a prefix, thus you can use removetiledefs("overworld_"), or whatever, to remove certain tiledefs.

From what I assumed was that it removed the tiledef with "strprefix" in the same kind of fashion as it added so I figured I'd have to manually remove each entry.

It'd be nice if /scripthelp had more descriptions on these kinds of things.

I.e: removetiledefs(strlevelprefix) - Removes all tiledefs with strlevelprefix.

cbk1994 07-29-2010 06:48 PM

It'd be nice if Stefan wrote a few lines of code to scrape scripthelp definitions off some nicely-formatted table of scripthelp commands on the wiki and updated it every once and a while. An experienced scripter could just go down the list filling in descriptions for the commands in half an hour.


All times are GMT +2. The time now is 12:32 PM.

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