PoLlama Forums  

Go Back   PoLlama Forums > WarCraft > World Editor Help > JASS Help

Reply
 
LinkBack Thread Tools
Old 07-12-2008   #1
 
Join Date: Jul 2008
Posts: 5
drunken is an unknown quantity at this point
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
jasscraft simply says that line 5 has a syntax error and that i is undefined. the line with the syntax error is identical to a line straight from the manual...
drunken is offline   Reply With Quote
Old 07-12-2008   #2
 
Mr. Zero's Avatar
 
Join Date: Sep 2006
Location: Denmark (GMT+1)
Posts: 2,173
Mr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond repute
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
Corrected:
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

[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]

"In the end there is no greater motivation than revenge"
SO I HERD U LEIK MUDKIPZ?!
Mr. Zero is offline   Reply With Quote
Old 07-12-2008   #3
 
Join Date: Jul 2008
Posts: 5
drunken is an unknown quantity at this point
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.
drunken is offline   Reply With Quote
Old 07-12-2008   #4
 
Mr. Zero's Avatar
 
Join Date: Sep 2006
Location: Denmark (GMT+1)
Posts: 2,173
Mr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond repute
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.

[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]

"In the end there is no greater motivation than revenge"
SO I HERD U LEIK MUDKIPZ?!
Mr. Zero is offline   Reply With Quote
Old 07-13-2008   #5
 
Join Date: Jul 2008
Posts: 5
drunken is an unknown quantity at this point
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
drunken is offline   Reply With Quote
Old 07-13-2008   #6
 
Mr. Zero's Avatar
 
Join Date: Sep 2006
Location: Denmark (GMT+1)
Posts: 2,173
Mr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond repute
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.

[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]

"In the end there is no greater motivation than revenge"
SO I HERD U LEIK MUDKIPZ?!
Mr. Zero is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On



All times are GMT -5. The time now is 09:18 AM.

A friend of Wc3Happy
Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165