| 02-24-2007, 10:01 PM | #1 | |
Ok when I do this, it creates 2 errors JASS:
loop
exitwhen Loop > udg_Number_Of_HeroesNAbilities_Int
if GetUnitTypeId(GetSoldUnit()) == udg_M2B_Unit_List[Loop] then
call UnitAddAbilityBJ(udg_M2B_Spell_Book_List[Loop], udg_Hero[pn])
endif
set Loop = Loop + 1
endloop! Unable to convert ability (M2B_Spell_Book_List[]) to Integer ! Unable to convert unit type(M2B_Unit_List[]) to Integer Im not sure why, but I think it may be causing errors in WE Although when I actually do the same trigger in GUI, its looks exactly the same... > whole trigger
|
| 02-24-2007, 10:06 PM | #2 |
Perhaps it's a quick fix, but there are variable types called 'Unit Type' and 'Ability'. Using these over integers could help, at least for the time being? |
| 02-24-2007, 10:09 PM | #3 |
Unit Type and Ability are both integers. They are wrapped in the ' character. |
| 02-24-2007, 10:10 PM | #4 |
SO DO I need to about the ' tags around my unittype & ability variables in that context |
| 02-24-2007, 10:29 PM | #5 |
An Ability is an integer An Unit Type is a integer. An ability is something like 'aloc'. The first letter defines the type, in this case "ability", then the next 3 letters/numbers somehow describe it, if its a blizzard made ability thats comes with wc3, it will be part of the abilities name. If its a custom ability, it will be a Id of the ability, like 'a000', 'a001'. Unit Type's, upgrades, destructables, items, buffs, doodads, they are all integers to define types. First Letters of Rawcodes: Human Meele Type = h Human Campaign Type = n Orc Meele Type = o Orc Campgin Type = o Undead Meele Type = u Undead Campaign Type = u Nightelf Meele Type = e Nightelf Campaign Type = e & n Item = Nickname for item Destrucable = Unknown Doodad = Unknown Ability (Normal) = a Ability (Special) = s Buffs (Normal) = b Buffs (Effect) = x Upgrade = r To find out a rawcode (these numbers and letters, which are integers, also know as unit types, abilities etc), you go into the object editor and Ctrl+D. They are all integers, wrapped in ' to form integers. Like 'hpea' is peasent. 'hfoo' is footmen. If the editor is giving you a error, please take a screenshot, because its seriously fucked up if its not a mistake. |
| 02-25-2007, 07:48 AM | #6 |
uhh, I think I thought I mentioned it was Jasscraft, giving the error, and not WE, I was just wondering why jasscraft did it I didnt know that about the first letter though o_O |
| 02-25-2007, 08:05 AM | #7 |
Correction: itemtype, unittype and ability types are not integers. They are handles. JASS:type ability extends handle type unittype extends handle type itemtype extends handle However, these are very rarely (if ever?) used in JASS. Normally it wants the ID, which is an integer, given in the object editor like 'A000' (ASCII). |
| 02-25-2007, 10:25 AM | #8 |
Yes, maybe itemtype, unittype and ability are, but Ability, Unit Type, and Item Type, the GUI variables we are talking about, are not, they are integers. |
| 02-25-2007, 10:40 AM | #9 |
JASS:globals unit array udg_Hero rect gg_rct_Rect_035 boolean array udg_Attack_Mastery boolean array udg_Magic_Mastery boolean array udg_Strength_Mastery unit array udg_Backpack_Unit unittype array udg_Backpack_Type boolean array udg_Player_Has_Bought_Hero dialog array udg_Alignment_Dialog trigger gg_trg_SelectAlignmentDialog button array udg_Alignment_Dialog_Button integer array udg_Alignment_Level boolean array udg_Alignment_Bool string array udg_Alignment_String trigger gg_trg_Move_To_Base_4 ability array udg_M2B_Spell_Book_List unittype array udg_M2B_Unit_List integer udg_Number_Of_HeroesNAbilities_Int endglobals loop exitwhen Loop > udg_Number_Of_HeroesNAbilities_Int if GetUnitTypeId(GetSoldUnit()) == udg_M2B_Unit_List[Loop] then call UnitAddAbility(udg_Hero[pn], udg_M2B_Spell_Book_List[Loop]) endif set Loop = Loop + 1 endloop native UnitAddAbility takes unit whichUnit, integer AbilityId returns boolean Datatype ability is a HANDLE, not an INTEGER. The ID's are all of datatype INTEGER, that is how ALL raw codes are. You can not typecast an ability to an integer. [Without H2I() granted, but that gives the wrong integer for our purposes here] You're simply using the wrong datatype as an argument to the function. Just store the ability ids as datatype integer into an integer array and you avert this problem. |
| 02-25-2007, 11:07 AM | #10 |
There's also some errors : JASS:unittype array udg_M2B_Unit_List if GetUnitTypeId(GetSoldUnit()) == udg_M2B_Unit_List[Loop] then //line 99 Should return an integer, not a unittype. integer array udg_M2B_Unit_List then. JASS:unittype array udg_Backpack_Type set udg_Backpack_Unit[pn] = CreateUnit(p, udg_Backpack_Type[x], GetRectCenterX(r), GetRectCenterY(r), 270.00) Again. integer array udg_Backpack_Type That are the only problems. |
