PDA

View Full Version : File Checking


General
08-20-2001, 01:15 AM
//Non-P2P
if (fileexists(head#v(head).gif)) {
setplayerprop #3,head#v(head).gif;
}

//P2P
if (existsonserver(NewBomb.txt)) {
putnpc NewBomb.txt,Bomb.gif,x,y;
}

Might be useful for some of my scripts :D

LiquidIce00
08-20-2001, 11:02 AM
Originally posted by General
//Non-P2P
if (fileexists(head#v(head).gif)) {
setplayerprop #3,head#v(head).gif;
}

//P2P
if (existsonserver(NewBomb.txt)) {
putnpc NewBomb.txt,Bomb.gif,x,y;
}

Might be useful for some of my scripts :D

gani has filechecking ..
or at least bomys do o.o
(the body on the gani)
but yeah i thought of that before it be neat

General
08-20-2001, 11:57 AM
yes, because #3, has to be a valid filename, but what if a gani attribute (#P1, or the attribute in setani gani,attribute) needs to be a valid filename...then you are screwed

grim_squeaker_x
08-20-2001, 03:28 PM
Originally posted by LiquidIce00


gani has filechecking ..
or at least bomys do o.o
(the body on the gani)
but yeah i thought of that before it be neat The bomy body changing things are built into Graal, that's why those work without problems.

Iracious
08-21-2001, 06:16 AM
this would be handy, in one of my levels there are many many NPCs and they all do the same thing, except are set to diffrent sprites, whenever I set all of their heads at once to a file that does not exist, it'll freeze the graal client for a bit. this would be EXTREMELY helpful

LiquidIce00
08-21-2001, 07:29 AM
Originally posted by Iracious
this would be handy, in one of my levels there are many many NPCs and they all do the same thing, except are set to diffrent sprites, whenever I set all of their heads at once to a file that does not exist, it'll freeze the graal client for a bit. this would be EXTREMELY helpful
graal freezing for file checking usually only does it offline
online graal is a bit less flexible so it doesnt go as far as to check ur folder for the files. it just uses the files you had when you opened graal and checks if the file is on the server

LiquidIce00
08-21-2001, 07:29 AM
Originally posted by grim_squeaker_x
The bomy body changing things are built into Graal, that's why those work without problems.
well its the gani body attribute that requires a valid file

Tyhm
08-22-2001, 12:47 PM
Online, just the first person does the check against the online files. If it finds the file, it sets it to that, else it (at least used to) uses a default. When a player enters a level, the graphics have already been checked to exist on the server, if they're not in /levels it downloads it.
That's why you only get that unbearable "Where's aznbaby_chair.gif?" lag loading levels offline. It only happens on creation online.

I think

General
08-24-2001, 05:55 AM
hmm...but still, that doesnt address my other point, what about the fact that you can do

setani blah,notafilename;

and there is no way to check against that...

also, while I was sitting here, I was thinking about some oter things

maybe a command like "getfromserver(pics2.png)"...so you can have a tileset before you enter a level that requires you download that 500KB file (looks very tacky on a 56k)