HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Setting Unique Custom Values to units.

11-18-2004, 04:43 PM#1
tekkvicious
With the custom values related to the SPECIFIC unit... I can't figure it out!

Why i want to set custom values is becuase.. I want to be able to have.. multiple heros of the same type with the same summoning skill.

except when they resummon these units the old ones die.
or when they summon more then a summoned cap, one of the summons will die.

i cannot use pick all units of type because if you have more then 1 of the summoning hero there is no real way to tell which summon's were summoned by which unit. so you cannot really effective kill the propper summon. AND no feral spirit is not what im looking for.
11-18-2004, 06:14 PM#2
AIAndy
You can use the gamecache to store as many information about a hero/unit/whatever as you like that is efficient to look up and store.
11-18-2004, 08:46 PM#3
curi
if you want to store a unit in custom value, you need to use the return bug. search for that, lots of info.
11-18-2004, 11:27 PM#4
tekkvicious
Quote:
Originally Posted by AIAndy
You can use the gamecache to store as many information about a hero/unit/whatever as you like that is efficient to look up and store.

where can i find information on using the game cache, and etc. Are there any good code examples on it?
11-19-2004, 10:05 AM#5
KaTTaNa
Try to use the functions here.
Here is a little example that allows only one summon per unit - regardless of type:
Code:
local unit summoner = GetSummoningUnit()
local unit summon = GetSummonedUnit()
local unit old = GetHandleUnit(summoner, "summon")
if (old != null) then
    call KillUnit(old)
endif
// Store pointer to  new summon
call SetHandleHandle(summoner, "summon", summon)
11-19-2004, 12:43 PM#6
AIAndy
In the JASS Vault you will also find Lord Vexorian's pools. They are an efficient set implementation. With them you can store an indefinite number of summons per summoner then.
11-19-2004, 08:42 PM#7
tekkvicious
Quote:
Originally Posted by KaTTaNa
Try to use the functions here.
Here is a little example that allows only one summon per unit - regardless of type:
Code:
local unit summoner = GetSummoningUnit()
local unit summon = GetSummonedUnit()
local unit old = GetHandleUnit(summoner, "summon")
if (old != null) then
    call KillUnit(old)
endif
// Store pointer to  new summon
call SetHandleHandle(summoner, "summon", summon)

cool thanks man!! those functions really help ALOT!! btw, can i pass a unit group with sethandlehandle?

EDIT: Never mind I figureout how the functiosn work, and made my own to recieve unit groups.. ^_^ Thanks alot btw.