I'm posting this in the Triggers section because that's all I've really worked with so far. Right now I have developed a bunch of code that I can apply to different maps by (1) importing my custom DDS images, layout files, style files, etc (2) Making map/player config changes (3) Creating some special objects/effects in Data Editor (4) Copying trigger code from other map (5) Adjusting any code that hooks into map points/units (6!) Fixing all the broken lines of trigger code
This process is taking me about 2 hours per map because step 4 (copying trigger code) results in a bunch of broken/red lines that I then have to go in and fix manually. I've tried re-ordering the code to minimize this, but ultimately I'm not sure why some lines are not copying correctly.
Am I going about this the wrong way? What's the best way for copying/pasting entire sets of code (folders of folders of actions/triggers, about 100 in all) to another "fresh" Blizzard melee map?
You create this Mod, add all this information to it. And then for every map which you want to have that information, set the Mod as a dependancy. You'll need to upload the Mod as well as your maps, but in the long run this will be much better, as it is easier to set up, and when you change something it changes for all of them.
Essentially what you do is you go to Create New Document, and then change the dropdown menu that says "Map" to "Mod". It's essentially a map without terrain as I understand it.
Rollback Post to RevisionRollBack
I'm not working on any of my listed maps. I'm working on a fairly extensive... other project. Progress is coming rapidly.
Estimate: 70% towards a Playable Version.
If you just need a few lines of code it's easier to copy the entire trigger/function/action definition from the map containing the code you need (source map). Hereafter you change the active map to your own map (target map) and insert the code.
But first you have to:
Find all the global variables used in the code you copy from the source map. You have to copy these to your own map first.
Check if the global variables you just copied are initialized elsewhere in the source map, e.g. a unit variables points to a specific unit. Keep this in mind so that you can initialize the variables you copied correctly.
Select the trigger containing the code you need in the source map and copy the whole thing - not just the code part you need. By doing this you will also copy the local variables, keeping the references.
Go to the target map and insert the trigger.
Delete the trigger code parts don't need, tidy up the code and voilà.
The red lines appear when a reference is broken. This should no longer happen as you've copied all the variables and the references to these are intact. However, if an action points to a unit in the map, for instance, you may need to copy this unit as well or insert a replacement in your map and make the action in your trigger point to this unit.
Rollback Post to RevisionRollBack
"I reject to reality and substitude my own." - Adam Savage, Mythbusters
In addition to this you can use unit variables instead of direct references, using the "Pick all Units in Unit Group" function to define the unit. It might help make your life easier if you have a big cross-map project.
Thanks for posts. It sounds like the Mod would be a great route....however, the placement of points on the map, selection of destructible units, etc is going to be different for each map, so this isn't *entirely* a cookie-cutter kind of thing that I can apply to any map. Unfortunately I will need to "massage" the code a bit each time I port it to a new map. So...
I've already implemented most of the suggestions, but the problem is that it's taking too long as I have several thousands of lines of trigger code and this results in about 50 broken lines of code *even though the globals were copied in previously*. So I'm not sure why this is...seems like a bug (I've encountered several annoying bugs in the trigger and this seems related).
Additionally, whenever I make a bug fix in one map, I have to then manually make that change in all the other maps that use my system. This is extremely time consuming and opens up more possibility for errors/inconsistencies.
The more I think about it, maybe the best solution *is* to have a single mod with case statements in the initializers to see whether it is map X, Y, or Z, so that when it is applied to that map, it fires up the "massaged" part of the code specifically for that map. Does this sound feasible?
The way Dry and I are doing it for Tofu TMA is we are using mods.
. . Data Mod
. . . . Asset Mod
. . . . UI Asset Mod
And you should be using [ Records ]. Naughty naughty naughty. The reasons we are using 3 mods is that "balance" changes only require the download if a very tiny 500kb mod file, where as when adding new heroes, it requires the download of say a 1mb, asset file, where as the UI asset file will ve very rarely updated holds about 8-10mb of stuff.
There should be 1 function on your map called something like "Local Variables" (name doesnt matter), in which every single doodad, point, etc, anything map specific should be defined by variables! That way you can copy your whole engine over and you will only need to update 1 function and it won't break everything.
Or in the case of bug fixes, you delete and copy everything except for that one function and it will work fine (obviously don't delete the records).
I have never used triggers as part of a mod file, it is something I might look into in the future, but yes, what you said is exactly what I have done. You have basically a single variable to tell your engine which map it is and the engine will change to suit it.