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

Tool: make WEU maps openable WE

Level 29
Joined
Jul 29, 2007
Messages
5,174
I have written code that, given a map/campaign, will try to look for any non-standard GUI and convert it to something that the World Editor understands.
This is mostly relevant to maps made with World Editor Unlimited and its extended GUI.

Here's where you can try it: https://viewer.hiveworkshop.com/weu/

To check a map/campaign, simply drag it into the page.
If there were any changes, the page will download for you the same map, with "no_weu" added to the file name.

Note: Only TFT maps/campaigns are checked, because RoC does not have custom scripts! However, if you have a RoC map with custom GUI, I would like getting it.

Things to expect:
  • Many custom GUI events/conditions/actions simply expose Jass natives directly. In many cases these can be converted back to something GUI can understand. For example, if SetHeroStr is used, and the change is permanent, it can be replaced with ModifyHeroStat.
  • If GUI conversion is not possible, custom scripts are used instead. This generally handles most of the changes, usually for simple things like RemoveLocation, DestroyGroup, DestroyTrigger, and so on.
  • When a function that accepts code / boolexpr - such as ForGroup and ForForce - has to be converted to custom script, the code / boolexpr part will be converted to a Jass function in the map's header.
  • RoC control flow blocks, like IfThenElse, ForGroup, and ForForce, may be converted to their TFT versions, such as IfTheElseMultiple, in cases where it will allow to only convert a part of them, rather than the whole blocks.
  • Preplaced objects that will lose all GUI references to them due to the conversion are referenced in an added trigger called PreplacedObjectReferences. This trigger is off by default and has no events, so it won't actually run. It contains actions that reference the needed preplaced objects. Currently this is done for units and destructables (anything else needed?)
  • Custom scripts may be added to conditions. WE has no issue with "actions" being in condition blocks, it just doesn't allow you to add them. Unfortunately this cannot be applied to trigger conditions.
  • 1.29 PTR functions who's names were prepended with Blz for non-PTR will be converted in the same manner.
    For example SetHeroProperName turns to BlzSetHeroProperName.
  • You may see seemingly broken custom scripts ending with /* and beginning with */. This is intentional, as they are one long custom script split into multiple lines.
  • Whole triggers may be converted to Jass when needed, but this is a last resort. After all, the goal of this project is to attempt to change the GUI as little as possible.
  • After all of the conversions are done, the triggers file gets read again using only the vanilla data to validate the conversions.
Things to not expect:
  • If the map was protected/optimized and has no triggers, they aren't going to magically come back.
  • If the map is using real custom functions, such as maps made in YDWE, it's very unlikely that it will run in the game, even if you can open it in WE. You will know when you save it in WE and get syntax errors.
Current data set used:
  • Vanilla 1.29.2's TriggerData.txt
  • WEU's TriggerData.txt
  • An updated version of YDWE's TriggerData.txt (taken from here)
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
- Changed from a small hardcoded subset of possible functions/presets to using external TriggerData.txt files instead. This currently includes the WEU trigger data and most(?) of the YDWE trigger data.
- In addition, all natives from common.j are grabbed as well, just to be safe.
- Campaign files can now be checked too, in which case every map inside them will be checked.
- Added IsUnitInRange->DistanceBetweenPoints conversion.
- Added error messages in case the trigger or custom text trigger files fail to be read (e.g. protections).
 
Last edited:
Level 23
Joined
Jul 26, 2008
Messages
1,305
WoW! Ghost wolf! You added most YDWE trigger data and allowed campaign files to be checked! Thank you so much! This will go so far to allowing maps which cannot be updated with the newest match due to their modified editor not being supported any longer to be playable by others! Thank you so much!

As soon as I have a chance to get to my computer I will upload it and let you know how it goes :)
 
Level 23
Joined
Jul 26, 2008
Messages
1,305
Hi ghost wolf, i am just curious, if i use your tool and convert a map, then start to use it (for translation), if in the future you make a new update, does that mean i should start again because there might be a bug that will cripple the conversion? Or is this a thing where the only way to improve this program is for people (like me) to try them out then let you know about them. Thanks :)


Edit: It seems every map in the campaign cannot be opened except the first map. They keep saying "main map file cannot be opened"


upload_2018-6-8_21-54-54.png




Edit2: Ok, it seems some of the maps are openable, and interestingly enough, the ones openable are the ones that are above a map that is "slanted to the right".


upload_2018-6-8_22-6-38.png




So in this example, maps 1, 7, 10 and 14 can be opened. Does anyone with experience making campaigns know what the significance of the slant to the right? I am curious if it is a problem with the conversion, or if it is actually fixable just in the editor. I only ask because the pattern of the maps above a slant all being openable indicates there is something going on (its not random).


