Paths just don't work at all

Posted By: crumply

Paths just don't work at all - 08/25/08 17:38

Code:
#define PRAGMA_PATH "%EXEDIR%\\data\\object"
#define PRAGMA_PATH "%EXEDIR%\\data\\terrain"
#define PRAGMA_PATH "%EXEDIR%\\data\\image"
#define PRAGMA_PATH "%EXEDIR%\\data\\leveldata"
#define PRAGMA_PATH "data\\object"
#define PRAGMA_PATH "data\\terrain"
#define PRAGMA_PATH "data\\image"
#define PRAGMA_PATH "data\\leveldata"
add_folder("%EXEDIR%\\data\\object");
add_folder("%EXEDIR%\\data\\terrain");
add_folder("%EXEDIR%\\data\\image");
add_folder("%EXEDIR%\\data\\leveldata");
add_folder("\\data\\object");
add_folder("\\data\\terrain");
add_folder("\\data\\image");
add_folder("\\data\\leveldata");


I have a folder called data and within that several other folders.

When testing the level in sed (i.e. clicking run) it will work fine HOWEVER when I compile to exe it never works. I've tried all the above combinations and it just won't do it. It just can't find level entities files.

Anyone know the solution to my file woes?
Posted By: Anonymous

Re: Paths just don't work at all - 08/26/08 07:58


um...perhaps its just a typo where it should be

"%EXE_DIR%\\data\\object"
and in the remaining define statements.
and in the add_folder ones too.

I haven't used these statements and commands yet. But I was just reading up more on the online manual.
And in the section of the SDK functions.


cheers
Posted By: crumply

Re: Paths just don't work at all - 08/26/08 19:35

Cool, I changed that but the problem seems to be with ent_create. Does it not support paths?
Posted By: Anonymous

Re: Paths just don't work at all - 08/26/08 22:48


I don't know.
Let me scratch a claw at the manual. wink

I don't think it does. But I think if you use
the PATH command and add folders too..they will be searched in there along with the main work folder.

here is some from the online manual.

