Jump to content
Sign in to follow this  
ZNorQ

What is the root of..?

Recommended Posts

Lets say I have a mission where the folder is called "mymission.sara", and under that was a folder called "myfolder"..

If I where to include a file in a script under myfolder called myvars.hpp, what would be the correct path if I started with '\'?

Structure;

- mymission.sara

- myfolder

- myvars.hpp

#Include "\..?..\myvars.hpp"

ZNorQ

Share this post


Link to post
Share on other sites

If I understand you corectly it sould be

\myfolder\myvars.hpp

This also seems the most logic one cause not everybody instals there game in the same location.

Share this post


Link to post
Share on other sites

#include directive is very limited in what it can include.

It can only include files which are in the same folder or a sub-folder from it's current folder.

Unfortunately, it cannot include files:<ul>[*]relative to the root folder, unless the script is already in the root folder

[*]which is in a different branch of the mission (like execVM can).

A request to fix this limitation is on the bug tracker as 0002793: Allow #include to support mission root relative paths

So

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#include "myfolder\myvars.hpp"

would work from file description.ext, but not from subFolderB\fileB.hpp

Share this post


Link to post
Share on other sites
If I understand you corectly it sould be

\myfolder\myvars.hpp

This also seems the most logic one cause not everybody instals there game in the same location.

Believe me, I've tried that, but it don't work... Can't find the file.. I know the question sounds stupid, but try including files that is in a complete different directory from root - down..

ZNorQ.

Share this post


Link to post
Share on other sites
#include directive is very limited in what it can include.

It can only include files which are in the same folder or a sub-folder from it's current folder.

Unfortunately, it cannot include files:<ul>[*]relative to the root folder, unless the script is already in the root folder

[*]which is in a different branch of the mission (like execVM can).

A request to fix this limitation is on the bug tracker as 0002793: Allow #include to support mission root relative paths

So

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#include "myfolder\myvars.hpp"

would work from file description.ext, but not from subFolderB\fileB.hpp

Ok, thats why I couldn't use include the way I wanted. Damn, now I need to do a complete restructure of my directory tree... Thats a load of pain I really don't need right now.. Thanks a lot, BIS! tounge2.gif

I fully back your bug report up. This is a limitation I don't really see the point of...

Thanks for the feedback, Dr_Eyeball. As usual, you've been a great source of help! smile_o.gif

Share this post


Link to post
Share on other sites
I fully back your bug report up.

If you do "fully" back it, then don't forget to add a vote for it on the bug tracker... tounge2.gif

Share this post


Link to post
Share on other sites

hm relative path would be nice, however you always have your

mission or pbo as base to build up the path.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#include "\bin\h\Core.hpp"

// bin pbo in ArmA\dta

#include "\PROPER_Sara\h\CfgPatches.hpp"

// PROPER_Sara pbo in ArmA\SomeModfolder\addons

in addition you can make "full qualified" absolute path from the

modfolder-addons or dta directory:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#include "\@PROPER\addons\PROPER_AI_Test_Framework_Configuration\SourceFiles\PROPER_Dta_Bin_Config_Base.hpp"

// PROPER_AI_Test_Framework_Configuration folder in ArmA\@PROPER\addons\PROPER_AI_Test_Framework_Configuration\SourceFiles

#include "\dta\SIX_Blood.hpp"

// dta folder in ArmA

So relative path would add some good comfort, however you

can do almost all right now or do I miss your point? whistle.gif

Share this post


Link to post
Share on other sites
I fully back your bug report up.

If you do "fully" back it, then don't forget to add a vote for it on the bug tracker... tounge2.gif

Hehe, sorry, I didn't know there was a voting system. I'm not familiar with the apperantly new bugtracking system for ArmA... I'll try familiarize myself with it and vote when I get the time... I promise! tounge2.gif

ZNorQ

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×