• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Line ####: Expected a Name

Status
Not open for further replies.
Level 3
Joined
Dec 5, 2010
Messages
40
So I was trying to create a Two Player Campaign, Scourge... and one of the Triggers is being an a$$hole about some custom scripts (or one of them).
I always get these errors:

Line 1135: Expected a Name
Line 1150: Expected a Name
Line 1171: Expected a Name

I honestly have no idea what to do.

I provided some screenshots in the attachment below, if anyone can help me out, I'd be really grateful.

Thanks in advance.
 

Attachments

  • Line 1.jpg
    Line 1.jpg
    44.2 KB · Views: 103
  • Line 2.jpg
    Line 2.jpg
    52.3 KB · Views: 113
  • Line 3.jpg
    Line 3.jpg
    62.2 KB · Views: 100
  • Screen1.jpg
    Screen1.jpg
    49.2 KB · Views: 119
You are most likely missing a function in your map's header.

When you imported that SaveLoad system into your map, you probably forgot to copy over the header functions. To do that, go to the original SaveLoad map, open the trigger editor, and click on the map's name above all the trigger categories and triggers.
41534d1226154882-trigger-problem-zoom-header.png


Copy all the code in that area, and put it in the same location in your map. Hopefully that should fix the issues.
 
Level 3
Joined
Dec 5, 2010
Messages
40
So yeah, that worked. I copied the header stuff from the original map... Pasted it... AND 214 NEW COMPILE ERRORS!
 

Attachments

  • 214 compile errors.jpg
    214 compile errors.jpg
    51.5 KB · Views: 146
Level 3
Joined
Dec 5, 2010
Messages
40
Your script expects multiple global variables declared in GUI variable panel (those are prefixed with "udg_").

You need to check which variables are needed and create them manually with proper types.
E.g: on your pic I see "udg_SaveLoad_Abilities_LastIndex" -> create new integer ("C") variable named: SaveLoad_Abilities_LastIndex.


Thanks a lot, man. That actually fixed all 214 Compile Errors. Thanks a bunch. :)
 
Level 3
Joined
Dec 5, 2010
Messages
40
But I failed at everything else, can't get the '-new' to work and that stuff. This SaveLoad shit is complicating, probably... I guess I'll have to give up.
 
Level 3
Joined
Dec 5, 2010
Messages
40
Actually "Automatically create unknown variables" was already enabled before, when I copied it the first time.

EDIT: And what's this SaveLoad testmap, though? I actually copied the triggers from an actual 2P Campaign map.
 
Level 3
Joined
Dec 5, 2010
Messages
40
I honestly have no idea which one is it, since I copied the triggers from a mission made by "Gismo359", the 2P Night Elf Campaign one.

EDIT: Though it's probably the Aceheart one? *shrug*
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,255
The "Expected a name" syntax error is thrown where you refer to an implementation of a type that has not been declared.

In JASS it is important to note that it has no pre-parse stage to resolve all referenced names. As such it will throw the error if you try and reference anything declared after where you try and reference it.

What does this mean? You cannot have directly cyclic function calls (A calls B which then calls A) as one of them will not be able to see the other. The restriction on function calls can be mitigated at the cost of performance by either calling the function directly by name (there is a native that does this) or wrapping it in a trigger and using globals to pass arguments to and from it.

In your case either of the following are probably the cause.
1. Dependencies are in the incorrect order. Your save system (or whatever you are importing) references another system that is not callable in its position due to the mechanic described above. The solution is to re-order the dependencies such that they will be physically above all requiring systems in the map script.
2. You have left out dependencies that the system requires. This could be anything from large amounts of script to the declaration of globals in the GUI editor. This is likely the cause as the error you posted blames a line of script referencing a GUI declared global.
 
Level 20
Joined
Jul 14, 2011
Messages
877
He fixed the "Expected a name" error, and, from I understood, all others of the sort.
What he didnt say is his triggers, which cause the new problem.
I have the feeling he didnt set the right player in the events.

I suggest you look at AceHart's thread about the system which is what I used.
There he explains everything you need to set it up and use.

EDIT: Oh, and the "-new" isnt really related to the system.
 
Level 3
Joined
Dec 5, 2010
Messages
40
He fixed the "Expected a name" error, and, from I understood, all others of the sort.
What he didnt say is his triggers, which cause the new problem.
I have the feeling he didnt set the right player in the events.

I suggest you look at AceHart's thread about the system which is what I used.
There he explains everything you need to set it up and use.

EDIT: Oh, and the "-new" isnt really related to the system.

I tried that actually, it all looks pretty complicated... I wasn't sure what the hell to copy from his map and what not... And what to edit and what not to edit... Not sure what/how to set up that in the mission.
Ehh... I'll just have to give up I guess.
 
Last edited:
Level 3
Joined
Dec 5, 2010
Messages
40
I don't even know anymore. I began from scratch and the "-new" thing still does not work.
And this time I copied stuff from the Orc 01 mission. Changed the necessary things (hopefully) and copied the map header.

EDIT: And I am pretty sure I got the players right.
EDIT 2: I somehow managed to fix it, I don't even know... I guess you can expect the 2P Scourge Campaign from me soon. *Shrug* Just need to make a thread in Map Develpoment somehow.
 
Last edited:
Status
Not open for further replies.
Top