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

Making my map run with patch 1.24

Status
Not open for further replies.
Level 4
Joined
May 18, 2004
Messages
60
I need some serious help making my map compatible with patch 1.24. I don't understand the return thing that they changed. I originally created the map with WEU and spent the last few days removing everything WEU related and as of now the map WILL load with regular map editor.

There is a tutorial on this on wc3.net and I followed it, but was confused @ the end of it and the site is down.

====================================================================
That tutorial states:
====================================================================

I explained this in the other thread, but rather quickly. This will help you find out the functions that make warcraft III unable to play your map, without doing any brute force, there is one exception though, and it is that World editor sometimes crashes. If one of the functions in your map causes this crash, then you are doomed to brute force. The good thing is that this seem to be the exception rather than the rule.

Requirements
* First of all, you need to be able to run World Editor.
* Then you need patch's 1.24's blizzard.j . Because for some reason it is not obvious to some people how to get it, I am attaching a zip file that includes that file.
* Finally, you need your map's war3map.j , there are many ways to get it, but I'll explain one that requires newgen pack. If you don't want to use newgen pack, then you'll have to use a MPQ editor to extract war3map.j from your map.

Getting the map's script
* Open your map in newgen pack, save the map. Make sure jasshelper doesn't give you any errors. If it does, fix them...
* Go to your newgen pack's folder, then to the logs\ subfolder. You will find a file called outputwar3map.j in there, open it with a text editor.

Merging the map script with blizzard.j
This could be done with a tool, I think jasshelper can do it, but well, it is easy to do it manually...

Make a copy of blizzard.j then open it and outputwar3map.j in a text editor, the merge process is easy, you'll find your map's script has a lot of globals inside a single globals block:

Collapse JASS:

globals
.. tons of stuff ! ..
endglobals


Select all the contents of this globals block, and Copy it to the clipboard. Then go to the blizzard.j copy, you will find a globals block in it as well. Find the bottom of blizzard.j's globals, and paste your map's globals just before endglobals
Collapse JASS:

boolexpr filterMeleeTrainedUnitIsHeroBJ = null
boolexpr filterLivingPlayerUnitsOfTypeId = null

// Memory cleanup vars
boolean bj_wantDestroyGroup = false

... tons of stuff from outputwar3map.j

endglobals



Finally, go to your outputwar3map.j, and go bellow the endglobals keyword, select all the contents bellow it (a lot of functions) copy it to the clipboard, head to the blizzard.j copy and then go to the end of the file. Paste your map's functions there.

Save the blizzard.j copy as "your\warcraft III folder\scripts\blizzard.j"

Getting the errors
Now open NORMAL World editor, create an empty map, and save the map.

* If WE crashes, you are doomed, stick to bruteforce.

* If the map is saved and no errors are shown, you didn't follow this tutorial correctly.

* If WE shows you an error that says "Expected a name" and the error line says something like "function InitGlobals" then either your map's issues are not caused by Jass but by something else (unlikely) or you didn't follow this tutorial correctly.

* If WE shows you an error that says "Unexpected type" or something like that with the word "type" in it. And the error line shown in the code preview is the beginning of the map's script, while the actual line number in the error is very high, then congratulations! You can find out what's your problem.

Find the problems
Notice the high line number ( Line XXX: blah blah blah, get the XXX) then go to the blizzard.j copy at the scripts folder, and go to line XXX, this line will be inside a function. Something like:

Collapse JASS:

function a takes boolean b returns something
blah blah blah

return onething
blah blah blah
return maybemorereturns

return otherthing
endif


Copy the contents of this function to some new text file, then remove all the returns but the last one (in scripts\blizzard.j) save scripts\blizzard.j and then save the empty map again.

If WE tells you "expected a name" and the line in the code preview says "function InitGlobals" then you have found all the problems in your map, if it again tells you something about a bad type, and a high line number, you have to repeat this step.