Edit3: Ok it seems that there is some corruption involved. The campaign will not show up on the campaign menu, and when I try to save the campaign it errors.


upload_2018-6-9_1-59-47.png






upload_2018-6-9_2-1-14.png




Perhaps those maps that cannot be opened have trigger data that has not converted?
 
Last edited:
Level 23
Joined
Jul 26, 2008
Messages
1,305
I have been trying to find ways around the unopenable map, but nothing seems to be working. I am now 100% sure it is not the campaign issue, but that the maps that cannot be opened have something in them that is messing with the campaign. I posted the screenshots in the above post.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
All of these errors don't (as far as I know) have anything to do with GUI.

Try to open e.g. 11.w3x directly, same error of "Can't load main map file" before it even looks at the map data, which makes sense because it can't open the map data :p

The question is why it can't open the maps, and so far I can't come to any conclusion. As far as I can tell they don't seem to be broken. I'll keep looking.

/edit
Pinpointed it to the war3map.w3i file, i.e. map information (players, forces, tech, etc.)
11.w3x opens fine with a fresh information file.
I still have no clue why, gotta keep looking.

/edit
Nope. It has something to do with my MPQ code, the maps themselves work if you take them out of the campaign, I just got confused because MPQEditor and WE kept blocking each other.
However you won't be able to even extract the ones that are broken, not because the maps are broken, but because their entries in the archive are broken.

/edit
- Internal maps are now saved in one uncompressed chunk correctly. Makes sense, no need to compress an archive in an archive.

I opened a few of the previously unopenable maps, everything seems to work.
 
Last edited:
Level 23
Joined
Jul 26, 2008
Messages
1,305
All of these errors don't (as far as I know) have anything to do with GUI.

Try to open e.g. 11.w3x directly, same error of "Can't load main map file" before it even looks at the map data, which makes sense because it can't open the map data :p

The question is why it can't open the maps, and so far I can't come to any conclusion. As far as I can tell they don't seem to be broken. I'll keep looking.

/edit
Pinpointed it to the war3map.w3i file, i.e. map information (players, forces, tech, etc.)
11.w3x opens fine with a fresh information file.
I still have no clue why, gotta keep looking.

/edit
Nope. It has something to do with my MPQ code, the maps themselves work if you take them out of the campaign, I just got confused because MPQEditor and WE kept blocking each other.
However you won't be able to even extract the ones that are broken, not because the maps are broken, but because their entries in the archive are broken.

/edit
- Internal maps are now saved in one uncompressed chunk correctly. Makes sense, no need to compress an archive in an archive.

I opened a few of the previously unopenable maps, everything seems to work.
Hi Ghostwolf, where i was mentioning the slant, i mean the maps above a slant can be opened. So when you mentioned 11.w3x could not be opened, that is because it is the map slanted to the right, but from what I found through trying to open all the maps, only maps that are above a slant are openable (so 10 was the one above the slanted 11, so it was openable).

So, what I read from your edit, if a map is broken, there is nothing I can do about it o_O. Just curious, not disappointed or anything. Just trying to assess what extent of the maps are not openable, since this campaign might be an example of many other campaigns that I wanted to try to translate. In any case, using a non-WE editor was risky I guess. Perhaps those maps just will not be able to be transferred over to 1.29. It is unfortunate, but hopefully with the patch 1.29+, people will not need to use extended editors, and then we will never have these issues :p. (Except if those communities stay on patch 1.20e or 1.24, then I will never be able to translate them over :(). Anyway, I really appreciate what you have done! Hopefully others people who are trying to convert maps over will have better luck :D
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Not sure what you mean, the campaign now opens, I just saved the internal maps in a way that WC3 doesn't like.

The only "broken" thing as far as I could see is that all Chinese is converted to underlines, because the locale is set to default. Unless you have a Chinese Warcraft 3 installed :p
 
Level 23
Joined
Jul 26, 2008
Messages
1,305
Wait what! AHHHHH, ghost wolf! Sorry I completely misinterpreted what you meant, i thought you meant the maps were still not openable. I am away from my editor so I could not check. That is awesome!!! I will be so happy to hop onto war3 tonight to check it out! Thank you :)

Edit: All the maps seem to be playable. I am now going through all of them to check if there is anything wrong. :p
 
Last edited:
Level 23
Joined
Jul 26, 2008
Messages
1,305
Hi GhostWolf, Sorry to bother you (and for double posting). Is there anything that could be causing the editor to crash when individual maps in the campaign are edited and then saved? I can edit the main campaign file fine (i.e changing the names of the missions). But as soon as I try to make one small edit to a map within the campaign, and then save it, it completely crashes. I was unable to test this before, since I was taking screenshots of all the dialogue then translating into a word document. But now that all of that is done, and I try to actually edit the individual maps (to paste all the dialogues in), it just crashes instantly when i try to save.

