They are related yes, but are different concepts. That is why I am looking for ideas :)
Regarding my other post - in it I am trying to make ONE type of unit receive less damage from all attacks. (I am exploring a damage reduction buff on that unit that checks for distance from enemy attacks via validators)
Regarding this post - This is a weapon on ONE type of unit that reduces/increases its damage output, based on distance to the target.
I am thinking of making 3-5 identical hidden weapons, each with different range and damage. I add them to the same unit and based on the distance, it will fire the appropriate weapon. The player won't notice that the unit has 5 weapons.
Switch Effect is by far the cleanest and easiest way to do this. Same solution as your other post. You can dynamically control all damage amounts based on the distance the target is from the caster. Best of all, you can do it all with one weapon.
You could do it with multiple weapon types but might be a bit messier.
Some other nice things about using the switch effect, if the target is moving while you are firing it will apply the appropriate damage based on the actual distance. If you use multiple weapons and lets so it fired the long rage weapon and then the unit got rapidly got closer (teleport, or dash effects) it would still apply the long range damage even if it was close so it wouldn't really be realistic. Switch is the best way dynamically control that damage amount.
Let's use the Marine as an example.
If the Marine is attacking an enemy from range 5, it deals normal damage.
If the Marine is attacking an enemy from range 3-4, it deals more damage.
If the Marine is attacking an enemy from range 1-2, it deals double damage.
Any ideas how to make this work?
This sounds like the opposite of your other post...
They are related yes, but are different concepts. That is why I am looking for ideas :)
Regarding my other post - in it I am trying to make ONE type of unit receive less damage from all attacks. (I am exploring a damage reduction buff on that unit that checks for distance from enemy attacks via validators)
Regarding this post - This is a weapon on ONE type of unit that reduces/increases its damage output, based on distance to the target.
I am thinking of making 3-5 identical hidden weapons, each with different range and damage. I add them to the same unit and based on the distance, it will fire the appropriate weapon. The player won't notice that the unit has 5 weapons.
But maybe there are better ways?
Switch Effect is by far the cleanest and easiest way to do this. Same solution as your other post. You can dynamically control all damage amounts based on the distance the target is from the caster. Best of all, you can do it all with one weapon.
You could do it with multiple weapon types but might be a bit messier.
Some other nice things about using the switch effect, if the target is moving while you are firing it will apply the appropriate damage based on the actual distance. If you use multiple weapons and lets so it fired the long rage weapon and then the unit got rapidly got closer (teleport, or dash effects) it would still apply the long range damage even if it was close so it wouldn't really be realistic. Switch is the best way dynamically control that damage amount.
Do not forget the Location Range validator.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg