Page 1 of 1

Is there a way to open a file outside of the game directory?

Posted: Tue Mar 18, 2014 12:10 pm
by ringo_ni_ringo
So, I am noticing that my "game" folder for this project is getting really crowded and hard to sort through when I need to change/re-size/edit an image or shorten a sound so it fits. I could just use the 'Search' that windows has but it isn't effective to search by the file type or name. I was thinking of separating the sprites and backgrounds from the music and sounds and making it more organized. Maybe I'm just a bit OCD when it comes to how things are organized on computers and such, but it really does help me a lot to do so. (I've spent a chunk of time trying to research this and either there's nothing or Google is stupid.)

Re: Is there a way to open a file outside of the game direct

Posted: Tue Mar 18, 2014 12:59 pm
by AxemRed
Use subfolders.

Re: Is there a way to open a file outside of the game direct

Posted: Tue Mar 18, 2014 2:13 pm
by ringo_ni_ringo
Well yes, but how do I call them? Like I tried to, and it worked. The problem I have is that I don't know if telling it "C:/Users/Zoe/Desktop/PROJECTS/Spinoza Rosa/game/bleh/bleh.png" would work on another computer. I'm still kind of a noob when it comes to ren'py and python, but I have lots of experience in visual BASIC and html.

Re: Is there a way to open a file outside of the game direct

Posted: Tue Mar 18, 2014 2:22 pm
by xela
Just the "bleh/bleh.png" will do.

Re: Is there a way to open a file outside of the game direct

Posted: Tue Mar 18, 2014 2:33 pm
by ringo_ni_ringo
Oh, thank you. >_<; I feel kinda silly now.

Re: Is there a way to open a file outside of the game direct

Posted: Tue Mar 18, 2014 4:09 pm
by ringo_ni_ringo
Okay so ren'py hated what ever I did. I gave it the images for all the characters and the backgrounds just like this:

Code: Select all

## Declare character images below this line.

## FIAMN
image fiamn neutral = "/characters/fiamn/fiamn_neutral.png"
image fiamn semb = "/characters/fiamn/fiamn_semb.png"
image fiamn emb = "/characters/fiamn/fiamn_emb.png"
image fiamn silly = "/characters/fiamn/fiamn_silly.png"
image fiamn sad = "/characters/fiamn/fiamn_sad.png"
image fiamn serious = "/characters/fiamn/fiamn_serious.png"
image fiamn angry = "/characters/fiamn/fiamn_angry.png"
image fiamn annoyed = "/characters/fiamn/fiamn_annoyed.png"
image fiamn happy = "/characters/fiamn/fiamn_happy.png"
and it gives me this error:
I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/script.rpy", line 820, in script
IOError: Couldn't find file '/characters/fiamn/fiamn_neutral.png'.
I have the folders set up like this:
Capture.PNG
Capture2.PNG
What did I do wrong to upset this thing to the point that it won't run at all?

Re: Is there a way to open a file outside of the game direct

Posted: Tue Mar 18, 2014 4:16 pm
by Asceai
get rid of the / at the start of the paths

Code: Select all

image fiamn neutral = "characters/fiamn/fiamn_neutral.png"

Re: Is there a way to open a file outside of the game direct

Posted: Tue Mar 18, 2014 4:41 pm
by ringo_ni_ringo
Thank you. >_< Everything works fine now.
It was a pain to go through and change that though...

Re: Is there a way to open a file outside of the game direct

Posted: Tue Mar 18, 2014 4:45 pm
by xela
Get a decent text editor and use the replace function. Noone changes this stuff manually if there is a pattern to fix on.

Re: Is there a way to open a file outside of the game direct

Posted: Wed Mar 19, 2014 12:52 am
by ringo_ni_ringo
Y-you don't have to do it manually? 0A0

Re: Is there a way to open a file outside of the game direct

Posted: Wed Mar 19, 2014 11:41 am
by Destiny
Nope, pretty much all text editors (especially those of Ren'Py) feature the search/replace feature
You only have to watch out what to replace with what (if the way is "/liam/liam_not", then just replacing "/liam" into "liam" will result in a "liamliam_not" instead of the wanted "liam/liam_not").
Replace.png