upload_2018-6-16_18-33-50.png



The Exact Crash Log It Provides:

Problem signature:
Problem Event Name: BEX
Application Name: World Editor.exe
Application Version: 1.28.5.7680
Application Timestamp: 5956f030
Fault Module Name: StackHash_0a9e
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 00000000
Exception Offset: 19f3730c
Exception Code: c0000005
Exception Data: 00000008
OS Version: 6.1.7601.2.1.0.256.4
Locale ID: 3081
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

Read our privacy statement online:
Windows 7 Privacy Statement

If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt



I am using the latest version of Warcraft 3, if you are curious.
 
Last edited:
Level 23
Joined
Jul 26, 2008
Messages
1,305
The only thing I might have done differently from you is that after i used your program to convert it, i first saved it on the 1.29 editor. From there, all i did was to first play around with the campaign editor itself, and the changes there I made were saveable (renaming the some chapter names and numbers. After that, I tried to edit the dialogue, and saving the map then crashed. I tried it again, just to change one dialogue, and it crashed. I can give send you my version of the map (should be no different from yours, except I saved it on the 1.29 editor after I used your program to convert it.)
 
Level 23
Joined
Jul 26, 2008
Messages
1,305
Hi. I noticed it said 1.28.5 also, I have no clue why, since I am on battle.net.
The only one i tried to edit was the map one. I did not even try 2, i just kept trying the same map (silly of me to expect different results).
Just to be clear, by map one I mean the prologue (the non playable cinematic, it is the first map in the campaign though).
 
Level 23
Joined
Jul 26, 2008
Messages
1,305
My warcraft 3 is 100% english. Just out of curiosity, would you happen to know if the editor being 1.28 could possibly be causing this? I am investigating if my warcraft 3 editor is somehow out of sync with my warcraft 3 version (I know that sounds stupid, I am trying to get to the bottom of this). If it is working for you, then the issue must be on my end though, which is relieving since i originally thought it was something that could not be fixed. I will probably try a complete reinstall to see if there is any difference.
 
My warcraft 3 is 100% english. Just out of curiosity, would you happen to know if the editor being 1.28 could possibly be causing this? I am investigating if my warcraft 3 editor is somehow out of sync with my warcraft 3 version (I know that sounds stupid, I am trying to get to the bottom of this). If it is working for you, then the issue must be on my end though, which is relieving since i originally thought it was something that could not be fixed. I will probably try a complete reinstall to see if there is any difference.

You can right click your "World Editor.exe" and in the details tab you should see the version.
 
Level 23
Joined
Jul 26, 2008
Messages
1,305
I am not sure, since it works for me. That being said, I am getting trigger compilation errors because it doesn't like trigger names starting with underscores, however the maps save.
Is your installation non-English?

Hi GhostWolf, it seemed i was using 1.28 this whole time..

Anyway, when i finally got 1.29 editor up, it was giving me these syntac errors also:


upload_2018-6-17_16-45-19.png


In reference to your post, can i ask, does this mean that this is occuring due to the editor not liking trigger names starting with underscores? ( I could just try to remove all of the underscores and then try saving.

Edit1: So that error I mentioned did not crash the editor, it just showed me that box. The map apprarently still saved, since when I opened up the campaign again, the one line of lialogue that I had changed was still there.

upload_2018-6-17_16-50-59.png




Edit 2: Ok, so i tried to go actually play the map to see if it was showing the change just out of curiosity. The custom campaign showed in the custom campaign menu area, I clicked it, but when I went to click on the first mission, it gave me this screen:


upload_2018-6-17_17-1-46.png




I did multiple testing, and I do not believe it had anything to do with the 1 line of dialogue edited. I came to this conclusion because I went back to the version of the campaign your tool gave me after converting the triggers. I tried it also, and the exact same thing happened to me. So I do not think this is related to the edit I made. I went and tried the version of the campaign I have that never underwent change by your tool. It worked perfectly (except of course the dialogue was all spaces since the computer could not read anything).

Edit 3: Since the black mask thing did not actually crash war3 ( I had to exit it with alt f4 since there was no way I could get out of it ), there was no crash log recorded. There were only 2 files that were created at the same time the error happened, I have copy pasted them below (only 6 lines).


6/17 17:12:15.994 Error (UI\FrameDef\UI\ConsoleUI.fdf:6027): Expected ",", but found "AlphaMode"

6/17 17:12:15.994 (UI\FrameDef\UI\ConsoleUI.fdf//6027) Warning, unknown keyword in context: Literal String
6/17 17:12:15.994 (UI\FrameDef\UI\ConsoleUI.fdf//6027) Warning, unknown keyword in context: ,



6/17 17:12:15.752 GameMain Started
6/17 17:12:15.752 Command Line: "C:\Program Files (x86)\Warcraft III\Warcraft III.exe"
6/17 17:12:15.932 Telemetry Launch Info:
process_name: "Warcraft III.exe"
current_expansion_version: "W3XP"
highest_expansion_version: "W3XP"


6/17 17:12:36.245 GameMain Ended





I wish I could be of more help, but it seems all I can do is report what I find :/
 
Last edited:
Level 23
Joined
Jul 26, 2008
Messages
1,305
Well I mean, the error seems to be localized to the map that was edited. I can still "play" any other map that I did not tamper with (of course, all the dialogue is just space). I apologize if some of the things I say seem silly, I am completely out of my depth with all of this stuff.
I have only ever used the normal editor, so I have never encountered these kinds of errors before, unless I add a JASS spell from hive and do not do it correctly. Is it possible that it might not be realistic to convert maps using YDWE, and allow for editing (I say allow for editing because technically if there was not this language issue, then your conversion tool would be the only thing necessary, there would be no need to open the map at all)


Edit 1: I am going through every single map in the campaign to see if i can distinguish a pattern. I will make a tiny edit to a dialogue then try saving the map and see what happens.

Edit 2: So far, maps 2,4,6,7,8 can save. Maps 1 and 3 seem to have the same problem in that the error is related to the first line of the custom script. Map 5 has a different error, it was related to a "symbol" as described in the error.

Edit 3: Maps 9,10,11 save without problem.

Edit 4: Map 12 has 3 errors, one beginning with play thematic music
Map 13 has 9 errors, no identifiable problem
Map 14 has the same error as map 1 and 3, related to the first line of custom script
Map 15 has no problem.

Edit 4: Maps 16, 19, 20 work.
Map 17 has an error with the first line of custom script, but it is related to a boolean
Map 18 has the same error as map 1,3 and 14.

I am not sure if that helped at all. I would be happy to do any testing if that can give you feedback on what is happening in the map.

In summary-



Maps 2,4,6,7,8,9,10,11,15,16,19,20 all work fine (by fine I mean i can change a small thing in the dialogue and it can save).
Maps 1,3, 14 and 18 all have the same problem with the first line of custom script
Map 5 has an error with a "symbol"
Map 12 has 3 errors, one beginning with play thematic music
map 13 has 9 errors with no identifiable problem
Map 17 also has an error with the first line of custom script but it is related to a boolean (different from map 1,3,14 and 18)
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
After further looking, there are a couple of issues.

Function names apparently can't start with underscores, so I changed that. String paths also didn't properly use \\ and now they do.

Fixing these makes the map openable in the game....but not really, because the screen is black, never loads, and only the mouse is visible.

So how to open it?

The second trigger causes the infinite black screen - changing the event from Map Initialization to something else, e.g. "Elapsed game time is 0.0 seconds" causes the map to actually open properly.
I have no clue if this has anything to do with YDWE, or if it's related to patch 1.29 or something else.

I still don't know if the trigger works as intended and the cinematic runs properly, that's something you'd have to check.
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
Fixed more issues.

I tested all of the maps you mentioned are failing, and after the fixes the results are:
13.w3x - 2 preplaced units not found.
14.w3x - 9 preplaced units not found + YDWETimerDestroyTimer is used.

I don't know if the preplaced unit issues have anything to do with YDWE, since they are not referenced by names, so the Chinese shouldn't matter. I think.

YDWETimerDestroyTimer is a custom function and a part of a larger system in Jass that YDWE implements, and cannot be replaced automatically, you'll have to handle that yourself.

All of the other maps save with no issues as far as I can tell.
 
Level 23
Joined
Jul 26, 2008
Messages
1,305
Hi Ghostwolf! Thank you so much for doing this! I will deal with map 13 and 14 myself. If you do not mind, I want to quickly clarify a few issues as sometimes I have trouble following :p

1) According to your post above, should the first thing i do is change every trigger starting with "map initialisation" and change it to something else (like elapsed game time is 0.0 seconds)?

2) To your knowledge, do the errors that come up from saving emerge from the editing process, or are they actually errors that exist regardless of editing. I ask this because, one solution to this mess might be me going and downloading YDWE with 1.24/1.20e warcraft 3, adding the translation there, and then using your tool to convert it so there is no need to edit.
Note: Even if the errors are there regardless of editing, I will still probably start from the original, since this way I control the input, which gives me far more control, whereas if i just play around with the output (the map converted by your tool), I have less control anyway.

3) Most importantly, if in the future I am trying to bring over campaigns made with YDWE to hive, would you prefer if I do not post here? I say this because there is a very strong chance I will be the only person ever using the YDWE conversion for your tool. From what i understand, the main blizzard subsidiary in their region (net ease) has found a way to allow their users to "upgrade" to 1.29 from their old war3 versions when playing ladder, but then as soon as the game is over, they "lose" the 1.29 warcraft 3. This means, there will be no driving force from their competitive melee scene (which uses 1.29 and future versions) to compel average users to upgrade to 1.29. This means their competitive melee scene and 1.20 or 1.24 custom maps scene (including campaigns) will be able to coexist, which means they will likely stay separated from the rest of the warcraft 3 community forever. As such, there will be no need for your YDWE conversion. So basically, it is just me (1 person) taking away your time to edit/code something that no-one else will ever use. Logically speaking, this is a huge waste of time from your point of view to spend time on something that has no purpose beyond my individual translation projects. I have no problem with this--it's a shame that their community will never merge with ours but that has nothing to do with us. But just let me know if you would prefer me to refrain from posting here if i have trouble with future translated campaigns based on YDWE :) It's completely ok with me.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
1) I don't know, this seems like a bug in WC3. Doing so made all of the maps I tested open in the game itself, rather than getting stuck in an infinite black screen. Are you getting the same results?

