After making a working upgrade ability, I came across a small issue: how do I upgrade my team's units? In my MOBA style game, the AI periodically spawns stuff. I want to be able to upgrade the stuff. I placed the upgrade ability in a building owned by the AI and set the alliance such that the AI treats the player as an ally with shared spending (so it's the player's money used for upgrades).
However, despite that, the game seems to insist on upgrading the player's "units" rather than the AI's. My question is, how do I make it so that it upgrade the AI's units?
a trigger solution would be to detect when your upgrade level changes (or when a unit finishes an upgrade) then add an upgrade level to the desired upgrade for the desired allied player.
a data solution would be a little messy (my way at least). you would have a buff on the unit that does the upgrades that has a requirement to check and see if you have the desired upgrade level. when you have the upgrade level, the buff launches a search effect targeting only allied player units that can research upgrades (use unit type validators for those specific units) and orders the allied unit to research the upgrade. downside is you would have to create a buff for each and EVERY SINGLE upgrade and its levels. Ex: you would have to create 3 separate buffs with their own unique requirements to detect each upgrade level for, say, the terran weapons upgrade (3 buffs due to the upgrade having 3 levels).
I am using the default research ability. I will try what you recommended and let you know how it goes, thanks!
edit: It appears to be an issue with the upgrade ability itself. In the Effects+ I have it set so that the cost of it increases by 100 each time used but it didn't trigger. I also added an Effect that would increase the player's hero's health by 100 per upgrade to see if it did that and it didn't. What is a good up to date upgrade guide?
Instead of using a research ability directly, you could use an instant effect that orders that same structure to research the upgrade. Visually it would look the same, but I think this way you could force the AI player to research it.
@Stormahawk: Go Structures can have more than one research ability, that's not a problem. Are you sure you have the correct upgrade set in the research ability and in the command card?
My upgrades wouldn't work all because I didn't have this box checked:
However, I can't get the cost of the upgrade to increase even though I set it in effects to, nor can I get it to show the little number by the upgrade icon (in the upgrade building, not unit) to indicate the current upgrade level.
After making a working upgrade ability, I came across a small issue: how do I upgrade my team's units? In my MOBA style game, the AI periodically spawns stuff. I want to be able to upgrade the stuff. I placed the upgrade ability in a building owned by the AI and set the alliance such that the AI treats the player as an ally with shared spending (so it's the player's money used for upgrades).
However, despite that, the game seems to insist on upgrading the player's "units" rather than the AI's. My question is, how do I make it so that it upgrade the AI's units?
a trigger solution would be to detect when your upgrade level changes (or when a unit finishes an upgrade) then add an upgrade level to the desired upgrade for the desired allied player.
a data solution would be a little messy (my way at least). you would have a buff on the unit that does the upgrades that has a requirement to check and see if you have the desired upgrade level. when you have the upgrade level, the buff launches a search effect targeting only allied player units that can research upgrades (use unit type validators for those specific units) and orders the allied unit to research the upgrade. downside is you would have to create a buff for each and EVERY SINGLE upgrade and its levels. Ex: you would have to create 3 separate buffs with their own unique requirements to detect each upgrade level for, say, the terran weapons upgrade (3 buffs due to the upgrade having 3 levels).
@Stormahawk: Go
are you using a default research ability? there is a field TechPlayer, default settings is Upkeep, changing it to Owner might help
I am using the default research ability. I will try what you recommended and let you know how it goes, thanks! edit: It appears to be an issue with the upgrade ability itself. In the Effects+ I have it set so that the cost of it increases by 100 each time used but it didn't trigger. I also added an Effect that would increase the player's hero's health by 100 per upgrade to see if it did that and it didn't. What is a good up to date upgrade guide?
What common issues cause upgrades to fail working? Sorry about double post; seems my edit a few days ago went unnoticed.
Instead of using a research ability directly, you could use an instant effect that orders that same structure to research the upgrade. Visually it would look the same, but I think this way you could force the AI player to research it.
@SoulFilcher: Go
Good idea, but the issue was with my research not working at all. Can conflicting research abilities cause one not to work?
@Stormahawk: Go Structures can have more than one research ability, that's not a problem. Are you sure you have the correct upgrade set in the research ability and in the command card?
My upgrades wouldn't work all because I didn't have this box checked:
However, I can't get the cost of the upgrade to increase even though I set it in effects to, nor can I get it to show the little number by the upgrade icon (in the upgrade building, not unit) to indicate the current upgrade level.
Bump since my edit may have gone unnoticed again.