Fix the problems
If you did everything correctly and your computer contributed to the process, now you have a file containing all the functions that cause problems in your map. Now you have to find out what system/trigger/whatever is generating them, and then go and fix the function in the system/trigger/whatever. If the /whatever was made by someone else and you can't understand the code, request this someone else to fix it for you (maybe he actually has already updated it for 1.24). If the function is yours, you'll have to fix it. It is easy, just modify the function so that there is only one return stament, use variables and modify the structure of the function. If you have no idea where the function comes from, then you have a problem. Go to the problems section.



Problems
If your map crashes or you have no idea where one of the bugged functions comes from, you can actually post your map + outputwar3map.j in a zip in the pastebin and send me the link. There are some conditions:
* The map should have used vJass or a system/spell made by me, if not then you can go to heck, I won't spend my time on helping you...
* You should have tried this tutorial, if the map doesn't crash then I hope you provide me the text file containing the bugged functions, else the map MUST crash...

====================================================================
====================================================================

What I don't understand is when is says "Notice the high line number ( Line XXX: blah blah blah, get the XXX) then go to the blizzard.j copy at the scripts folder, and go to line XXX, this line will be inside a function."

How do you find that line in the blizzard.j copy? When you have it opened in notepad, there is no way to find the specific line it's referring too.

I will upload the map, the modified blizzard.j, and the outputwar3map.j file from my map, for those of you that want to follow the tutorial above.

I am at a stand still, as I don't know how to fix my map to make it run with patch 1.24. I have done all of the triggers in GUI, not JASS.

I have no problem fixing the errors myself, BUT I don't understand what problem is. I know it has something to do with JASS returns, but I don't know what it looks like in GUI format.

Can someone please either explain the GUI triggers I need to fix or fix this for me? I will be eternally grateful and even add your name to the map's special thanks if you want.

I am at my wits end!
 

Attachments

  • My Map Files.rar
    4 MB · Views: 68
Try changing the contents, that begin from line 6389 (where it begins with the function H2I) all the way to line 6431 (ending the FlushItem function)
JASS:
//***************************************************************************
//*
//*  Custom Script Code
//*
//***************************************************************************
function H2I takes handle h returns integer
    return GetHandleId(h)  //This will fix the return bug usage
endfunction

//==============================================================================
//  Item Timed Life (Setting)
function DefaultDuration takes nothing returns real
    return 240.00
endfunction

//==============================================================================
//  Item Timed Life (Cache)
function itemCache takes nothing returns hashtable
    if udg_itemCache == null then           //Replace udg_itemCache with a hashtable, named udg_itemCache
        set udg_itemCache = InitHashtable() //InitHashtable() instead of InitGameCache()
    endif
    return udg_itemCache
endfunction

function SetItemHandle takes handle missionKey,string key,handle value returns nothing
    call SaveItemHandle(itemCache() , H2I(missionKey) , StringHash(key), value)  //using a hashtable now
endfunction

function SetItemInteger takes handle missionKey,string key,integer value returns nothing
    call SaveInteger(itemCache() , H2I(missionKey), StringHash(key) , value) //using a hashtable now
endfunction

function GetItemItem takes handle missionKey,string key returns item
    return LoadItemHandle(itemCache() , H2I(missionKey) , StringHash(key)) //using a hashtable now
endfunction

function GetItemInteger takes handle missionKey,string key returns integer
    return LoadInteger(itemCache() , H2I(missionKey) , StringHash(key))  //using a hashtable now
endfunction

function FlushItem takes handle missionKey returns nothing
    call FlushChildHashtable(itemCache(), H2I(missionKey))     //using a hashtable now
endfunction

That is what you will replace it with. Make udg_itemCache become a hashtable instead of a gamecache.

Hopefully, that should fix it. :)
 
Level 4
Joined
May 18, 2004
Messages
60
Thanks, but when I change the old code to your code above and try to save the map, it crashes world edit. Says "worldedit.exe has stopped working" and crashes the editor.

This happens right after it's done creating the map script in the progress window :\

Do I need to change these two things:

Custom script: call ExecuteFunc("ItemApplyTimerBJ")
Custom script: call ItemApplyTimer(GetManipulatedItem())

within the triggers?
 
Last edited:
Status
Not open for further replies.
Top