ID:264906
 
Code:
mob
verb
Create()
var/FI=copytext(ckey,1,2)
if(fexists("Players/[FI]/[ckey]1.sav"))
winset(src,"Create1.Sb1","is-disabled=false")


Problem description:
I am trying to use fexists to check for savefiles in my game. For some reason it keeps acting as if the savefiles doesn't exist even tho it does. Anyone care to explain what I am doing wrong?

Systempaths use backslashes, not slashes. \, not / . However, \ in a text string automatically gets recognized as a text macro, and only \\ gets seen as a single \.
Thus the path would be;

if(fexists("Players\\[FI]\\[ckey]1.sav"))
The name of the file you are creating does not match the name of the file that you are searching for.
In response to Garthor
The path does exist tho. I "fexist" that same path numerous times and it always finds it, except for in this verb.
In response to Emasym
This actually doesn't matter; BYOND recognizes both as valid paths.

As for the original post, you should output what you're passing to fexists() somewhere, just to make sure everything is being set as you expect it to be set. You should also double-check all casing and whatnot, fexists() is case-sensitive.
In response to National Guardsmen
National Guardsmen wrote:
The path does exist tho. I "fexist" that same path numerous times and it always finds it, except for in this verb.

This is an excellent example of how to infuriate somebody who is trying to help you. "OH NO THERE IS AN ERROR BUT I SWEAR THERE IS NO ERROR IT MUST BE THE COMPUTER PIXIES I WILL THEREFORE PUT NO EFFORT INTO FIGURING OUT THE CAUSE OF THE ERROR AND COMPLAIN AT PEOPLE ON THE INTERNET"
In response to Garthor
Garthor I did take your advice and checked to see if it exist, and it did exist. My problem had nothing to do with "fexist", for some reason dreamaker didnt like me running two process as the exact same time checking for the same file. All is good now. So thank you for your help.