HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Convert ItemID to String?

11-19-2004, 09:51 AM#1
Bibendus
Does any way to do that exists?
I tried using the UnitIt2String function thinking that items are + or - units but it doesnt work.

set udg_String1 = UnitId2StringBJ(GetItemTypeId(udg_Item1))

I need that function to make a char saving system but i dont want to create 1 array with all ids.
11-20-2004, 01:17 PM#2
Vexorian
err, this is non sense, why would you use it? you can just use it as integer to the encoding then at the end convert the gigantic integer into a string.
11-20-2004, 01:53 PM#3
Bibendus
The problem is that i want to convert the id of an item (ex I01A) to a string and take only the last 2 chars converting them to integer. Can't i do that? Unfortunately the ItemId is not a number and i cant print it as integer or string.
11-21-2004, 10:03 PM#4
Vexorian
ItemIds are indeed integers

I think this should help : http://kattana.users.whitehat.dk/viewfunc.php?id=221
11-22-2004, 06:50 AM#5
Bibendus
The code seems good, when I'm at home ill try.
Are u sure that i can use a ItemId in a function that requires a integer type? Usually when i miss the right Var Type i get an error...
11-22-2004, 08:03 PM#6
Vexorian
ItemIds are integers, they aren't any other type, they are integers, only integers, it is world editor the thing that simulates them as another type for obscure reasons.

AbilityIds , unit id 's , weather effect types, upgrades and everything which is a rawcode between '' is an integer too
11-23-2004, 09:55 AM#7
Bibendus
Hey it works greatly.
I tried simply to assign a itemtype var to an integer var and works.

set udg_Integer = udg_ItemType

Tnx vex :D