this stupid native function isnt working

Grundy

Ultra Cool Member
Reaction score
35
when i try to use the GetHeroSkillPoints function it keeps telling me invalid number of arguements.

Code:
local integer tempInt
local unit caster = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local location targloc = GetUnitLoc(target)
local unit swarmunit = CreateUnitAtLoc(GetOwningPlayer(caster), 'O000', targloc, bj_UNIT_FACING )
call SetHeroLevel( swarmunit, GetHeroLevel(caster) )
set tempInt = GetHeroSkillPoints(swarmunit)

in common.j it says
Code:
native          GetHeroSkillPoints      takes unit whichHero returns integer

so i have the function name right, and it only takes 1 arguement and its type unit. every time i try to call this function with 1 unit arguement it tells me invalid number of arguements.




-----------------------------------------------------------------------
nevermind i found the problem. it was highlighting the wrong line. the SetHeroLevel function was supposed to have a boolean for 3rd arguement.
 

SFilip

Gone but not forgotten
Reaction score
634
things like that happen a lot...when you get a compile error its really hard to know what is wrong with your code (and where).
that's why i suggest that you use either JASS Craft (look for it on wc3c when it goes up again) or pjass (which is actually the thing jass craft uses). they can show you where the error is exactly and they are more precise on what you made wrong.
 

Rinpun

Ex TH Member
Reaction score
105
He found out the problem...don't know if you noticed that or not.

But yes, I suggest if you have a compile error you should use Jasscraft, Jass Shop Pro, or some other editor for JASS. They usually do better at finding out the errors.

However, before I call a function, I usually check in my editor to see how many arguments it takes if I don't remember. That prevents these kinds of errors, anyway.
 

SFilip

Gone but not forgotten
Reaction score
634
yeah i noticed he found the problem...just wanted to help him (and anyone else reading this) prevent problems like this in the future since it seems not many people heard about jasscraft. ;)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top