Resource / .txt files ???

Posted By: TerraSame

Resource / .txt files ??? - 08/30/10 19:44

Can someone help me here...
I am getting a new Lite-C project to the point where I am creating a resourced .cd folder.

The project is similar to the template "Car Level" and I am using the Demo/Tour feature which reads five .txt files that have been recreated.

When running the project from the main folder (not resourced), the project runs properly.
When running from the resourced .cd folder, the engine seems un-able to read or find the .txt files.

I have tried two ways.
One - where the .txt files are added to the top level of the resource folder
and
Two - where they are not in the resource folder but they are in the .wrs file.
Niether way works...

Any advice to clear this up will be most appreciated..
Thanks
Posted By: Espér

Re: Resource / .txt files ??? - 08/30/10 21:57

try to create a wdl file with the same name as your mainscript (main.c => main.wdl)

And add:
Code:
path "directors/folder..etc";



to it..
then just place it in the folder of your mainscript/exe
Posted By: TerraSame

Re: Resource / .txt files ??? - 08/30/10 22:26

Espér,
Thanks...
I've messed with those path statements in the past...
But, they never work for me...
Dambest thing !
I'll try again...
But, I can't understand it... if that might work... why wont it work with the .txt files in the top level of the finished / resourced folder?
They work from my main construction folder but not the resourced folder...
Dambest thing !
Thanks again...
Posted By: Espér

Re: Resource / .txt files ??? - 08/30/10 22:30

i don´t know.. seems like the compiled file is not reacting on PRAGMA_PATH..

But.. i dunno.. i´ve fixed such problems with the wdl...
Posted By: Damocles_

Re: Resource / .txt files ??? - 08/30/10 22:32

If you are not shure, the easiest way is to copy all of your assets manually into
the "cd" folder.
This way you dont forget anything.
Dont waste too much time checking that the automatic copy functions work properly, and just do it manually.
The time is spend better on other stuff.
Posted By: TerraSame

Re: Resource / .txt files ??? - 08/30/10 22:44


Nice of you guys to help!

Damocles_
I already tried that but even that will not work...
It's the dambest thing !

Espér,
I'm still at it tryin' as you suggested...

Thanks!!!
Posted By: Damocles_

Re: Resource / .txt files ??? - 08/30/10 22:58

If copying all your assets into the cd folder (and correct subfolders if you split it up that way) does not work,
you have some deeper problem lying behind that.

Either you load stuff from a wrong path, or
missed some important assets or dll.

See: the "publish" does two things:
It compiles your code into the executables (and
possibly script files)
and second, it copies your assets into the cd folder.

The second step you could do manually in any case
with the same results.

If that does not work, there is some systematic problem.
Posted By: TerraSame

Re: Resource / .txt files ??? - 08/30/10 22:59

No luck !!!

I made a .wdl file (Same name as the main)
I put this code in the .wdl
PATH "text";
I added a folder called "text" with the .txt files into the resourced folder...

The game runs from the construction folder...
but...
No luck !!!
It's the dambest thing !

Thanks guys !
Posted By: Damocles_

Re: Resource / .txt files ??? - 08/30/10 23:02

try putting and loading the txt files from the main folder.
Posted By: TerraSame

Re: Resource / .txt files ??? - 08/31/10 00:03

I already tried that... first thing...
It all works fine from an un-resourced folder but not from a resourced folder...
I get the same problem from the un-resourced folder when I remove the text files from it...
That tells me, that the engine cant find the files... even if I manually put them into the resourced folder...
Crapola!
Posted By: Damocles_

Re: Resource / .txt files ??? - 08/31/10 00:10

try giving the subfolder as parameter in the
filename.

Anyhow, first try to load it from the mainfolder.
if you can load it from there, then there is a problem in
reading the file from subfolders.

I remember that I always put text files into the main folder
to read it.
You may have to use "texts\\my.txt" as filename format
Posted By: TerraSame

Re: Resource / .txt files ??? - 08/31/10 00:25

Thanks for your help Damocles_...

I have a path statment, as I said before, to a folder called "text"
In that folder are 5 .txt files...
In my construction folder is a copy of the "text" folder...
When I run the game from WED, the engine is finding the files in the sub-folder "text"...
So, it's working from my main folder...
But after publishing a resource folder and manually adding the "text" folder does not work... same as manually adding the text files to the resourced folder...

What a pain in the //*@%#* <Scriped out for soft ears/eyes...>
Grrrrrrrr
Posted By: Nidhogg

Re: Resource / .txt files ??? - 08/31/10 01:37

Try a different folder name, it may be the compiler doesn't like the name text because it's a variable in the engine.
Posted By: TerraSame

Re: Resource / .txt files ??? - 08/31/10 04:01

Nidhogg,
Cool...
Now that's a hell of an idea!
You might be on to somthing with that thought...
I've been running out of ideas...
First thing in the morning I will try that.
Thanks a bunch...
Posted By: Helghast

Re: Resource / .txt files ??? - 08/31/10 07:46

When you want to include the .txt files, they dont automatically bind when using PATH. that will only add a path to search files in for. You need to specify the actual file you want to bind in the .wrs resource file itself.
You'll have to manually add each textfile using:

Code:
BIND "textfile.txt";



This still has to live in the .wdl, not the .c file

regards,
Posted By: TerraSame

Re: Resource / .txt files ??? - 08/31/10 16:20

Hey guys...
I've tried everything you each suggested... and more...
All to no avail...
Bummer...
At this point I'm thinkin' Damocles_ is right...
It's a "systematic problem", most likly user (my) error...
And... I'm wastin' to much time...
So, Damocles_ is, once again, right...
"The time is spend better on other stuff."
I'm still lookin' for a pro-coder to do other work, so I'll ask him to address that too...
Thank you all for your suggestions and help...
laugh
Posted By: Ottawa

Re: Resource / .txt files ??? - 08/31/10 17:21

Hi!

My .txt file works and is included in a .wrs
It's in the work folder
In main.c I use
#define PRAGMA_PATH "..\\Models";

I use : PATH "..\\Models";
in the main.wdl, and
at the top of the file used to bind the files.
© 2024 lite-C Forums