• 🏆 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!

[JASS] //! import

Status
Not open for further replies.

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,468
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.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,468
Well I'm using //! import "G:/file.zn" right now and it works, but that's not what I want. What I want is to import the .zn file into the map itself (like you would import a custom model) and trying to write that in -- this way, the person who downloads my map can open that file from the imports module to view the zinc script.
 
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