How can I fix the "Commander" syntax error from the WEU?

Ouguiya

New Member
Reaction score
11
Hello all!

I have recently tried to switch to JassNewGen.

To my dismay I created my map with WEU, and had some functions typical to it in it.

I removed all those functions, and the map (after a long trial and error process) now opens.

The problem is that the map doesn't get saved correctly, because Jasshelper tells me:

"Line 9665: identifier redeclared : "Commander" "
"Line 9838 ---- (previously declared here)

and the function lines which caused this were:

JASS:
function TributeGold takes player Commander, player Comp, integer res_amount returns nothing

JASS:
function Commander takes nothing returns nothing


respectively.

I have to say that I am a complete noob at JASS. A quick search of the internet showed up that this was already the topic in the development of JassHelper (http://www.wc3c.net/showthread.php?t=94334), where Vexorian then scolded the poster for "giving the same name to things" and then said "This syntax error is actually expected to happen in that case."

Which is nice, but doesn't solve the problem.

If anyone could point me in the right direction on how to repair this issue (since I don't really want to save all the time with having this syntax error, and don't really want to disable jasshelper all the time), I'd be grateful and of course award +rep.

Thanks in advance,

Yours,

Ouguiya
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, you could simply rename one of those "Commander" to like Commander1 and then change all Commander words in the trigger, to Commander1 :D
 

Ouguiya

New Member
Reaction score
11
Hi there!

Well, that sounds simple enough for even me not to screw up :D

Problem is, this is not in the triggers, it's in the map header. Can I simply go ahead and rename it all?

Thanks for your answer.

Yours,

Ouguiya
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Yeah, I'd believe so :D Or you could post one whole function, and I can take a look :D
 

Ouguiya

New Member
Reaction score
11
Heya!

I managed to solve it!

I simply used the wonderful "replace" function of Newgen, and let it replace all instances of the commander function.

This worked, the map starts without problems, and the syntax checker finds no errors.

Thanks for your help!

Yours,

Ouguiya
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top