I want to retrieve the weapon damage value for my Hero (this example it's a zealot).
I've tried this with Catalogs. which works fine until I change the Units weapon using triggers. (let's say he changes from the standard Zealot weapons to the Dark Templar weapon, cause he's a hero and can equip different types of weaponry)
So far I've seen Catalogs only display the base value that is set as default. so when I change the weapon I'll need to change the location where I should look manually.....
But when I check the unit info area (bottom-center of the screen) it displays the damage correctly.
Another added problem to using the Catalog to solve my problem is that it isn't consistent for each weapon.
the Zealot weapon damage isn't listed in the first effect but the second one. (first says that the dmg is applied twice, second contains the dmg that is applied), while the Dark Templars weapon has it in the first effect.
putting this aside, I also increase the dmg based on an attribute (let's call it strength).
so if the Hero has more strength the dmg output of the Hero is increased. This is shown correctly in the unit info area....
So I was wondering if anyone found out how to get the data that is already displayed there?
(I don't care if it contains too much information. as long as I can retrieve the dmg along with it.)
Hopefully my problem is clear... if not let me know and I'll try to supply more info.
I am kinda sleepy, so I hope I understand this right. You want your Dialog Item to say "8 (+2)" to reflect the upgrade? I haven't worked with Dialogs, so there's a very real possibility that I'm dead wrong but... If on the dialog, instead of "8", replace it with:
<d ref="Effect,#EffectID#,Amount" />
I think it should work. For instance, if your Zealot's damage effect ID is "ZealotHeroU", then it would be:
<d ref="Effect,ZealotHeroU,Amount" />
As an aside, if you want the "8 (+2)" to simply say "10", in the damage effect object of the data editor, find the "Display Flags" field and select "Collapse Buffed" A similar flag is found in the unit object under "Life Armor Display Flag" for the armor value.
The only problem is that the Damage Effect Id changes with the weapon that is used.
And the location of the Damage Effect in comparison to the weapon can also change. (location differs for Zealot Weapon and DT Weapon.)
So I want to be able to retrieve the damage like the text that is already displayed just using the unit.
There is a function that returns unit's weapon, called something like "Unit Weapon" (it takes weapon ID as parameter, since your unit propably only has one, it's 1)
Then, each weapon has field called "Damage Display Effect" that says which effect's damage is displayed.
Getting the bonus would be harder, but I think looping through all behaviors-buffs and looking for damage bonuses should work, the green + comes only from buffs, right?
EDIT: I see what the problem is now. Many of the fields (in this case both "DisplayEffect" and "Effect") are defaulted to the weapon's id (=effect with same id as the weapon).
I wonder what the catalog value is in such case, since CatalogGetValue should default to parent's value in case that the value is missing, so which "defaulting" comes first? (I can't try it out right now, editor crashes because of graphic card)
thanks for the information about that unit weapon..... At least now I can retrieve the correct weapon... only annoying thing left is that at the moment the weapon damage position changes per weapon, but this can be fixed by just changing the way each weapon that I'll put in the game works. so that they all use the same method .... (although I'd still prefer to use something like: GetUnitDamageInfo(Unit). )
still hopes that someone will supply the result that I'm looking for.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I want to retrieve the weapon damage value for my Hero (this example it's a zealot).
I've tried this with Catalogs. which works fine until I change the Units weapon using triggers. (let's say he changes from the standard Zealot weapons to the Dark Templar weapon, cause he's a hero and can equip different types of weaponry)
So far I've seen Catalogs only display the base value that is set as default. so when I change the weapon I'll need to change the location where I should look manually.....
But when I check the unit info area (bottom-center of the screen) it displays the damage correctly.
Another added problem to using the Catalog to solve my problem is that it isn't consistent for each weapon.
the Zealot weapon damage isn't listed in the first effect but the second one. (first says that the dmg is applied twice, second contains the dmg that is applied), while the Dark Templars weapon has it in the first effect.
putting this aside, I also increase the dmg based on an attribute (let's call it strength).
so if the Hero has more strength the dmg output of the Hero is increased. This is shown correctly in the unit info area....
So I was wondering if anyone found out how to get the data that is already displayed there?
(I don't care if it contains too much information. as long as I can retrieve the dmg along with it.)
Hopefully my problem is clear... if not let me know and I'll try to supply more info.
I am kinda sleepy, so I hope I understand this right. You want your Dialog Item to say "8 (+2)" to reflect the upgrade? I haven't worked with Dialogs, so there's a very real possibility that I'm dead wrong but... If on the dialog, instead of "8", replace it with:
<d ref="Effect,#EffectID#,Amount" />
I think it should work. For instance, if your Zealot's damage effect ID is "ZealotHeroU", then it would be:
<d ref="Effect,ZealotHeroU,Amount" />
As an aside, if you want the "8 (+2)" to simply say "10", in the damage effect object of the data editor, find the "Display Flags" field and select "Collapse Buffed" A similar flag is found in the unit object under "Life Armor Display Flag" for the armor value.
@Azkit: Go
The only problem is that the Damage Effect Id changes with the weapon that is used. And the location of the Damage Effect in comparison to the weapon can also change. (location differs for Zealot Weapon and DT Weapon.) So I want to be able to retrieve the damage like the text that is already displayed just using the unit.
I didn't realize that the effect was changing, I thought it was just an upgrade. I dunno then.
There is a function that returns unit's weapon, called something like "Unit Weapon" (it takes weapon ID as parameter, since your unit propably only has one, it's 1) Then, each weapon has field called "Damage Display Effect" that says which effect's damage is displayed. Getting the bonus would be harder, but I think looping through all behaviors-buffs and looking for damage bonuses should work, the green + comes only from buffs, right?
EDIT: I see what the problem is now. Many of the fields (in this case both "DisplayEffect" and "Effect") are defaulted to the weapon's id (=effect with same id as the weapon). I wonder what the catalog value is in such case, since CatalogGetValue should default to parent's value in case that the value is missing, so which "defaulting" comes first? (I can't try it out right now, editor crashes because of graphic card)
@M0rt1mer: Go
thanks for the information about that unit weapon..... At least now I can retrieve the correct weapon... only annoying thing left is that at the moment the weapon damage position changes per weapon, but this can be fixed by just changing the way each weapon that I'll put in the game works. so that they all use the same method .... (although I'd still prefer to use something like: GetUnitDamageInfo(Unit). )
still hopes that someone will supply the result that I'm looking for.