• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] //! import

Status
Not open for further replies.
Yeah, this little punk.

Does the file have to be from my computer? I just want it to be an import from the internal "import" module.

Is this possible? I tried every combination of "use custom path".

JASS:
//! import zinc "file.zn"
//! import zinc file.zn

//After changing the file folder...

//! import zinc "zinc/file.zn"
//! import zinc zinc/file.zn

//! import "file.zn"
//! import "file"
None of the above methods worked.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Well first of all you absolutely have to surround the file path in quotes or else it will give you a syntax error.

JassHelper said:
JassHelper also includes a //! import preprocessor like WEHelper's, it allows you to import external files.

The usage is //! import "scriptfile" , you can use fixed paths or relative paths.

For example: //! import "c:\x.j" will include x.j file located on c:\ in your map script. It is effectively like pasting the file there before compiling it, so the file can include globals, libraries, textmacros, etc. It can even use //! import itself

If you use //! import twice or more on the same file name , the command is ignored.

Relative paths are allowed, for example: //! import "x.j" or //! import "subfolder\f.j" will use relative paths. When the path is relative JassHelper will look for the script file in the map's folder or in the lookup folders set in JassHelper's configuration.

Where is this .zn file saved? I usually use text documents.
 
Level 13
Joined
Mar 19, 2010
Messages
870
Hey, is this feature still possible? I opened my old map and get this error. Can i still import external code?

1627639838585.png



EDIT: I don't know why but today i need an absolute path to get it run.
 
Last edited:
Status
Not open for further replies.
Top