2) I don't know if the missing preplaced units have anything to do with YDWE like I wrote before.

3) Let me worry about that. Also it's not like handling YDWE is any different on my end than WEU. As you saw, the real different things, e.g. new jass-backed GUI, can't be handled automatically anyway.
 
Level 23
Joined
Jul 26, 2008
Messages
1,305
Hmm, it is interesting, opening it in YDWE, there is no custom script. I guess that is converted by the tool. It is all GUI, so I might be able to identify the issues on this end, alter them (I will try to change them to normal WE triggers on this end) and then convert them using your tool ghostwolf. Regardless, your tool is the only way this is possible (hopefully will avoid the permanent black screen haha). :)
On a side note, poking around YDWE, this is either a very powerful editor extension, or i just have just never appreciated how much function third party editors give users in general (probably the latter).
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
YDWE is pretty extensive. Also, of course that if you open in YDWE it will be GUI, that's the whole point of this tool, to change extended GUI :p

But extending can mean simple things like exposing jass natives to GUI, or whole new jass libraries and values.
E.g. one funny extension is WEU exposing custom scripts in conditions, with a function whose name is literally a space character " ".
 
Level 23
Joined
Jul 26, 2008
Messages
1,305
Hi Ghostwolf, that tidbit about the function that has a space for a name is pretty scary haha.
Anyway, I might have found the issue with the 2 preplaced issues for map 13.

