• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Using //! import with "relative" file paths

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,337
Hi,

So suppose I have some uniquely named directory foo which always has my file bar.j (my map's script).

Now AFAIK, I need to supply the absolute path to //! import, otherwise it won't find my map script bar.j

JASS:
//! import "C:/users/me/desktop/foo/bar.j"

Now that's fine and dandy, but it's kind of ugly for a number of reasons. I've listed two off the top of my head.

1. It's specific to a user/a filesystem

2. anyone else who wants to work on the script or test the map needs to put bar.j in the same space

So instead if we know the folder and filename is unique irrespective of filesystem or OS, couldn't the import simply be something like

JASS:
//! import "foo/bar.j"

And then behind the scenes it searches from the root of the entire filesystem and works its way down (depth first search if you'd like). Eventually it will run into some folder call "foo" and hopefully it has a file called "bar.j" inside it.

Now why doesn't it do this--doing the depth first search is trivial AFAIK.
 
Last edited:
Status
Not open for further replies.
Top