![]() | |
| | #1 |
![]() Join Date: Jul 2008
Posts: 5
![]() | What do the error messages mean I have just started using jass (at the suggestion of someone here) for a map I am making but I keep getting errors that I can't understand. I can't find on any website or forum any explanation as to what the errors mean. The ones that say "missing <something>" are obvious but when it says "expected a name" and "expected a code statement" are confusing me. Yes I know what a name is and what a code statement is but when I get these errors I can never work out what I have done wrong. Here is an example: Code: function Trig_GetPath_Actions takes nothing returns nothing set udg_ShortestPath = udg_MAXINT set udg_RecurseLevel = 0 local integer i = 0 //expected a code statement loop exitwhen i = udg_MAXARRAY //expected a name set udg_Path[i] = false //expected a name endloop endfunction |
| | |
| | #2 |
![]() Join Date: Sep 2006 Location: Denmark (GMT+1)
Posts: 2,173
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Re: What do the error messages mean I would recommend you use NewGen instead for JASS'ing. JASSHelper gives more correct error messages. Anyway: Code: function Trig_GetPath_Actions takes nothing returns nothing set udg_ShortestPath = udg_MAXINT set udg_RecurseLevel = 0 local integer i = 0 // local SHALL ALWAYS be in the top before any code. Locals can't be declared in the middle of the function. loop exitwhen i = udg_MAXARRAY // When doing a comparison action remember you will need two =, e.g. exitwhen i == udg_MAXARRAY set udg_Path[i] = false // No syntax error here. Forgot to declare it? endloop endfunction Code: function Trig_GetPath_Actions takes nothing returns nothing
local integer i = 0
set udg_ShortestPath = udg_MAXINT
set udg_RecurseLevel = 0
loop
exitwhen i == udg_MAXARRAY
set udg_Path[i] = false
set i = i + 1
endloop
endfunction |
| | |
| | #3 |
![]() Join Date: Jul 2008
Posts: 5
![]() | Re: What do the error messages mean Thanks that helped a lot but I still don't understand the error messages and now I have more examples. I would show you them but the editor just crashed and so all the work I had done was lost. Is there a way I can stop it crashing? I have lost this (massively long and complicated) trigger 3 times now. I'm getting angry, might play something else for a while. |
| | |
| | #4 |
![]() Join Date: Sep 2006 Location: Denmark (GMT+1)
Posts: 2,173
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Re: What do the error messages mean Heh again get NewGen WE. JASSHelper also replaces the script compiler hence stopping a crash when forgetting a endloop or endif, and inject itself into warcraft3 when you test the map to catch further crashes, such as endless loops or non-existing function calls. |
| | |
| | #5 |
![]() Join Date: Jul 2008
Posts: 5
![]() | Re: What do the error messages mean Ok I got newgen. I loaded up my map, rewrote the trigger, and it didn't crash. Then I fixed all the syntax errors, and it saved (compiled) successfully. Then when I try to test the map it loads 3/4 and then crashes with a FATAL ERROR Mermory could not be 'read' and some memory addresses. I tried disabling all the jass triggers and leaving only the we gui triggers, but it still crashes. If I load up wc3 seperately from the normal exe with all the jass triggers disabled I can get the map to load up but the 'map initialisation' event never fires so there is nothing there and it can't be played. I may have set up newgen wrong or something but I am lost for a solution and now the map is broken |
| | |
| | #6 |
![]() Join Date: Sep 2006 Location: Denmark (GMT+1)
Posts: 2,173
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Re: What do the error messages mean Sounds like you got some endless loop or a non exists function call there. Of course I can't tell what to do without you posting the JASS code so we can see what went wrong. |
| | |
![]() |
| Thread Tools | |
| |