There are two peasants that have been given a trigger command to collect lumber from a specific tree each. If i remember right, you cannot order a unit to target a specific tree. *If this is wrong, then disregard this. What I need to do is actually go back and check the name of the units erroring on the 1.29 version in order to compare. But these two units just stood out to me. If I am wrong, I will continue looking :p


upload_2018-6-21_22-42-0.png




upload_2018-6-21_22-43-23.png




Edit1: Ok, if I am correct about the possibility I raised above, then I might have found the issues in map14. You mentioned 9 preplaced units have issues in map14. In map 14, there are 5 wisps that are also given specific commands to mine lumber from specific trees. And, four trees of life are given the command to entangle specific goldmines. I also note that, for all the triggers for these wisp/peasants/trees of life that concern specific trees/goldmines, the "event" is map initialization.
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
I found the two peasents and the trees. This is odd indeed. They exist, their names are correct, but WE doesn't generate their globals until you use them in some way.
For example, open a new unit action that allows you to select a unit, select one of the peasants, then select the other one, cancel the action, and both are no longer errors. Same for the trees with a destructible action.
How this works is not weird, but rather the fact it "forgot" about these specific units and destructibles being used.

Kudos on debugging it, I would have never found these pre-placed objects.

/edit
After closing and reopening the map, the same issue occurs and you need again to "remind" WE of said units and trees.
This behavior seems to suggest that WE will only generate globals for pre-placed objects that are referenced by GUI.
Perhaps if a pre-placed object is only ever used in custom scripts and not in GUI in any kind of context, it is not generated?

/edit2
I confirmed the above. If you do not reference a pre-placed object in GUI directly (not custom scripts), then it will not get a global generated for it.
Because these custom scripts were originally YDWE's GUI, this wasn't an issue, until they were converted.

Perhaps it will be possible to collect the names of pre-placed objects that are accessed, and at the end do a second pass to see if they are ever used in GUI.
Ones that are not could be...what? added to some action that will not affect them in any way in a trigger that will never run? :thinking:
 
Last edited:
Level 23
Joined
Jul 26, 2008
Messages
1,305
Hi Ghostwolf, haha that is some confusing stuff going on :p. I can find a way to deal with those triggers, probably by changing them to not specify a specific tree/goldmine, which should do the trick. The main thing is that now we know that it is those kind of GUI triggers (with specific targets) that cause the problem.Additionally, they are very rare triggers since the AI will normally do them automatically, and with the exception of map13 where the author made them cut trees because there was no AI for that base anyway. There was actually no need for any of the map14 triggers since the AI would do them anyway (except the ones where the author makes your own builders mine, then it might be a case of the author wanting it to seem more real that the builders for the players are not just sitting around doing nothing when the mission starts).

Changing the timer issue in map 14 was simple also, because thanks to you specifying it was a destroy timer trigger I was able to locate the GUI line and I can make a simple trigger to replace it. My issue is now, though, is that something within the last few changes you have made to your tool had made the campaign hidden in the custom campaign menu ha ha. I have tried putting in the version of the campaign before it undergoes your tool, and it appears (but of course, it still gives the blackscreen of death since it has not undergone your tool). As for the version that has undergone your tool, it now becomes invisible (I know we had this issue before and it was because I was apparently on 1.28 instead of 1.29.2, but now I am 100% sure that is not the case :p).

I completely missed this, since I have been so busy caught up in the editor. I am 100% sure it was working a week ago, but now it will not appear. I have a link to a version that has undergone your tool if you want to see:

DELETED*

(Note that the issues in map 13 and 14 we discussed have not been changed in this version, since I wanted to leave changing them till I finished translating all the text (this version is 80% translated). Me not fixing these issues, however, should not be the cause of the entire campaign being invisible in the campaign menu though, since the errors were not fixed last week but the campaign could still be seen and played.


Edit1: There is another reason why I wanted to test the map in the pastebin besides to see if everything was playable. I recently began translating the custom object data for the campaign, and I noticed that the object data for YDWE is not in the same order as the normal editor... when I saw this I was quite concerned, since I know this tool only converts the extended GUI, but probably has no effect on object data. I am not saying there was anything different about the YDWE object data, it was just in a different order from the normal object editor.
However, the object data should not be at fault for the hidden campaign. I can still see the campaign before it undegoes your tool, so the custom data should be unrelated to this. Any errors related to the custom data would probably appear in theory once a map is clicked, since the data is global throughout the entire campaign.
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
I can take care of the references by adding a disabled trigger with actions that reference the needed preplaced objects. It's ugly, but will work.
That being said, I didn't look yet what exactly needs it and what not.
For example regions also miss references, but WE never complains.
Units and trees obviously need it, as we can see, not sure what else.

As to opening the campaign - after converting, it indeed doesn't show up, however after I open it in WE and save it back, it does show and seems to work fine.
It could be just that I am not updating the editor version that the campaign thinks it was saved with up to 1.29 (6060).
Will need further testing.

The order in which things are shown in the editor is based on files used by the editor itself, and doesn't depend on a specific map or campaign.

An odd thing I noticed is that at least the first map opens normally in the game, no issues with the map initialization event or anything.
Perhaps loading is different for campaigns?
 
Last edited:
Level 23
Joined
Jul 26, 2008
Messages
1,305
Thanks for reminding me to save first :p. I am so silly.
Anyway, for me, I actually always got black screen when I opened map01 without altering the intialization triggers. When i changed the 2 trigger events to "time elapse is 0", then it was openable. So my situation was different from yours in that I could not open map01 without altering the events.

Edit1: I have tried doing the same (changing all map initialization triggers) to the first playable map (03). Everything worked fine. There is a slight delay for the game entering cinematic mode (barely a second) as a result of it not being on map initialization, but everything else was working perfectly ghost wolf!
I will soon start to do extensive testing, like seeing what happens when you beat a map, if everything carried over, etc. But really, this is only possible because you identified that changing the map initialization events would fix the black screen, so thank you! I will keep you updated.

Edit2: I saw you specifically mention how loading might be different in campaigns. I will test this out also.

Edit3: I tried loading a saved game for the first playable map (03), nothing went wrong. Also I removed the link to paste bin since it I am not sure if the author wants an unprotected version lying around, so i sent it to you instead.
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
Testing the map from WE causes said black screen, but opening it from the campaign itself inside the game works. Not related to the conversion in any way, but something to be aware of. Seems like the rules for when/how events happen differs for maps and campaigns.

Or maybe it's something else. For example, it might be trying to use data from the campaign in the trigger that runs on map initialization, and thus fails to load.
At game time stuff works differently, as I've seen previously with models that would cause loading to get stuck forever, but at the same time work in game if you spawn them after it started.
 
Level 23
Joined
Jul 26, 2008
Messages
1,305
Hi ghostwolf, just wanted to let you know, there are other places where the GUI to target a goldmine (exact same as the error from map fourteen) do not cause errors. When I say do not cause errors, I mean they never caused errors when I saved. They do not have initialization as the event though, for this one I have come across it is a timed event (after 900 seconds since game begins).

Edit1- So in theory, I could change the triggers that make the player's wisps mine from trees to maybe 0.00 second game time (I have not tried yet, I will start more experimenting soon).
 
Level 7
Joined
Sep 16, 2016
Messages
184
Hello Regno here,

As of the time I am writing this, the map is being checked by the tool. I will report back each hour of the progress. If there will be any 00))

