Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,306 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Paths just don't work at all #223650
08/25/08 17:38
08/25/08 17:38
Joined: Mar 2008
Posts: 67
crumply Offline OP
Junior Member
crumply  Offline OP
Junior Member

Joined: Mar 2008
Posts: 67
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?

Re: Paths just don't work at all [Re: crumply] #223711
08/26/08 07:58
08/26/08 07:58

C
cemetarycat
Unregistered
cemetarycat
Unregistered
C




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

Re: Paths just don't work at all [Re: ] #223811
08/26/08 19:35
08/26/08 19:35
Joined: Mar 2008
Posts: 67
crumply Offline OP
Junior Member
crumply  Offline OP
Junior Member

Joined: Mar 2008
Posts: 67
Cool, I changed that but the problem seems to be with ent_create. Does it not support paths?

Re: Paths just don't work at all [Re: crumply] #223849
08/26/08 22:48
08/26/08 22:48

C
cemetarycat
Unregistered
cemetarycat
Unregistered
C




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



Re: Paths just don't work at all [Re: ] #224421
08/30/08 00:23
08/30/08 00:23
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
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.

Re: Paths just don't work at all [Re: DJBMASTER] #224441
08/30/08 05:27
08/30/08 05:27
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
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.



Last edited by EvilSOB; 08/30/08 06:13. Reason: Research Complete

"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Paths just don't work at all [Re: EvilSOB] #224460
08/30/08 11:34
08/30/08 11:34
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
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.

Re: Paths just don't work at all [Re: DJBMASTER] #224498
08/30/08 14:35
08/30/08 14:35
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
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.


Last edited by EvilSOB; 08/31/08 00:15.

"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Paths just don't work at all [Re: EvilSOB] #224589
08/31/08 07:10
08/31/08 07:10
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
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

Re: Paths just don't work at all [Re: DJBMASTER] #224592
08/31/08 07:33
08/31/08 07:33
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
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)


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1