- Joined
- Mar 3, 2009
- Messages
- 327
-
Custom script: local unittype utype = GetUnitTypeId(GetTriggerUnit())
is it saying that GetUnitTypeId(GetTriggerUnit()) isn't valid as a unit type?
I gets a compile error saying "type mismatch in assignment"
Custom script: local unittype utype = GetUnitTypeId(GetTriggerUnit())
is it saying that GetUnitTypeId(GetTriggerUnit()) isn't valid as a unit type?
CreateNUnitsAtLoc( integer numberofunits, integer UnitID, player OwningPlayer, location Position, real facing angle)
thanks. one more thing... call CreateUnitAtLoc( ii, Player(11), udg_Creep_Point[GetUnitUserData(GetTriggerUnit())]), 270) expected end of line :/
2 Solutions to this problem.
Not 100% sure if Adiktuz's suggestion would work. I don't think so though. You see the first part of CreateUnitAtLoc requires a unittype, not an integer.
What you need to do is change the following:
call CreateUnitAtLoc(GetUnitTypeId(ii), etc.
to:
call CreateUnitAtLoc(ConvertUnitType(ii), etc.
That should do it perfectly. Anyways, if you're using custom script, you might as well start reading JASS tutorials and make the conversion. It can make a big difference, since GUI uses bjs, most of which will leak.
Also don't forget to remove leaks from your map.
If you do make the switch, grab JNGP before you do and use it's awesome Function List to help you figure out what natives to use and what functions you need to complete your triggers.
CreateUnitAtLoc takes integer, player, location, real returns nothing
You use JASS as well, and you should be aware that while the value it requires says integer, it is actually some sort of special integer called a unittype.
I never understood myself why 'A002' is both an integer and a unittype, but somehow they're not interchangable, but that just seems to be the rules of JASS. Just because it takes an integer in that spot does not mean you can put a 1 there and you'll get a unit. At least, I don't think.
My bad, you're correct. Sorry.
As adikutz stated, simply use (ii, etc.
whose adikutz? ^^