I have a trigger which rewards players for making a kill (noted below).
The trigger works successfully, but I notice there are two main problems with it. It is fine if a player creates a viking or tank, and it is killed before it can transform, then the killing player receives their due reward.
HOWEVER, if the unit transforms, then the kill reward is always 0. This is a massive problem since it allows players going tank or viking heavy to have their enemies lack an adequate reward for killing their stuff. I presume it's a data problem. The tank and viking also have the same cost, regardless of their respective mode, so it's not be just forgetting to fill in a field.
The secondary concern, which is less important as it affects game play less gratuitously, is when the killing unit does not exist. The trigger then throws up an error message for everyone about array index of the unit (which does not exist anymore) is out of bounds. How can I tweak the trigger so that it accounts for that possibility?
I know this is more of a trigger question, but have you considered using the Combat: Kill Resource field in the unit's Data representation? Morphing units like the Siege Tank and Viking consider their alternate forms distinctly different units, so if you just give each form the same Kill Resource reward I'd think it'd achieve the same effect.
As far as the error you're getting, I suggest you try adding a condition (Killing Unit != No Unit). If the condition fails, the trigger won't run; this is what you want, right? If you're killing the unit with some other effect that should still yield a resource reward, though, then it'll be a bit more work I think.
I have a trigger which rewards players for making a kill (noted below).
The trigger works successfully, but I notice there are two main problems with it. It is fine if a player creates a viking or tank, and it is killed before it can transform, then the killing player receives their due reward.
HOWEVER, if the unit transforms, then the kill reward is always 0. This is a massive problem since it allows players going tank or viking heavy to have their enemies lack an adequate reward for killing their stuff. I presume it's a data problem. The tank and viking also have the same cost, regardless of their respective mode, so it's not be just forgetting to fill in a field.
The secondary concern, which is less important as it affects game play less gratuitously, is when the killing unit does not exist. The trigger then throws up an error message for everyone about array index of the unit (which does not exist anymore) is out of bounds. How can I tweak the trigger so that it accounts for that possibility?
Any help, thanks.
REFERENCE: http://tinypaste.com/c477c384
I know this is more of a trigger question, but have you considered using the Combat: Kill Resource field in the unit's Data representation? Morphing units like the Siege Tank and Viking consider their alternate forms distinctly different units, so if you just give each form the same Kill Resource reward I'd think it'd achieve the same effect.
As far as the error you're getting, I suggest you try adding a condition (Killing Unit != No Unit). If the condition fails, the trigger won't run; this is what you want, right? If you're killing the unit with some other effect that should still yield a resource reward, though, then it'll be a bit more work I think.
Thank you very much! I think this has sorted everything :)