Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
saving the string converts the integer from an integer to a string then to use it u change it from a string to an integer. The way i suggested does not need this.
im not on the pc so i cant do this.
u basically do this for the saving for the ability lvls
JASS:
call SaveInteger( abilityHash, GetHandleId( unit), lvl, 13) //the 13 will be for abilities 1 and 3
//the lvl is the lvl at which u want this to happen.
this is for the loading and lvling
JASS:
set i1 = LoadInteger( abilityHash, GetHandleId( u), GetUnitLvl( u)) //the 13 will be loaded and will point to abilities 1 and 3
set i2 = (i1 - (i1 / 10) * 10) + 1000 //this will set integer i2 = 1003
set i3 = ( ( i1 - i2) / 10) + 1000 //this will set integer i3 = 1001
u then get the ability by loading it from the hashtable like this.
JASS:
set i1 = LoadInteger( abilityHash, GetHandleId( u), i2) // this will load the ability to lvl
set i1 = LoadInteger( abilityHash, GetHandleId( u), i3) // this will load the other ability to lvl.
u then lvl the abilities of that unit.
i may of made mistakes im writing this on my phone
u would have to save what abilities u want to lvl at which lvl for the unit.
the unit is the parent key and the lvl of the unit u want the unit to gain those ability lvls is the child key. then if u want abilities 1 and 6 to lvl u store 16 as the number. for the hashtable portion dealing with the ability u would need to store the ability id for ability 1 in the hashtable keyed to the unit and the 1001 for ability 1. that will load the ability id.
after storing the data u never have to store it again all u do is load the data.
its basically creating a hashtable stored in a hashtable to simplify things.
u can use the unit type rather than the unit handle which would be better and make this easy for all units of that type to use this one simple thing without any collisions
Well.. it's upt to the OP to decide. You would have to propuse your method with a map and stuff. I still stick to strings because I feel it's easier to register the data.
i dont know how it is to register the data for urs.
for mine u register the the ability id using ability 1 is 1001 for the key. and the unit type for the parent key. so u do that for all abilities.
then u just register the lvls at which u want the abilities to lvl. so at lvl 2 i want abilities 1 and 2 to lvl. at ability 4 i want 3 and 4 to lvl. with this u can have all 6 abilites lvl up at the same lvl. ( just need to do a string length test to see how big the loop should be or what function to use if its decided to do it that way)
also i was suggesting that u could make it like this since u love to do this stuff. i wasnt trying to say use mine to give credits or anything lol. just a suggestion for what u already did. if the TO would rather my way and u dont want to make it then i might be able to but i dont have a lot of time lately. thats y i havent updated many things in my sig lately.
## is the number of abilities to upgrade on that level for that unit type. The rest of the strings are the abilities Id's. Since everything is stored in the same string, i think it's better than using additional Hash slots to save the abilities.
The "Bad" part of my script is that requires the String2Id function made by AceHart that turns the integers into their ASCII values and loops through entire abecedary in upper case and lower case and numbers from 0 to 9 for each one of the 4 numeric characters ('####')...
ya thats not to bad but it would be a lot better if u could find a way to store the integers in there for the ability id. im not sure about the speed for string2id. both of our systems have pros and cons. im not sure which would be faster for saving. mine is slightly more complicated but still fast. all u need to do is store 6 ability ids. so u dont need to keep rewritting all the ability ids. so mine may be faster even tho its slightly more complicated.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.