• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Remove specific unit type from map (1.26)

Level 4
Joined
Sep 28, 2022
Messages
26
long story short - when i tried to delete a useless custom unit-type in object editor to optimize the map a little, editor crashed. i obviously started searching through the forums and trying the solutions posted there:
  • tried importing data into fresh map and removing that unit-type (after resetting it to default), still crashes;
  • tried to use a tool to remove it, but it gave me an "array out of bounds" error and infinite loading;
  • tried to also use this, but it seems its Reforged only.
the map itself is pretty big (7 mb.) and old, but i'm DESPERATE in finding the solution to problem.
i have also found this, but i can't really understand how to solve my problem with it (and will it have huge impact on map)
 
Level 4
Joined
Sep 28, 2022
Messages
26
maybe try to find an older version of the map in file explorer
that won't help

"Never happened to me.

Is this unit being referenced in any other unit, upgrade or ability? Like in Techtree - Requeriments or something like that?"

nope
 
Last edited:
Level 3
Joined
May 24, 2017
Messages
12
I dig through old posts. It seems that this happens with maps that have too many units or abilities (like 1000 custom units / abilities). Is that your case?

If it is, the problem might be that the unit you are deleting have the same Object ID as another unit, or that the editor is bugging when trying to reorganize the IDs after you delete your unit.

If that is the case, if you find a way to change this unit's ID you might be able to delete it. But I don't even know if you can change the ID of a unit.

Or, perhaps, you can delete the unit with an MPQ editor? I never used one, so I don't know, but you can try.
Here's one: Ladik's MPQ Editor
 
Level 4
Joined
Sep 28, 2022
Messages
26
I'm guessing you don't have any back-ups? Did you check the "Warcraft III/Maps/Test" folder? If the last map you tested was a working version of that map, it'll be there named WorldEditTestMap.

Otherwise, I'm guessing you don't have any working versions that you can open in the editor. How did you try importing the data into a fresh map? Did you just extract the w3u and import it into the new map?

Unfortunately this has happened to quite a few people in the past--sometimes if the editor crashes while saving it'll corrupt the data in the map. That might be why the tooling is having a hard time reading some of it. It's possible that some parts can be recovered via a hex editor or a custom tool, but we'd need your map in order for us to do anything helpful. You should attach it here, or you can send me a private message with the map--and if you happen to remember the ID of the unit that'd be helpful too!
 
Level 4
Joined
Sep 28, 2022
Messages
26
I'm guessing you don't have any back-ups? Did you check the "Warcraft III/Maps/Test" folder? If the last map you tested was a working version of that map, it'll be there named WorldEditTestMap
the map itself is opening and working fine (even playable) - and as i stated its VERY old, so no back-ups left

It's possible that some parts can be recovered via a hex editor or a custom tool,
hex editor? What's that?
but we'd need your map in order for us to do anything helpful. You should attach it here, or you can send me a private message with the map--
i'm modding the map in question (with og author's permission ofc), and he's pretty conservative about this stuff, so i can't send it (and its also in russian)
however i could send all object editor files from mpq
and if you happen to remember the ID of the unit that'd be helpful too!
after some of my tests it seems a bunch of object editor stuff crashes the map upon deletion. When i will have free time i will try to make list of them
 
Ah got it. Good to hear you can at least open it!

Stunbyys said:
hex editor? What's that?

The wc3 internal files follow a proprietary format (so they can't be opened by most regular tools). But ultimately, all files boil down to some set of binary (1's and 0's). By analyzing the binary of those files, modders were able to reverse engineer the format and a few folks documented it:
Hex editors basically allow you to edit the binary of files directly. It is a very manual way of editing things (and really easy to go wrong), but it can be useful in cases like this where the editor isn't behaving the way you'd expect.

i'm modding the map in question (with og author's permission ofc), and he's pretty conservative about this stuff, so i can't send it (and its also in russian)
however i could send all object editor files from mpq

after some of my tests it seems a bunch of object editor stuff crashes the map upon deletion. When i will have free time i will try to make list of them
sure thing, feel free to send the object editor files and one example of a unit (or any object) that crashes the editor upon deletion.
 
Level 4
Joined
Sep 28, 2022
Messages
26
Ah got it. Good to hear you can at least open it!



The wc3 internal files follow a proprietary format (so they can't be opened by most regular tools). But ultimately, all files boil down to some set of binary (1's and 0's). By analyzing the binary of those files, modders were able to reverse engineer the format and a few folks documented it:
Hex editors basically allow you to edit the binary of files directly. It is a very manual way of editing things (and really easy to go wrong), but it can be useful in cases like this where the editor isn't behaving the way you'd expect.


sure thing, feel free to send the object editor files and one example of a unit (or any object) that crashes the editor upon deletion.
it seems that abilities with rawcodes 'A00B' and 'A00A' crash the editor after deleting. Also almost ALL the units on screenshot also do that ('U00B' 100% crashes)
attached the buffs, researches, abilities and unit-types files
 

Attachments

  • war3map.w3h
    2.7 KB · Views: 4
  • war3map.w3q
    61.5 KB · Views: 4
  • war3map.w3a
    320.2 KB · Views: 3
  • war3map.w3u
    393.4 KB · Views: 2
  • bug2.png
    bug2.png
    10.2 KB · Views: 7
it seems that abilities with rawcodes 'A00B' and 'A00A' crash the editor after deleting. Also almost ALL the units on screenshot also do that ('U00B' 100% crashes)
attached the buffs, researches, abilities and unit-types files
Got it. I imported those into a blank map and I was able to reproduce the crash by trying to delete A00A.

But I was able to prevent crash by doing the following:
  • Create a new unit based off a peasant named "Peasant"
  • Save the map
  • Delete whatever you want now
I'm not 100% sure, but it could just be that the original map files were encoded with a much older version of the editor that had a few quirks (and perhaps the newer editors can still read that version but can't do their delete operations reliably). By creating a new unit and saving it, you'll save it in a format that your editor understands and it might allow you to delete things again.

If that doesn't work, let me know. I have a script working that can delete a specific set of IDs.

EDIT: I took a closer look at the difference between the w3u you gave me and the w3u that gets generated after I follow the steps above. In my test map, it seems like it removed some of the strings, but I'm not sure if that is just because I don't have the wts file. So I'd recommend making a back-up before trying these steps--and if it works, I'd suggest trying to test the map to make sure unit names appear as you expect.
 
Last edited:
Level 4
Joined
Sep 28, 2022
Messages
26
thanks, will try it out
Edit: i tried out your method and it seems to work smooth as velvet and without problems. guess its Solved now and i would give +REP to everybody here but idk how to do that.

also my bad, should've send object editor stuff as .w3o instead of multiple files
 
Last edited:
Top