• 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.

I need some help on my trigger.

Status
Not open for further replies.
Level 28
Joined
Oct 28, 2011
Messages
4,759
I'm making my map and all is working fine, I'm able to save, test etc etc. But then I accidentally save my old file on a new one then I become frustrated but decided to work on the back up file, after a few hours of working I saved the map then this F*CKING error on the trigger come. Multiple errors on all lines, what could be the problem here? But when I try the older version and save it, its fine. And I don't want to use that 2 week old version.

ERROR SAYS EXPECTED A FUNCTION NAME


  • Item Upgrade Copy
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Recipe System 1.22 ...
      • Custom script: call InitRecipe()
      • -------- Crossbow --------
      • Custom script: call CreateRecipe2('I005','I005','I008')
      • Custom script: call CreateRecipe2('I008','I005','I007')
      • Custom script: call CreateRecipe2('I007','I005','I006')
      • Custom script: call CreateRecipe2('I006','I005','I009')
      • -------- Crossbow --------
      • -------- Runed Axe --------
      • Custom script: call CreateRecipe2('I000','I000','I00C')
      • Custom script: call CreateRecipe2('I000','I00C','I00A')
      • Custom script: call CreateRecipe2('I000','I00A','I00B')
      • Custom script: call CreateRecipe2('I000','I00B','I00D')
      • -------- Runed Axe --------
      • -------- Stone Axe --------
      • Custom script: call CreateRecipe2('I00G','I00G','I002')
      • Custom script: call CreateRecipe2('I00G','I002','I00E')
      • Custom script: call CreateRecipe2('I00G','I00E','I00F')
      • Custom script: call CreateRecipe2('I00G','I00F','I00H')
      • -------- Stone Axe --------
      • -------- Sword --------
      • Custom script: call CreateRecipe2('I00L','I00L','I003')
      • Custom script: call CreateRecipe2('I00L','I003','I00I')
      • Custom script: call CreateRecipe2('I00L','I00I','I00J')
      • Custom script: call CreateRecipe2('I00L','I00J','I00K')
      • -------- Sword --------
      • -------- Wooden Bow --------
      • Custom script: call CreateRecipe2('I004','I004','I00M')
      • Custom script: call CreateRecipe2('I004','I00M','I00N')
      • Custom script: call CreateRecipe2('I004','I00N','I00O')
      • Custom script: call CreateRecipe2('I004','I00O','I00P')
      • -------- Wooden Bow --------
      • -------- Eagle Staff --------
      • Custom script: call CreateRecipe2('I00U','I00U','I00T')
      • Custom script: call CreateRecipe2('I00U','I00T','I00R')
      • Custom script: call CreateRecipe2('I00U','I00R','I00S')
      • Custom script: call CreateRecipe2('I00U','I00S','I00Q')
      • -------- Eagle Staff --------
      • -------- Cloack --------
      • Custom script: call CreateRecipe2('I001','I001','I00Y')
      • Custom script: call CreateRecipe2('I001','I00Y','I00X')
      • Custom script: call CreateRecipe2('I001','I00X','I00W')
      • Custom script: call CreateRecipe2('I001','I00W','I00Z')
      • -------- Cloack --------
      • Custom script: call CreateRecipe('rat6', 'rat9', 'ratc',0,0,0, 'ratf')
      • Custom script: call CreateRecipe4('ram1', 'ram2', 'ram3', 'ram4', 'rugt')
      • Custom script: call CreateRecipe4('kybl', 'kygh', 'kybl', 'kygh', 'mgtk')
      • Custom script: call CreateRecipe5('oslo', 'oven', 'oli2', 'ofir', 'ocor', 'gldo')
      • Custom script: call CreateRecipe6('sor1', 'sor2', 'sor3', 'sor4', 'sor5', 'sor6', 'sora')
 
Level 6
Joined
Oct 4, 2011
Messages
226
On only 1 line or all of them? Just curious and I cant see the problem except maybe on the First line under "Cloack" does the (0,0,0,) need to be ('0','0','0')
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
sonofjay said:
ERROR SAYS EXPECTED A FUNCTION NAME

This means that the function being called does not exist/cannot be found.
Are you sure these functions that you are calling exist?
If they do, could you paste them or would you rather not?
It would be easier to see the actual functions, this way we can check wether the function names being called are correct.

Also, you do realise that you can not call a function that is created after the function that calls it?
Have you recently moved this trigger above the trigger that contained the recipe system?
If you did, then you might want to put this trigger underneath the trigger that contains the recipe system.
Or you could use call ExecuteFunc("CreateRecipe"). But then you would not be abled to pass parameters to the function.

Example:
JASS:
function test1 takes nothing returns nothing
    call test2()
endfunction

function test2 takes nothing returns nothing
endfunction

test2 will never be called because the function is created after test1.
To call this function you can use: call ExecuteFunc("test2").
Or you could do this:

JASS:
function test2 takes nothing returns nothing
endfunction

function test1 takes nothing returns nothing
    call test2()
endfunction

Here is a small tutorial on call ExecuteFunc(): http://www.wc3c.net/showthread.php?t=79029

blade.tk said:
it's the only way to have forward references in JASS.

If the recipe system is within the header of the map.
Something else might be the cause of this problem...
Such as faulty function names.
 
Last edited:
Level 28
Joined
Oct 28, 2011
Messages
4,759
Well I'll explain it more,

I'm working on my newest version of the map, then I'm doing some experiment on the older version(i'm doing a system that will be inserted on the newest version) when I accidentally saved it on the newest version, I just said to myself that I'll just work on the old version then I transferred the recipe system, and make sure the id's are still the same, but this error occured.

NOTE: I moved it the whole system not one trigger :psmile:
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Then can you move the Item Upgrade Copy trigger to the very bottom of all triggers and see if that works?
Also make sure the function names in the recipe system are exactly the same as the ones you are calling.

EDIT: Hmmm, so the system worked in the new version but after moving it to the old version it didn't work anymore?
Can I perhaps have a look at your map when I get home?
I'd like to see the system :)
If you don't want to, that's fine with me.
But it's hard solving a problem if you can't see the source right?
 
Status
Not open for further replies.
Top