1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Lead your forces to battle in the 15th Techtree Contest. The call is yours, commander!
    Dismiss Notice
  4. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Tool: make WEU maps openable WE

Discussion in 'Warcraft Editing Tools' started by GhostWolf, Jun 3, 2018.

  1. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,906
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    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: May 5, 2020
  2. tulee

    tulee

    Joined:
    Jul 26, 2008
    Messages:
    985
    Resources:
    8
    Maps:
    8
    Resources:
    8
    Hi ghostwolf, it didnt work for me, but i was trying a campaign. Still want the map for testing?
     
  3. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,906
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
  4. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,906
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    - 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: Jun 6, 2018
  5. tulee

    tulee

    Joined:
    Jul 26, 2008
    Messages:
    985
    Resources:
    8
    Maps:
    8
    Resources:
    8
    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 :)
     
  6. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,906
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    - Now properly detecting gg_ variables and not adding udg_ to them.
    - The page now shows all of the generated code.
     
  7. tulee

    tulee

    Joined:
    Jul 26, 2008
    Messages:
    985
    Resources:
    8
    Maps:
    8
    Resources:
    8
    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"
    Screenshot


    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".

    screenshot2

    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.

    Screenshot3

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



    screenshot4


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



    Perhaps those maps that cannot be opened have trigger data that has not converted?
     
    Last edited: Jun 8, 2018
  8. Daffa

    Daffa

    Joined:
    Jan 30, 2013
    Messages:
    8,083
    Resources:
    30
    Packs:
    1
    Maps:
    9
    Spells:
    18
    Tutorials:
    2
    Resources:
    30
    Might be my answer to UMSWE mess I did in the past. Does it supports UMSWE 5.0?
     
  9. tulee

    tulee

    Joined:
    Jul 26, 2008
    Messages:
    985
    Resources:
    8
    Maps:
    8
    Resources:
    8
    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.
     
  10. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,906
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    There are no issues as far as converting the GUI to something openable, not sure if UMSWE is relevant.

    I did find specs for the file that gives information about the campaign, so I gotta implement it and see what's going on with the data.
     
  11. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,427
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    awesome, thanks for making this. It is such a hassle for people to set up WEU/UMSWE at this point and it is nuts how many maps were using their custom triggers
     
  12. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,906
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    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: Jun 8, 2018
  13. tulee

    tulee

    Joined:
    Jul 26, 2008
    Messages:
    985
    Resources:
    8
    Maps:
    8
    Resources:
    8
    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
     
  14. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,906
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    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
     
  15. tulee

    tulee

    Joined:
    Jul 26, 2008
    Messages:
    985
    Resources:
    8
    Maps:
    8
    Resources:
    8
    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: Jun 10, 2018
  16. tulee

    tulee

    Joined:
    Jul 26, 2008
    Messages:
    985
    Resources:
    8
    Maps:
    8
    Resources:
    8
    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.
    Screenshot

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


    The Exact Crash Log It Provides:
    Screenshot Two

    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: Jun 16, 2018
  17. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,906
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    I tried editing the triggers and map information of maps 1 and 2 and they saved with no issues. Do you have a reproducible setup to get these crashes?
     
  18. tulee

    tulee

    Joined:
    Jul 26, 2008
    Messages:
    985
    Resources:
    8
    Maps:
    8
    Resources:
    8
    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.)
     
  19. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,906
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    Does it happen for you in maps 1 and 2 too?
    Your editor says it is 1.28.5 by the way.
     
  20. tulee

    tulee

    Joined:
    Jul 26, 2008
    Messages:
    985
    Resources:
    8
    Maps:
    8
    Resources:
    8
    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).