Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-31-2006, 04:18 AM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
Finding a file

Is there any command that finds the path of a file?
i.e. if I had 'zomg.png' in 'levels/images/,' it would return 'images/zomg.png'
Reply With Quote
  #2  
Old 01-31-2006, 04:48 AM
Ajira Ajira is offline
Poont.
Join Date: Oct 2004
Location: NY, USA
Posts: 477
Ajira is on a distinguished road
No. Scan through every folder =D
__________________
Liek omigosh.

Reply With Quote
  #3  
Old 01-31-2006, 05:17 AM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
D: Yeah, I did that.
However, when it finds the file, it's not returning the index. :/

PHP Code:
for (afolders) {
  
temp.zomg.loadfolder(level0);
  if (
temp.zomg.index(level) != -1player.chat "FOUND";

If I do 'player.chat @= temp.zomg' it will add my level to my chat, so it's definately finding it.
Reply With Quote
  #4  
Old 01-31-2006, 05:20 AM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
Nevermind, I did 'if (temp.zomg[0] == level)' and it worked.
Is the index thing a bug? Or does it just not work serverside?
Reply With Quote
  #5  
Old 01-31-2006, 07:44 AM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
Don't you mean .indexof()?
Reply With Quote
  #6  
Old 01-31-2006, 02:49 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Couldn't you use 'if (level in temp.zomg)' ?
__________________
Reply With Quote
  #7  
Old 01-31-2006, 05:40 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
Quote:
Originally Posted by Rick
Don't you mean .indexof()?
.index() has worked for me since v3 O-o
It's what's listed in the docu_graalscript.txt, as well.


Quote:
Originally Posted by Inverness
Couldn't you use 'if (level in temp.zomg)' ?
Probably! :O
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 11:40 PM.


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