Help With Editing war3map.j

Wynd

New Member
Reaction score
1
I've been through every intro map making tutorial I can find, and while many of them are great at explaining the workings of JASS, I can't seem to find one that explains how to directly edit a map in it.

I've reached the point where using the regular map editor to create triggers is very slow, and I'd like to be able to just edit my script file directly. I've attempted to do this with several MPQ editors, but it never seems to work right, and I feel like I must be missing something very simple. I've tried extracting war3map.j, editing it, deleting the old copy within the MPQ, then importing my new one. Sounds like it would work in theory, but as far as I can tell, the old one is never actually deleted (at least the map file is the same size even after deletion), and somehow the map editor still knows to load up using the old information. Is this how most designers do it, or is there an even easier way that people edit the map's script?

Any help here would be highly appreciated =)
 

Wynd

New Member
Reaction score
1
That works on a per-trigger basis, but you can't place multiple triggers into a single trigger converted to text (there's a definition section at the end of the trigger script that tells the map which triggers to call, and it won't list any extras you attempt to nest).

Technically, I could continue to use this system, but I need to make probably on the order of 100 or more triggers, all using very similar code. I can crank this out in fairly short time in a text editor, but I'd like to be able to paste it all in directly. Using the map editor, I'd have to: Click New Trigger, rename the trigger, go to menu and select Convert To Custom Text, copy portion of my text file, paste into World editor. That's a lot of extra steps, and I'm certain there's some way to avoid it.
 

Wynd

New Member
Reaction score
1
I don't want to put more ifs into my triggers =) I just want to edit the script directly, and I'm looking for help on that.
 

Wynd

New Member
Reaction score
1
Editing a Map Entirely in JASS

I asked this question in the general WEHelp forum and seem to have confused some people. I'm looking for a way to edit my script w/o using the World Editor to add and convert to custom text on every single trigger I wish to make. I assume this is done by editing war3map.j, but I have been unable to figure out how to do that (MPQ Editors either break the map, or the WE just restores the original .j file when it loads up).

I imagine that very complex maps are created entirely in a text editor and pasted directly into the script without using the World Editor. Is anyone here familiar with how this is/would be done?
 

Tom Jones

N/A
Reaction score
437
Main window, export the script, open it and edit it, then import it back into the map, either by using the import manager or a mpq archeiver. Don't know if it'll work, and I don't think really complex maps rules out the editor.
 

Wynd

New Member
Reaction score
1
Thanks, I'll try that out; sounds promising. I also just noticed that JassCraft has an MPQ viewer in it. It appears you can edit the .j file directly there, though I'm getting a dll error trying to save it =(
 

Wynd

New Member
Reaction score
1
Well exporting works great. Not sure how to import that back in as the default script though. It appears that WE wants to use it as an attachment (though it's unclear to me where it is attached).

You're right that even a complex map wouldn't rule out the editor. I just meant that there were certain bits of code that would take impossibly long using the editor, while you could write them out in a text editor relatively quickly, if only there were a way to paste them directly into the script. There are quite a few functions in the script that might be useful to play with also, but they're outside the bounds of what the WE lets you edit.
 

Tom Jones

N/A
Reaction score
437
If your using NewGen (You should), have a look at the inject possibility in the manual.
 

Wynd

New Member
Reaction score
1
Thanks for bearing with me ;) I know these must seem like really elementary questions. I'm a fair hand at programming, so picking up JASS syntax was easy. The hard part for me has been figuring out the other tools.

wc3campaigns.net is down for maintenance right now, so I can't get any of the newer tools. I'll try em out tomorrow and hopefully have better results.
 

Gwypaas

hook DoNothing MakeGUIUsersCrash
Reaction score
50
When WC3c gets up then go and check out the "Linux" thread made by Vexorian and the Warcity program, both threads are in the Tools section.
 

Sooda

Diversity enchants
Reaction score
318
> That's a lot of extra steps, and I'm certain there's some way to avoid it.

Paste most of your repeating functions to mapheader (in trigger editor it has name of your map). Then call with custom script your function from ordinary trigger.

Alternatively download Jass New Generation Pack (JNGP) and run it from command line which allows you to overwrite existing map script with your custom one.

Or start using JNGP to edit triggers. It has many good sides.
 

Never_Quit

New Member
Reaction score
16
That works on a per-trigger basis, but you can't place multiple triggers into a single trigger converted to text (there's a definition section at the end of the trigger script that tells the map which triggers to call, and it won't list any extras you attempt to nest).

Technically, I could continue to use this system, but I need to make probably on the order of 100 or more triggers, all using very similar code. I can crank this out in fairly short time in a text editor, but I'd like to be able to paste it all in directly. Using the map editor, I'd have to: Click New Trigger, rename the trigger, go to menu and select Convert To Custom Text, copy portion of my text file, paste into World editor. That's a lot of extra steps, and I'm certain there's some way to avoid it.

wth? i only use around 65 triggers per each of my games (one map contains multiboard, kill system, respawn systems, item builds, skill builds, map option selection buttons for host/each player, quest information, and various win loss conditions)

do you know how to use loops? (indexing regions and items are very useful)
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,494
No idea actually where you get that weirdo idea from that editing the final map script would be the way to go...
The time it takes to create a new trigger, rename it and convert it is strictly nothing compared to actually writing it.


Get NewGen, learn "advanced" JASS (scope + initializer), write all triggers that way, create and convert one single trigger, and paste it all in there.
(Optionally, forget that one trigger and paste it all in the map header...)

Works just fine but it's somewhat the wrong end of the problem.
 

Sevion

The DIY Ninja
Reaction score
413
Ace, lots of things work just fine, they are just too stubborn to do it. Thus, I try to stick with answering their question instead of finding alternatives (unless I know the person is open to alternatives) :p
 

Wynd

New Member
Reaction score
1
Ahh well, I am still learning the syntax, so there probably are much more efficient ways to do what I need with next triggers. While I was learning, it just seemed like it would be a whole lot easier to edit the script directly (you'd think the WE would have some option to do this, but it's the one thing it does not seem to let you do).

This thread has led me to a number of great programs (managed to find another site hosting the NewGen tools), and given me some coding techniques to think about. There's probably a way to consolidate some of my functions into just a few triggers, so I'm going to see if I can do that.

Thanks for all the help and suggestions =)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top