edit:

Passed 1 hour mark

edit2: Many hours have passed, signing off. I give up : D
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
Added GUI references to preplaced units and destructibles, however it seems like I have some issues with my MPQ code, and it makes 13.w3x not save correctly, in addition to another map that uses WEU.
Gotta check that first.

Injecting the new trigger file into the map with MPQEditor is possible, but obviously not very user friendly :p

Hello Regno here,

As of the time I am writing this, the map is being checked by the tool. I will report back each hour of the progress. If there will be any 00))

edit:

Passed 1 hour mark

edit2: Many hours have passed, signing off. I give up : D

What?
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    92.9 KB · Views: 232
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
The GUI references are now added.

In addition, fixed conversion of GUI child types.
For example, quotes need to be added to strings, but GUI has many types that are really strings, but not called strings. Such types (same for ID integers) are now converted correctly.

The MPQ issue was fixed too, which didn't affect the campaign, but affected another map.

Possibly WE can work with custom script conditions just fine, as I found out due to incorrect conversions. This may reduce the need to convert many things, like whole if-then-else blocks.
This is however only relevant to "multiple" variations, e.g. if-then-else-multiple, for-force-multiple, etc.

As far as the campaign goes, I think beyond the need to save it, and the YDWE timed destroy timer action, there are no issues left.
To be honest, it makes sense you'd have to save it, since I do not generate a new war3map.j, so no matter what conversions are done, they are invisible to the game until a new one is generated, generally via a map save in WE.
Only the actual custom YDWE function should not work in-game without a save if I were to figure how to fix this, but I don't know if it's worth bothering.
 
Last edited:
Level 23
Joined
Jul 26, 2008
Messages
1,305
Added GUI references to preplaced units and destructibles, however it seems like I have some issues with my MPQ code, and it makes 13.w3x not save correctly, in addition to another map that uses WEU.
Gotta check that first.

Injecting the new trigger file into the map with MPQEditor is possible, but obviously not very user friendly :p



What?
Haha, yes that would probably be not user friend :D. Thanks for finding a way around that.

The GUI references are now added.

In addition, fixed conversion of GUI child types.
For example, quotes need to be added to strings, but GUI has many types that are really strings, but not called strings. Such types (same for ID integers) are now converted correctly.

The MPQ issue was fixed too, which didn't affect the campaign, but affected another map.

Possibly WE can work with custom script conditions just fine, as I found out due to incorrect conversions. This may reduce the need to convert many things, like whole if-then-else blocks.
This is however only relevant to "multiple" variations, e.g. if-then-else-multiple, for-force-multiple, etc.

As far as the campaign goes, I think beyond the need to save it, and the YDWE timed destroy timer action, there are no issues left.
To be honest, it makes sense you'd have to save it, since I do not generate a new war3map.j, so no matter what conversions are done, they are invisible to the game until a new one is generated, generally via a map save in WE.
Only the actual custom YDWE function should not work in-game without a save if I were to figure how to fix this, but I don't know if it's worth bothering.
So Ghostwolf, can I just check, does what you just said here mean that the GUI with the tree/goldmine as targets, + the issues with changing every single "map initialization" action to "elapse time is 0" are automatically dealt with? Sorry I just wanted to check, since I couldnt follow exactly :p

The save issue is irrelevant- it was my fault for not remembering :p.
Anyway, with this out of the way, would you like it if I post issues I come across from your tool when converting other campaigns? This one is essentially done now, all thanks to your tool!
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
If a map is going to lose used references to preplaced units/destructibles due to conversions to custom scripts, a reference will be added via an initially off trigger named PreplacedObjectReferences.
This trigger is added to the first trigger category (folder in the trigger editor).
You can see it in action for 13.w3x and 14.w3x.

I am not touching the map initialization since it's not related to the conversion, it has something to do with map and campaign handling by the game. Like I said, the event works as expected in these maps when they are launched in the context of the campaign. Why not in the context of a map, I don't know. Probably due to campaign data not being loaded, and the loading phase and game phase handling bad/missing data differently.

