|
|
#1 |
|
Free Software Terrorist
Technical Director
|
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: 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 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: 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... |
|
|
|
| Sponsored Links - Login to hide this ad! |
|
|
|
|
#2 |
|
It feels good
Join Date: Mar 2006
Posts: 1,305
![]() ![]()
|
I just did this. It tells me the error lies in line 2649
__________________Checking it, it shows me the goddamn following blizzard.j comment block JASS://*************************************************************************** //* //* Environment Utility Functions//this be the goddamn line 2649 //* //*************************************************************************** Last edited by Alevice : 08-07-2009 at 08:36 PM. |
|
|
|
|
|
#3 |
|
Free Software Terrorist
Technical Director
|
2649 is very low.
__________________Post a screenshot of the error dialog. |
|
|
|
|
|
#4 |
|
Yay!
Join Date: May 2006
Posts: 873
|
This works! Thanks a lot!
__________________ |
|
|
|
|
|
#5 |
|
User
Join Date: Nov 2006
Posts: 26
|
Well I'll try this; but as I already told you, in the Caster System's Thread, I had already pointed 2 functions that caused returns bugs. Actually I do understand the coding, but I really don't know how to fix your system.
The first error; Line 12854, with the following message: "Invalid type for specified operator"... Open the merged blizzard.j and search for the 12854 line with Microsoft Word; gives me that function : function s__ArbreRespawn__allocate takes nothing returns integer local integer kthis local integer this=si__General_F if (this!=0) then set si__General_F=si__General_V[this] else set si__General_I=si__General_I+1 set this=si__General_I endif if (this>8190) then call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,1000.,"Unable to allocate id for an object of type: ArbreRespawn") //Error is showed at this line. return 0 endif set si__General_type[this]=28 set kthis=this set s__ArbreRespawn_arbre[this]= null set s__ArbreRespawn_timemax[this]= 55 set s__ArbreRespawn_timedone[this]= 0 set si__General_V[this]=-1 return this endfunction This function is created by the vjass compiler. |
|
|
|
|
|
#6 |
|
Free Software Terrorist
Technical Director
|
for now, disable the debug mode. If that doesn't work, just post the contents of the struct called ArbreRespawn, I'll figure something out...
__________________ |
|
|
|
|
|
#7 | |
|
It feels good
Join Date: Mar 2006
Posts: 1,305
![]() ![]()
|
Quote:
Attached lies the blizzard.j file i used |
|
|
|
|
|
|
#8 |
|
Free Software Terrorist
Technical Director
|
Something just above those comments:
__________________ JASS:function TriggerRegisterDestDeathInRegionEvent takes trigger trig, rect r returns event set bj_destInRegionDiesTrig = trig set bj_destInRegionDiesCount = 0 call EnumDestructablesInRect(r, null, function RegisterDestDeathInRegionEnum) return trig endfunction Err, did you use the blizzard.j from patch 1.24 ? This one is for the books, very strange, anyway, since it is in the blizzard.j part, just replace the function with return null and continue... edit: You didn't use the latest blizzard.j , specifically bj_lastCreatedHashtable isn't around |
|
|
|
|
|
#9 |
|
It feels good
Join Date: Mar 2006
Posts: 1,305
![]() ![]()
|
shit you are right. will fix that and see if it work now
__________________ |
|
|
|
|
|
#10 | |
|
User
Join Date: Nov 2006
Posts: 26
|
Quote:
I've saved with Debug Mode disabled; still gives me 198371283978 errors, but the first one isn't the same one and I can't find any type errors messages, (only expected end of line, expected a variable name, expected a name, expected endloop). But if i test the real map with Debug Mode disabled, I still can't load the map. |
|
|
|
|
|
|
#11 |
|
Free Software Terrorist
Technical Director
|
Well, just post the lines nearby the first error. I'll focus this afternoon to try to remove double returns from jasshelper, it will be VERY hard.
__________________ |
|
|
|
|
|
#12 |
|
User
Join Date: Nov 2006
Posts: 26
|
JASS:function MeleeTournamentFinishNowRuleA takes integer multiplier returns nothing local integer array playerScore local integer array teamScore local force array teamForce local integer teamCount local integer index local player indexPlayer local integer index2 local player indexPlayer2 local integer bestTeam local integer bestScore //Error Shows Here, Line 10657 with 'Expected End of Line' local boolean draw // Compute individual player scores set index = 0 loop set indexPlayer = Player(index) if MeleeWasUserPlayer(indexPlayer) then set playerScore[index] = GetTournamentScore(indexPlayer) if playerScore[index] <= 0 then set playerScore[index] = 1 endif else set playerScore[index] = 0 endif set index = index + 1 exitwhen index == bj_MAX_PLAYERS endloop // Compute team scores and team forces set teamCount = 0 set index = 0 loop if playerScore[index] != 0 then set indexPlayer = Player(index) set teamScore[teamCount] = 0 set teamForce[teamCount] = CreateForce() set index2 = index loop if playerScore[index2] != 0 then set indexPlayer2 = Player(index2) if PlayersAreCoAllied(indexPlayer, indexPlayer2) then set teamScore[teamCount] = teamScore[teamCount] + playerScore[index2] call ForceAddPlayer(teamForce[teamCount], indexPlayer2) set playerScore[index2] = 0 endif endif set index2 = index2 + 1 exitwhen index2 == bj_MAX_PLAYERS endloop set teamCount = teamCount + 1 endif set index = index + 1 exitwhen index == bj_MAX_PLAYERS endloop // The game is now over set bj_meleeGameOver = true // There should always be at least one team, but continue to work if not if teamCount != 0 then // Find best team score set bestTeam = -1 set bestScore = -1 set index = 0 loop if teamScore[index] > bestScore then set bestTeam = index set bestScore = teamScore[index] endif set index = index + 1 exitwhen index == teamCount endloop // Check whether the best team's score is 'multiplier' times better than // every other team. In the case of multiplier == 1 and exactly equal team // scores, the first team (which was randomly chosen by the server) will win. set draw = false set index = 0 loop if index != bestTeam then if bestScore < (multiplier * teamScore[index]) then set draw = true endif endif set index = index + 1 exitwhen index == teamCount endloop if draw then // Give draw to all players on all teams set index = 0 loop call ForForce(teamForce[index], function MeleeDoDrawEnum) set index = index + 1 exitwhen index == teamCount endloop else // Give defeat to all players on teams other than the best team set index = 0 loop if index != bestTeam then call ForForce(teamForce[index], function MeleeDoDefeatEnum) endif set index = index + 1 exitwhen index == teamCount endloop // Give victory to all players on the best team call ForForce(teamForce[bestTeam], function MeleeDoVictoryEnum) endif endif endfunction |
|
|
|
|
|
#13 |
|
Free Software Terrorist
Technical Director
|
That's something very strange.
__________________If for some reason it gives you errors on some blizzard.j function, replace it with an empty function and continue the process. Just in case, does line 10657 exist in the empty map script? |
|
|
|
|
|
#14 |
|
Pro-carnivorous
Join Date: Nov 2006
Posts: 217
![]()
|
I get this error whenever I reference a global array which have, in somewhere, a local with the same name:
|
|
|
|
|
|
#15 |
|
User
Join Date: Mar 2006
Posts: 71
|
thanks for the help, worked like a charm.
a few (seemingly obvious) gotchas for people who may be running into dumb issues i ran into: - when you run the real world editor to find your errors, make sure you're using the latest world editor (aka, the patched one). a good clue to know you're using the wrong editor is the "Unregistered native function" error on top of the script. - like in the above example, please make sure you have the correct blizzard.j file (i had to manually extract it myself since for some reason wc3c.net kept giving me the "NOTE: You have been redirected in order for our attachments to be made available to you. This will only last two minutes; these measures where taken to avoid hotlinking and bandwidth theft." error) - if you know of any functions that have two return statements (even in different places), they're going to get marked as problematic. in my case, i had short cuts on loops that would return values as soon as they were found, along with a default return value if the loop fell through. it seems as though the new patch DOES NOT like this kind of coding. in the future, write jass code that typically has one return statement - seems like the CSSafeCache is broken, so if you are using it right now, try disabling it to figure out other issues with your own map first. good luck! |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
|
Donate |