PATH "dirname";
All files belonging to the application - bitmaps, sounds, entities etc. - will be first searched for in the work folder and then in the folder given here.
Remarks:
Backslashes ("\") have to be given in C notation as double backslashes (like "C:\\games").
Paths will be searched in the given sequence. Paths are relative to the current work folder. In order to be able to copy your project to different locations, use relative paths for all files belonging to your project, and absolute paths for all files that are on an absolute location on your hard disk (like template scripts).
A7 If the path begins with "%EXE_DIR%", it's a subfolder of the program folder (like "%EXE_DIR%\\template_6\\models"). Apart from that, do not use special characters or spaces in your folder names.

cheers


Posted By: DJBMASTER

Re: Paths just don't work at all - 08/30/08 00:23

Hey i'm having problems with paths too...

I have a folder called "gfx" in the main folder, where my main script file is, that contains all my graphics.

In my main script i added...

#define PRAGMA_PATH "%EXE_DIR%\\gfx"

but it still complains that it can't find any graphics. I have also tried

#define PRAGMA_PATH "gfx"

but still it complains, i have read through the manual and this thread many times, i just dont see what is going wrong.
Posted By: EvilSOB

Re: Paths just don't work at all - 08/30/08 05:27

Crumply & DBJ,
it could be one or two things, and I found the manual rather
confusing on this issue, and worked it out more by trial
and error than reading. Firstly, ditch the 'add_folders' option
as not necessary for this task.

#define PRAGMA_PATH ... NEEDS to end with a semicolon ';'
It will compile but wont work without it in my experience.
Code:
#define PRAGMA_PATH "gfx"

SHOULD BE

#define PRAGMA_PATH "gfx";

Another thing, PRAGMA_PATH doesnt like the double-slash ("\\") as the manual suggests.
Code:
#define PRAGMA_PATH "%EXEDIR%\\data\\object"

SHOULD BE

#define PRAGMA_PATH "%EXE_DIR%\data\object";

Also bear in mind, using the %EXE_DIR% specifier (beware the spelling)
means the path starts looking from the folder GameStudio is installed in,
NOT the folder your main script lives in(as this can be a different place).

So, using the above code-chunks as examples,
eg. A> the folder c:\projects\myproject\gfx will be searched
and
eg. B> the folder C:\Program Files\GameStudio7\data\object will be searched.


Posted By: DJBMASTER

Re: Paths just don't work at all - 08/30/08 11:34

Nope, just can't get it to work. I've tried all of these...

#define PRAGMA_PATH "gfx"
#define PRAGMA_PATH "gfx";
#define PRAGMA_PATH "\\gfx"
#define PRAGMA_PATH "\\gfx";
#define PRAGMA_PATH "%EXE_DIR%\\gfx";

The only way i was able to get it to find my resources is by adding the path names to a .wdl, which the engine loads automatically. I mean this would do but i can't seem to be able to load the action names in WED.

I have files in my scripts folder like variables.c, player.c, audio.c and these are all includes by #include <scripts\\player.c>....ETC...

But i can't get WED to find the actions in my included scripts.
Posted By: EvilSOB

Re: Paths just don't work at all - 08/30/08 14:35

Please post an example 'script', or the real one,
that includes all your 'PRAGMA' and '#include' calls.

And the actions you want WED to access is in one(or more)
of the includes? Have I get that right? I have a sneaking
suspicion this cant be done.

I'll look into it tomorrow...
EDIT...
Hmmm, seems you can use actions from includes...
OK, this the verbatim top chunk of one of my current projects
Code:
#define PRAGMA_PATH "@Mixer";
//
#include <acknex.h>
#include <default.c>
//
#include "Ent_Panel.c"
//
My folders are arranged like so. (and no tricky setting in SED)
GameStudio lives in.....:- G:\GStudio7\..
My project lives in.......:- G:\@LightFixer\..
'Ent_Panel.c' lives in......:- G:\@LightFixer\@Mixer\..
I put an action into "Ent_Panel.c" and was able to use it happily from WED without tricky settings. Cool !

My guess is your problem is this,
  • Whenever you ADD a new script to a level in WED, you NEED to save & exit & restart WED for all actions
    to become available through WED.
  • Whenever you MODIFY a new script assigned a level in WED, you NEED to save & exit & restart WED for all actions
    to become available through WED.

That damned WED caches the attached script, and doesnt autoupdate if it gets changed. AND
it doesnt always give you ALL the actions in a script you've just attached.
A simple Save and Restart of WED seems to bring it all back on track though.

PS Make sure your actions DONT expect parameters or WED wont touch them.
Code:
action Move_Object()            
{   blah,blah,blah  }         /// All Cool

action Move_Object( ENTITY* me )  
{   blah,blah,blah  }         /// BAD - will 'work' in script but WED will ignore.

Posted By: DJBMASTER

Re: Paths just don't work at all - 08/31/08 07:10

Well i have got the WED, action thing working but i still cant seem to be able to get PRAGMA_PATH working...

Here is a basic example of the problem...

http://djbm.kawanda.net/public_files/test_pragma_path.zip
Posted By: EvilSOB

Re: Paths just don't work at all - 08/31/08 07:33

unzipped it to my ram-stick and compiled fine...
I then added the Panel definition on the end to make sure, and it displays fine too.
Code:
#define PRAGMA_PATH "graphics"; // define my graphics folder


#include <acknex.h>
#include <default.c>


BMAP* bmp_loading = "loading.png"; // engine cannot find the file.. What is going wrong???

PANEL* showit = { bmap = bmp_loading;  flags = visible;  }  //compiles and displays fine...
And I was running it all from "F:\test_pragma_path\test_pragma_path\test_main.c"
(yup, the folder names double-up, my sloppy unzip but it still works fine)

Maybe it has something to do with the fact its running from "inside" the gamestudio install folder?
(if that was you) Try moving it somewhere else.

Also, run it with an empty directory besides what you sent, in case one of your older files are interfering.

Or even (horror of horrors) a corrupt install? Try the zip you sent me on a fresh machine or install.

PS which version of A7 you running? And which OS too, XP or Vista? (I am XP)
Posted By: DJBMASTER

Re: Paths just don't work at all - 08/31/08 07:40

the test_pragma_path folder is located on my desktop. I'm using vista Home Premium with A7 pro.

I'll try a fresh install of gamestudio...

I do still have the .wdl work around.

Thanks
Posted By: EvilSOB

Re: Paths just don't work at all - 08/31/08 08:02

Ive not tried playing with Vista yet, so go slow on the re-install. (I just said that cause I ran out of ideas).

Try removing the WDL workaround in case it is over-riding the Pragma commands.

Otherwise, try creating a new folder from the Zip you sent me, NO other files,
and see how it goes.
Posted By: crumply

Re: Paths just don't work at all - 08/31/08 16:35

Still doesn't load the model files with the semicolons.

I think my best bet is to load the model using the full path from the exe directory in the ent_create command.

This is definitely a problem that conitec needs to address in lite-c free. I cannot use the wdl workaroud.
Posted By: MrGuest

Re: Paths just don't work at all - 08/31/08 20:37

I've had similar problems

You can create them all as a basic model in the root, then morph them once the .wdl has init'd

If you put in the full path, it will still not be found with game_load unless you already load the level, then run game
Posted By: EvilSOB

Re: Paths just don't work at all - 09/01/08 11:35

Hmmm, Crumply and MrGuest, what OS are you guys using?
Vista or XP ? It may be a Vista issue, I havent checked the Bug reports,
cause I dont know how... (Me Be Noob remember)

Lets see how DBJ master goes, and maybe you two could try moving
your projects and removing 'un-necessary' files for a test.
Posted By: crumply

Re: Paths just don't work at all - 09/01/08 13:42

I am using Windows Vista Business x86
Posted By: LarsW

Re: Paths just don't work at all - 10/09/08 09:30

Put two dots in front of one backslash.

#define PRAGMA_PATH "..\gfx";

It works for me.
© 2024 lite-C Forums