If you have any isses, feel free to post them.
If any of them have to do with custom YDWE functions, you will have to handle them manually though.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
- Custom script conditions are now used when possible. This allows to not convert full blocks such as If-Then-Else-Multiple if their conditions need to be converted. It may look weird at first to see custom scripts in conditions :p
- The converted triggers file is now re-read with only the standard WE trigger data, to validate that it is not plain broken.
- Added GUI conversion of IsUnitType when the type is UnitTypedead (which both WEU and YDWE define for UNIT_TYPE_DEAD) and it's inside a top-level condition. In other words, this only applies to trigger conditions. It is replaced with IsUnitDeadBJ, which actually works different, and may have side effects (that's the reason it is not changed in non-trigger-conditions, where it can be replaced with custom scripts).
- Implemented the conversion of array variable sets/gets which didn't add the [index] part.
- The messages on the page now have a little style to them, to make the output slightly less unreadable. The page is also scrolled to the bottom after the conversion.
- Changed the whole design of the code, and fixed many problems. Every valid map that I have in my possession now converts successfully (that is not to say everything is implemented, because certainly not everything is).
- It's also a lot more optimized and fast, but I don't know if you'll notice it.

I am thinking about changing RoC versions of blocks (IfThenElse, ForForce, ForGroup, etc.) to TFT versions (IfThenElseMultiple, ForForceMultiple, etc.) when their conditions, or actions, need to be converted.
This will allow to still keep around the GUI logical structure, rather than have them converted to full custom scripts.
It will also allow to not generate extra functions in the map's header for these blocks, which is a nice side effect of finding custom script conditions.
You can in fact have any "action" in GUI in a condition, and WE translates it just fine. It just doesn't give you the option to add these actions.

Still need to look closely at AndMultiple and OrMultiple, although I believe AndMultiple should already work correctly, and for OrMultiple all that needs to change is "false" to "true".
 
Last edited:
  • Like
Reactions: pyf
Level 29
Joined
Jul 29, 2007
Messages
5,174
- Fixed the inlined custom script conditions to behave correctly for IfThenElseMultiple/AndMultiple/OrMultiple.
- Added the needed boilerplate code to be able to handle RoC->TFT conversions of control flow blocks. For now only IfThenElse->IfThenElseMultiple is implemented. This allows for example to only convert the ThenAction part to custom script, rather than the whole IfThenElse block.

I think this is the final update for now, not much to change until I see maps that fail to convert. Most notably full trigger conversion is not implemented.
 
  • Like
Reactions: pyf
Level 23
Joined
Jul 26, 2008
Messages
1,305
Hi Ghostwolf, yes it seems there are less changes being made, if that is what you meant by the optimization.

Edit1: I might have encountered the issue that guy above me posted about. Basically, whereas in the past where there would be a pop up almost instantly after dropping the file into your tool for the download for the no_weu file, now when i do it, no box ever pops up. I tried searching for it in case it auto downloaded somewhere, but couldn't find anything.


upload_2018-6-27_23-51-20.png





Edit2: Tried again, exact same thing. I am 100% it did not automatically download anywhere on my computer. Not sure if it makes any different, but I purposely left some of the YDWE custom stuff in there because I was going to play around with it to see what edits I can make without altering the missions too much.
 

Attachments

  • upload_2018-6-27_23-51-12.png
    upload_2018-6-27_23-51-12.png
    344.2 KB · Views: 171
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
Had a small typo, fixed.

/edit
Just because it was fast and easy:
- Added RoC->TFT conversions also for ForGroup and ForForce.
- Added GUI replacement for IsUnitRace in an OperatorCompareBoolean to a GetUnitRace in an OperatorCompareRace.

With these changes, the whole campaign doesn't need any generated functions anymore.
 
Last edited:
Level 23
Joined
Jul 26, 2008
Messages
1,305
Hi ghost, thanks for all the edits. One quick question, is it possible that there are errors going on with the buttons on the campaign being hidden.

Edit: What I mean is, I have now made all the buttons "missions" hidden, so it now follows a normal campaign where you need to beat each mission to unlock the next. When I did this, so now only the first mission can be selected, it is suddenly giving the black screen (yes, I did save it on 1.29 this time).

I have the updated file here:

Final button hidden | HIVE

The only other change I made was to change all map initialization events in the entire campaign to elapse time is 0.00

Edit2: When I say black screen, I mean when you open it in game and try to click the first mission.


Edit3: Ok, so this is strange. When I save the individual map, I can then play it when I open up the campaign on warcraft 3. I was only saving the campaign as a whole, not saving each individual map. I mean, I do not mind saving each individual map and then saving the campaign as a whole if that is the solution. I just did not realize this was the case.

Edit4: This issue actually might have been here all along, since in the early stages I was always saving the map itself before saving the campaign since I was testing for if the script error was going to come up.
 
Last edited:
Top