- Joined
- May 15, 2008
- Messages
- 147
OK I've got the following issue:
When using ForGroup() function, I set the group and code parameter however, I cannot add the parameter to the code inside the brackets and I need it since I'm using hashtable to save data and transfer the amount of damage and damager unit into that separate function that deal damage let's call it Example_Damage, it should take unit and real parameters.
Here is the closer explanation:
Can I maybe also use:
within the Example_Damage functionto get the id of handle (which is the key for the hashtable data) and use it to get u1 the damager and damage real?
When using ForGroup() function, I set the group and code parameter however, I cannot add the parameter to the code inside the brackets and I need it since I'm using hashtable to save data and transfer the amount of damage and damager unit into that separate function that deal damage let's call it Example_Damage, it should take unit and real parameters.
Here is the closer explanation:
JASS:
call ForGroup(ExampleGroup, function Example_Damage)
//Thats the right function, however I need something like this
call ForGroup(ExampleGroup, function Example_Damage(u1, damage))
//since I'm using hashtable to save the data for spell like u1 which is
//damager and "damage" which is real amount of damage.
//The problem is that I'm using the expiring id of a timer as a parentkey
//for hashtable storage and I can get it only in the Example_Action func
//which sort of represents the function which does the effects for the spell,
//or not?
//Above function gives error when saving map becouse of the () after
//the Example_Damage code callback
Can I maybe also use:
JASS:
local timer t = GetExpiredTimer()
local integer id = GetHandleId(t)