Feature #5121

Allow more flexibility in #include paths

Added by sbsmac over 5 years ago. Updated about 2 years ago.

Status:Assigned Start date:10/12/2009
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:Scripting: Problem
Target version:-
Affected ArmA II version:Please select... First affected ArmA II version:
Reproduced by another DH user:No Single / Multi Player?:
I am using some Mods:No BIForumURL:
I am using: NGUrl:
Reproducible for you:No WIKIurl:
Related to content of DLC:

Description

I would like to be able to define common macros in a header file and #include them from other parts of the mission file heirarchy.

Eg,

missions/test.utes/lib/common.h
missions/test.utes/scripts/main.sqf

where main.sqf includes common.h

Unfortunately, this is not possible since the paths for #include are relative to the file where it has been used.

It wouuld be desirable if #include recognised '..' for parent dir or alternatively recognised a leading slash '/' to indicate a path relative to the mission root.

As a supplementary point... I believe addons use a different path mechanism - it would be rather nice if the use of paths within different parts of arma was harmonised !


Related issues

related to ARMA2 Community Issue Tracker - Bug #8275: Using #include from mission editor with relative path Assigned 01/19/2010

History

Updated by Fireball over 5 years ago

  • Due date set to 01/12/2010
  • Category set to Scripting: Problem
  • Status changed from New to Assigned
  • Affected ArmA II version changed from Please select... to 1.04.59026

Updated by Fireball over 5 years ago

  • Tracker changed from Bug to Feature

Updated by kju over 5 years ago

  • Due date deleted (01/12/2010)

Updated by CarlGustaffa over 5 years ago

Would be nice indeed. Meanwhile as a workaround, use Dominations approach:
Have a .bat (DOS batch file) copy all the needed include files into all directories where they are used.

Updated by kju almost 5 years ago

  • Affected ArmA II version changed from 1.04.59026 to Please select...
  • Audio card set to Please specify!
  • Size of OS swap file set to Please specify!

Updated by ruebe over 3 years ago

For the love of god, would someone fix this issue already? IMHO include is broken for aslong as we can't access parent folders (up to the missions root directory) or access the missions root folder with a blackslash in an absolute fashion.

CarlGustaffa wrote:

Meanwhile as a workaround, use Dominations approach:
Have a .bat (DOS batch file) copy all the needed include files into all directories where they are used.

If this is the best solution we've got, then this perfectly demonstrates how broken include currently is. Copying a file to all the places where it's needed is exactly what one tries to avoid with the include statement. This "workaround" leads the "include"-approach to absurdum. Come on, this is simply ridiculous!

Argh! :|

Updated by Sickboy over 3 years ago

For the time being you could put the includes in an addon pbo and include from the pbo.

Updated by Squelch about 2 years ago

There is an undocumented feature that may help in the issue.

A folder named "Scripts" under the game root, or even in the game folder under users are treated as valid search paths. Scripts placed in these locations are available globally, so mod tagging would be prudent.

Also available in: Atom PDF