Increasing Attack Range - Sollution?
So I did some research and it seems without directly replacing a unit it is next to impossible to increase or decrease a unit's attack range. One option, the most viable yet flawed, showed some promise.
Upgrades can easily increase a unit's attack range, their flaw being it is impossible to decrease said upgrade level once it has been increased. To work around this, I made two separate upgrades, Attack Bonus Positive and Attack Bonus Negative. On pickup of my Bow item, a level is added to AB-Positve, increasing it's attack range by 600. When the item is dropped, a level is added to AB-Negative, who's upgrade effect is to reduce attack range by -600, thus returning the unit's attack range to normal.
I don't know if this would work all the time of if it is a sound system, but it worked in some early tests. Sorta posting this half an idea/half needs better testing of its limits/Good to know if it does work, since I have found the 'Increase Range' problem often and am facing it myself currently.
EDIT: It works! Using two upgrades and the following triggers, I got a unit to consistently gain and loose attack range:
The unit has both upgrades on it as being used, and the upgrade's base and increment are both 400 and -400 respectively.
So I did some research and it seems without directly replacing a unit it is next to impossible to increase or decrease a unit's attack range. One option, the most viable yet flawed, showed some promise.
Upgrades can easily increase a unit's attack range, their flaw being it is impossible to decrease said upgrade level once it has been increased. To work around this, I made two separate upgrades, Attack Bonus Positive and Attack Bonus Negative. On pickup of my Bow item, a level is added to AB-Positve, increasing it's attack range by 600. When the item is dropped, a level is added to AB-Negative, who's upgrade effect is to reduce attack range by -600, thus returning the unit's attack range to normal.
I don't know if this would work all the time of if it is a sound system, but it worked in some early tests. Sorta posting this half an idea/half needs better testing of its limits/Good to know if it does work, since I have found the 'Increase Range' problem often and am facing it myself currently.
EDIT: It works! Using two upgrades and the following triggers, I got a unit to consistently gain and loose attack range:
-
Ranged Distance Gain
-
Events
- Unit - A unit Acquires an item
-
Conditions
- (Item-type of (Item being manipulated)) Equal to Shortbow
-
Actions
- Set AB_Positive_Level = (Current research level of Attack Range Bonus for Player 1 (Red))
- Player - Set the current research level of Attack Range Bonus to (AB_Positive_Level + 1) for Player 1 (Red)
-
Events
-
Ranged Distance Loss
-
Events
- Unit - A unit Loses an item
-
Conditions
- (Item-type of (Item being manipulated)) Equal to Shortbow
-
Actions
- Set AB_Negative_Level = (Current research level of Attack Range Negative Bonus for Player 1 (Red))
- Player - Set the current research level of Attack Range Negative Bonus to (AB_Negative_Level + 1) for Player 1 (Red)
-
Events
The unit has both upgrades on it as being used, and the upgrade's base and increment are both 400 and -400 respectively.
Last edited: