[SOLVED] - Problem with WED & attached scripts

Posted By: CyberGhost

[SOLVED] - Problem with WED & attached scripts - 08/01/14 22:24

Hello


I asked about that before in 'Starting with Gamestudio' section and no one answered me


MY ISSUE:

In WED, I attached a level to my main script in "Map properties" window. The main script itself is 'attached' successfully ,but the scripts included in the main script (through "#include") are NOT attached. WED keeps saying "Can't open this.c or that.c". Also, when I try to run the level (after being compiled), it can't even open the main script itself although WED didn't complain about main script during attaching. Is that normal? I think the scripts attached with <> not "" work well. It is my own scripts that don't work.


This problem also prevents me from attaching actions to entities as the scripts having these actions can't be opened by WED ,so I can't find them in the action list


Thanks for reading & any help will be appreciated
Posted By: 3run

Re: Problem with WED & attached scripts - 08/02/14 06:48

I have few ideas in my head:
1-make sure that you've defined all game folders which you have in your project's root folder;
2-make sure that your scripts are placed in defined folders (or in project's root folder);
3-make sure to include all of your own scripts by "" (instead of <> - use those only to include engine lib) f.e. #include "player.c".

I'm sure if you go through all this steps, you'll get everything working laugh good luck!

Greets
Posted By: Reconnoiter

Re: Problem with WED & attached scripts - 08/02/14 15:30

DLively already gave you the answer earlier tongue :

Quote:
Quote:
1) I attached a level to my main script in "Map properties" window.

You mean: You attached a script to a level.

There are TWO KINDS OF INCLUDES:

#include <mtlFX.c> //Default files
#include "thisoniscustom.c" //custom files


From the holy manual:

Quote:
If the script name is given in angular brackets <..>, it is searched in the include folder. The include folder contains all common .h include files and the default.c script.
If the script name is given in double quotes "...", it is first searched in the work folder, then in the path defined by PRAGMA_PATH. The file search PATHs given in a WDL file are irrelevant for #include statements.
Posted By: CyberGhost

Re: Problem with WED & attached scripts - 08/02/14 20:33

Wait a minute ... Do you only write the script's name ("script.c") or the RELATIVE path for the script ("scripts/script.c"). All the time I was doing the latter ,but when I only wrote the script's name, it worked.


Also, if the script was empty, it will give "can't open" error ,right?
Posted By: 3run

Re: Problem with WED & attached scripts - 08/03/14 05:34

yes, it will laugh
Posted By: FBL

Re: Problem with WED & attached scripts - 08/03/14 08:57

it's PRAGMA_PATH and script references without any path.
Posted By: CyberGhost

Re: Problem with WED & attached scripts - 08/03/14 14:12

Ok. Thank you all laugh
© 2024 lite-C Forums