[Import] Too many argument given to function

Level 15
Joined
Jul 19, 2007
Messages
855
I'm trying to import this spell Fiery Vortex v1.1 too my map but I get this error.
error.png

What does it really mean and how to solve it? This error doesn't happening on the spellpack and I have imported everything required.
 
Level 24
Joined
Feb 27, 2019
Messages
833
Too many arguments passed to function OrderCaster means that in your map there is a function called OrderCaster(... and it takes a certain amount of arguments and those lines in the image also exist in your map and they pass too many arguments to the function OrderCaster(...
An argument is what exists between those parenthesis. As you can see there are 5 arguments in each of the lines shown in your image, this is one of them: call OrderCaster(u = first argument, l = second argument, MINOR_STUN_ABILITY_ID = third argument, MINOR_STUN_ABILITY_ORDER = fourth argument, owner = fifth argument)
If I didnt know where the function OrderCaster was located what I would do is export map script, open that exported script with notepad and ctrl + f for "function OrderCaster" and see where that function was located and how many arguments it wants to take. I could also compare it to different mentions in the script to find successful mentions by searching for "call OrderCaster"
 
Some checklist:
1. Do you copy the DummyCaster library (it's in the Optional folder within the spell folder)
2. Is there more than one library with OrderCaster function?

For those curious of the library in question:
[JASS]


library DummyCaster initializer OnInit
//---------------------------------------------------
// Make sure that CASTER_TYPE correctly points to the DummyCaster's Id
// press ctrl + d to show the id in the object editor
//---------------------------------------------------
globals
private integer CASTER_TYPE = 'h001'

// do not touch
private unit dummyCaster
private player neutralPlayer = Player(PLAYER_NEUTRAL_PASSIVE)
endglobals
private function LoadCaster takes nothing returns nothing
set dummyCaster = CreateUnit(neutralPlayer, CASTER_TYPE, 0, 0, 0)
endfunction
function OrderCaster takes unit u, integer level, integer a, integer o, player p returns nothing
call SetUnitOwner(dummyCaster, p, false )
call SetUnitX(dummyCaster, GetUnitX(u))
call SetUnitY(dummyCaster, GetUnitY(u))
call UnitAddAbility(dummyCaster, a)
call SetUnitAbilityLevel(dummyCaster, a, level)
call IssueTargetOrderById(dummyCaster,o,u)
call UnitRemoveAbility(dummyCaster, a)
call SetUnitOwner(dummyCaster, neutralPlayer, false )
endfunction
private function OnInit takes nothing returns nothing
call LoadCaster()
endfunction
endlibrary



[/JASS]
 
Level 15
Joined
Jul 19, 2007
Messages
855
Some checklist:
1. Do you copy the DummyCaster library (it's in the Optional folder within the spell folder)
2. Is there more than one library with OrderCaster function?

For those curious of the library in question:
[JASS]


library DummyCaster initializer OnInit
//---------------------------------------------------
// Make sure that CASTER_TYPE correctly points to the DummyCaster's Id
// press ctrl + d to show the id in the object editor
//---------------------------------------------------
globals
private integer CASTER_TYPE = 'h001'

// do not touch
private unit dummyCaster
private player neutralPlayer = Player(PLAYER_NEUTRAL_PASSIVE)
endglobals
private function LoadCaster takes nothing returns nothing
set dummyCaster = CreateUnit(neutralPlayer, CASTER_TYPE, 0, 0, 0)
endfunction
function OrderCaster takes unit u, integer level, integer a, integer o, player p returns nothing
call SetUnitOwner(dummyCaster, p, false )
call SetUnitX(dummyCaster, GetUnitX(u))
call SetUnitY(dummyCaster, GetUnitY(u))
call UnitAddAbility(dummyCaster, a)
call SetUnitAbilityLevel(dummyCaster, a, level)
call IssueTargetOrderById(dummyCaster,o,u)
call UnitRemoveAbility(dummyCaster, a)
call SetUnitOwner(dummyCaster, neutralPlayer, false )
endfunction
private function OnInit takes nothing returns nothing
call LoadCaster()
endfunction
endlibrary



[/JASS]
Hmm well I actually got xebasic and xecast systems in my map and these are also a dummy order systems. Maybe they conflict with eachother? That's not good then because I need both of them :-/
 
Level 15
Joined
Jul 19, 2007
Messages
855
Do they have OrderCaster as their function?

In theory, vJass isolates systems from each other, but there's always part of the exposed API... I'll just chip in some people who have better expertise to narrow the issue down @Antares @Wrda @Rheiko @Blightsower
No they don't have OrderCaster as their function. This is very strange since the spelltriggers works fine in the spellpack but not in my map :(
 
If I didnt know where the function OrderCaster was located what I would do is export map script, open that exported script with notepad and ctrl + f for "function OrderCaster" and see where that function was located and how many arguments it wants to take. I could also compare it to different mentions in the script to find successful mentions by searching for "call OrderCaster"
@Dinodin I would +1^ what Duckfarter said. You can export your map script even from the syntax error screen--just copy and paste that whole thing into notepad and then look for the words "function OrderCaster" (exactly as written).

If you find more than two results, then try to find where they are located in your code (or copy those two functions and paste them here and we can help figure it out). Our you can send me a private message with your map and I can help you resolve it. It usually is pretty simple to fix after that depending on how much code is using those functions! (you'll just need to rename one of them and rename them at the call-sites) I don't believe xebasic and xecast have that function, so it is probably something else.
 

Rheiko

Spell Reviewer
Level 26
Joined
Aug 27, 2013
Messages
4,214
OrderCaster is a function in DummyCaster library included in Fiery Vortex v1.1
You should do as Purgeandfire and Duckfarter said.

Hmm well I actually got xebasic and xecast systems in my map and these are also a dummy order systems. Maybe they conflict with eachother? That's not good then because I need both of them :-/
They don't conflict. They shouldn't because they have different function names (No OrderCaster there).
 
Hello, sorry for being late in the party.

OrderCaster is part of the the DummyCaster library. Remove the DummyCaster library from the optional libraries and all of the OrderCaster function calls found at the onDummyCast function of the configuration module.

Then you can implement your own dummy caster inside the onDummyCast function
 
Top