I am currently trying to make ai units micro. Currently im woking on a condtion defenition to determine wither or not it can kyte. But, the problem is there is no way to get the range of a unit. I cannont just do this in the data editor as I want only cpus to do this and different difficulties micro differently. Any ideas?
Do I understand correctly that the problem is that you can't find a way to reference the range value of a weapon from the data field to use it in the Trigger Editor?
Try using the Catalog functions, mainly this one http://www.sc2mapster.com/wiki/galaxy/triggers/catalog-field-value-get/. I think there is also a "Catalog Field Value Get As Integer" function which might be even more handy for you since range is already an integer value and you don't even have to convert it from the catalog entry value.
Keep in mind though that some units have multiple weapons.
Is there anyway to get the current range? because an upgrade can change it. I also need a way to check if a unit is air.( I know there is a way to do this I just cant find it )
Is there anyway to get the current range? because an upgrade can change it. I also need a way to check if a unit is air.( I know there is a way to do this I just cant find it )
I'm pretty sure the catalog gets updated every time an upgrade changes a value in it (that's the main reason why every player has a different catalog), that means the function I talked about should always return the current range of the weapon.
I'm not 100% sure because I haven't needed something like this yet, but I'm pretty sure. Have you tried it?
I am currently trying to make ai units micro. Currently im woking on a condtion defenition to determine wither or not it can kyte. But, the problem is there is no way to get the range of a unit. I cannont just do this in the data editor as I want only cpus to do this and different difficulties micro differently. Any ideas?
Do I understand correctly that the problem is that you can't find a way to reference the range value of a weapon from the data field to use it in the Trigger Editor?
Try using the Catalog functions, mainly this one http://www.sc2mapster.com/wiki/galaxy/triggers/catalog-field-value-get/. I think there is also a "Catalog Field Value Get As Integer" function which might be even more handy for you since range is already an integer value and you don't even have to convert it from the catalog entry value.
Keep in mind though that some units have multiple weapons.
Is there anyway to get the current range? because an upgrade can change it. I also need a way to check if a unit is air.( I know there is a way to do this I just cant find it )
@penguinwars: Go
Check unit mover type.
You can get whether a unit is ranged or melee through validators. This is all you need to make a basic kiting AI.
I'm pretty sure the catalog gets updated every time an upgrade changes a value in it (that's the main reason why every player has a different catalog), that means the function I talked about should always return the current range of the weapon.
I'm not 100% sure because I haven't needed something like this yet, but I'm pretty sure. Have you tried it?
edit:
http://www.sc2mapster.com/forums/resources/tutorials/1250-triggers-catalog-field-value-get-set/
So yeah, it does definitely work that way.