Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-29-2010, 05:55 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
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);
  }

__________________
Quote:
Reply With Quote
  #2  
Old 07-29-2010, 06:16 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by fowlplay4 View Post
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("");
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #3  
Old 07-29-2010, 06:17 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
removetiledefs("");

?
Reply With Quote
  #4  
Old 07-29-2010, 06:29 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by xXziroXx View Post
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.
__________________
Quote:
Reply With Quote
  #5  
Old 07-29-2010, 06:34 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by fowlplay4 View Post
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.
Reply With Quote
  #6  
Old 07-29-2010, 06:40 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by DustyPorViva View Post
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.
__________________
Quote:
Reply With Quote
  #7  
Old 07-29-2010, 06:48 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
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.
__________________
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 02:41 PM.


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