HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Item and Ability String Changing

12-22-2004, 07:08 PM#1
storm_silver
I would just like to know if it is possible to alter the string of an item/ability (delete depending on which can be done)
i.e

Code:
event - a unit aquires an item
condition - item type of item being manipulated = weapon modification accuracy
action - remove item being manipulated
???
???
give unit item ability = accuracy level 1/2/3/4/5/6/7/8/9

or will i have to make a lot of stacks? cos this would take a very long time as i am going for a weapon modification system similar to the type used in deus ex (great game ^^)
01-14-2005, 10:50 PM#2
storm_silver
anyone please i need to know if this is possible or if i will have to create a different blaster for every single combination (which would take absolutely fucking ages)
01-14-2005, 11:43 PM#3
Bibendus
If you are going to use something like item name you can convert an item name into string and using string functions you can extract the informations you need and modify what u want with triggers. That can't be done with abilities i think.


Else if you mean you want to use string like I0A5 for an item or A00f for an ability you can use jass to convert them into strings.
All abilities and items type are simple integer numbers so you can set an integer = to an item type.

For example you can do a custom script with this command:
Set udg_Integer1 = udg_ItemType1


Printing the Integer1 converted to string you will get a huge number. Thats because the item type ASCII code is converted into integers. ASCII should have a base of 256 characters (maybe 128 on wc3).
I'll make an approximative example because i dont remember all ascii codes :D


Item Type = I02a

Start from the last letter.
"a" Let's make it's = to 32.

"2" lets make it's = to 13.

"0" lets make it's = to 11.

"I" lets make it's = to 82.


The integer will result into:
Quote:
32 x 256^0 = 32 x 1 = 32
13 x 256^1 = 13 x 256 = 3328
11 x 256^2 = 11 x 65536 = 720896
82 x 256^3 = 82 x 16777216 = 1375731712
Summ all the results and u get the item type integer equivalent:
1376455968


If you are able to convert the item or ability type into a string you can do what you want with triggers and string checks.
You can see an ASCII table here:
http://umswe.wc3campaigns.com/weu/stuff.html


If i didnt understand what you were meaning plz try to be more clear on your next reply :D
01-15-2005, 12:05 AM#4
iNfraNe
Im not sure, but dont u need
Code:
function IT2I takes itemtype it returns integer
return it
return 0
endfunction
for that?
01-15-2005, 12:16 AM#5
Bibendus
No you dont need... Item Types and Abilities are simply integers... you cant set them with gui but you can with JASS.
I used that to store items for a saving system witouth making an item types array!
01-15-2005, 01:15 PM#6
iNfraNe
I know they are simple integers ;) but from my visual basic background u cant just do
integer = long cuz that will bug :P u need a function CInt(long) for that :P so I thought, might be same for jass...