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

Reading XML Data via FileImport

Status
Not open for further replies.
Level 19
Joined
Aug 8, 2007
Messages
2,765
I was wondering if there was a way to read XML data via a //! import call, because the way I have it set up, its very tedious to create items (and very ugly) so i thought XML would make it easier.
 
You would have to program your own interpreter. The //! import directive is normally used for .j files. It will either show errors or do nothing at all to the xml file.

Otherwise I recommend that you look into GMSI. It helps a lot for tedious creations. You can also use Lua but some people say it doesn't work on Windows 8, and it is a bit limited in some aspects compared to GMSI.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
You would have to program your own interpreter. The //! import directive is normally used for .j files. It will either show errors or do nothing at all to the xml file.

Otherwise I recommend that you look into GMSI. It helps a lot for tedious creations. You can also use Lua but some people say it doesn't work on Windows 8, and it is a bit limited in some aspects compared to GMSI.

Is there a tutorial about creating a custom compiler? Would be easier to just do it that way..
 
It depends on what you are trying to do. Are you trying to make objects or are you just trying to type JASS code?

Creating a custom compiler probably isn't the easier task. If you are making objects, then your compiler would have to translate your XML code to write the particular objects into the map's MPQ, similar to what GMSI/Lua does. Alternatively (better option IMO), you could write a parser to translate your XML code into GMSI code or Lua code. But of course, this means you have to have knowledge of the code you're translating to. So if it is just for personal use, then you might as well use the GMSI or Lua code. :p
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
It depends on what you are trying to do. Are you trying to make objects or are you just trying to type JASS code?

Creating a custom compiler probably isn't the easier task. If you are making objects, then your compiler would have to translate your XML code to write the particular objects into the map's MPQ, similar to what GMSI/Lua does. Alternatively (better option IMO), you could write a parser to translate your XML code into GMSI code or Lua code. But of course, this means you have to have knowledge of the code you're translating to. So if it is just for personal use, then you might as well use the GMSI or Lua code. :p

Lua doesn't work on my machine to begin with.

Also, im quite familiar with accessing MPQs and reading XML code in a program, I just dont know the part about accessing the compiler.
 
You would have to program your own interpreter. The //! import directive is normally used for .j files. It will either show errors or do nothing at all to the xml file.

Otherwise I recommend that you look into GMSI. It helps a lot for tedious creations. You can also use Lua but some people say it doesn't work on Windows 8, and it is a bit limited in some aspects compared to GMSI.

It also works for .zn files or zinc files.
 
Also, im quite familiar with accessing MPQs and reading XML code in a program, I just dont know the part about accessing the compiler.

If you want to access the actual compiler to support your plan for editing the //! import directive, you would have to edit the source of jasshelper. It may be an interesting project. :)

Otherwise you would make your own parser to read the XML and apply the changes to the map. I can't really describe how because there isn't a fixed answer on that (it takes time, and depends on which programming language you use to write it). Plus, I'm not too knowledgeable on reading the mpq files for objects.

@Almia: Thanks. Didn't know.
 
Status
Not open for further replies.
Top