I recommend summing all the players damage and using player_damage[player]/sum_rank as the proportion of vespene to give. Then you can just multiply that by the Total amount of vespene to distribute or smth else. Otherwise use a simple sorting algorithm such as insertion sort.
Yeah I found that the problem with UnitAbilityAdd not working for certain abilities has to do with <AbilSetId value=""/> being set in about 50% of cases. In those cases removing that line fixes the problem. In the rest of cases, copying the ability and then removing that line from the copied ability can work, along with DataCollection fixes the problem.
Not sure if this is intentional or not but seems like a bug to me.
I think it is probably a bug because the abilities worked on the cloner unit with the other method of cloning. All my abilities just require energy and the ones that don't work do not seem to have anything in common.
Thanks for taking the time and effort to explain that Banebirst!
I was able to get it part of it working via the PTR features. However, I have noticed both on your test map and on mine that certain cloned abilities will not cast. The button will appear fine but when you try and use the ability (either via clicking or hotkey) it just does nothing.
I noticed this on Zealot charge and Marine stimpack on the test map and several abilities on my map. Can't seem to find the source of it.
Would be super sweet to get it working this way though. Code bloat is way down and it looks cleaner :)
Actually fooled around a bit with the PTR patch. Unfortunately it didn't solve my problem because the abilities i need to replace need to be of the same CAbil class. Perhaps I could just have 1 ability for each CAbil class and replace that but haven't tried it yet and I do not believe it changes the actual button.
Anyways thanks again BaneFirst it has been working fine with killing and recreating the unit for a while now :).
Edit: Found the problem with a helpful member on the discord. Just had to delete and readd the button to the command card even though it was the same button.
I have an ability that is shared (used) with two units. The ability shows fine on the command card on one of the units and on the other, the ability shows as greyed out with an incorrect requirement "Not being attacked". I have verified that I am using the same ability and buttons between both units. (The ability itself only has one unrelated requirement that has the Show flag -- under (Basic) Can Be Suppressed turned off)
What could be causing this kind of behavior? I'm a bit stumped.
Hi, I'm trying to create an ability that will clone the target units ability temporarily then revert back after a certain amount of time only for that one unit (kind of like kirby in smash bro's). Not sure the best way to go about this. The map I am working on has a lot of units with a lot of different abilities. Is there an easy way to go about this? I've thought about using catalog triggers or giving the unit every ability in the game and just using triggers to show/hide the ability they want to clone. Ideally a data solution would be preferable but can't think of a way to do it.
0
I recommend summing all the players damage and using player_damage[player]/sum_rank as the proportion of vespene to give. Then you can just multiply that by the Total amount of vespene to distribute or smth else. Otherwise use a simple sorting algorithm such as insertion sort.
0.954011065006916
Yeah I found that the problem with
UnitAbilityAdd
not working for certain abilities has to do with<AbilSetId value=""/>
being set in about 50% of cases. In those cases removing that line fixes the problem. In the rest of cases, copying the ability and then removing that line from the copied ability can work, along withDataCollection
fixes the problem.Not sure if this is intentional or not but seems like a bug to me.
0
I think it is probably a bug because the abilities worked on the cloner unit with the other method of cloning. All my abilities just require energy and the ones that don't work do not seem to have anything in common.
0.953798234988752
Thanks for taking the time and effort to explain that Banebirst!
I was able to get it part of it working via the PTR features. However, I have noticed both on your test map and on mine that certain cloned abilities will not cast. The button will appear fine but when you try and use the ability (either via clicking or hotkey) it just does nothing.
I noticed this on Zealot charge and Marine stimpack on the test map and several abilities on my map. Can't seem to find the source of it.
Would be super sweet to get it working this way though. Code bloat is way down and it looks cleaner :)
0
Actually fooled around a bit with the PTR patch. Unfortunately it didn't solve my problem because the abilities i need to replace need to be of the same CAbil class. Perhaps I could just have 1 ability for each CAbil class and replace that but haven't tried it yet and I do not believe it changes the actual button.
Anyways thanks again BaneFirst it has been working fine with killing and recreating the unit for a while now :).
0
Edit: Found the problem with a helpful member on the discord. Just had to delete and readd the button to the command card even though it was the same button.
0
I have an ability that is shared (used) with two units. The ability shows fine on the command card on one of the units and on the other, the ability shows as greyed out with an incorrect requirement "Not being attacked". I have verified that I am using the same ability and buttons between both units. (The ability itself only has one unrelated requirement that has the Show flag -- under (Basic) Can Be Suppressed turned off)
What could be causing this kind of behavior? I'm a bit stumped.
0
Made perfect sense thanks BaneBirst
0
Hi, I'm trying to create an ability that will clone the target units ability temporarily then revert back after a certain amount of time only for that one unit (kind of like kirby in smash bro's). Not sure the best way to go about this. The map I am working on has a lot of units with a lot of different abilities. Is there an easy way to go about this? I've thought about using catalog triggers or giving the unit every ability in the game and just using triggers to show/hide the ability they want to clone. Ideally a data solution would be preferable but can't think of a way to do it.
Any ideas? Thanks.