• 🏆 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!
  • ✅ HD Level Design Contest #1 POLL is now OPEN! Check out the stunning visuals of the final entries. 🔗Click here to cast your vote!

Editing war3map.j with LUA [!]

Status
Not open for further replies.
Level 9
Joined
Jun 21, 2012
Messages
432
ladik's MPQ? mmm i don't know, the purpose is as follows:

I have a system X: the user use some functions and save the map, here is when LUA code enter in action: it search all the system X functions and then these will re-written into another code.

I remember that the war3map.j compiled by jasshelper is stored into the logs folder of newgen if I'm right, there could be edited directly and then import into the map. But the command //! import would not work in this case. :goblin_jawdrop:
 
Use Lua's os.execute() to execute the mpq editor program to inject the edited war3map.j into your map.

EDIT: I don't remember Ladik's command line arguments, but you can always just use WurstScript's CLI extractor/injector:
https://github.com/peq/WurstScript/tree/master/MpqCL/Release

They use it for a similar purpose. It looks like this is the format:
Code:
"Usages:"
"mpqcl.exe extract <path_to_map> <file_to_extraxt> <where to store file>"
"mpqcl.exe inject <path_to_map> <path_in_mpq> <where to get file>"

I'm not sure whether Lua is executed before or after vJASS is compiled. If it is executed before, then you'll need to extract, process it, and then inject it back into your map. If it is executed after, then you can just use the war3map.j log, process it, and inject it into the map.
 
What exactly are you trying to do with your system? If this is for public, then yeah, having a bunch of extra implementation steps is a big turnoff. I thought this was for a personal project.

If it adds something significant or new, then it may see use--in which case, you can just ship the exe and the scripts all together. Otherwise, consider looking for a workaround.
 
Level 9
Joined
Jun 21, 2012
Messages
432
as I told nestharus: I want to make a sub-compiler for a system (actually for my
http://www.hiveworkshop.com/forums/submissions-414/snipet-dimensional-array-265011/), this sub-compiler will change all functions called by the user replacing for native functions and and if possible it launches some errors, for example:

JASS:
//input:
set var[0][1].integer=123

//output:
call SaveInteger(var,StringHash(",0,1"),123)

that would be great ^^
 
Status
Not open for further replies.
Top