I'm creating a Gateway/Warp Gate melee mod. Most of it functions as intended right now. Basically Gateways train units and Warp Gates warp them in after they're trained as two separate commands. Intended to make Gateways more interesting. Protoss have an additional 40 "warp supply" for units not on the map.
When Warp Gate is researched, Gateways train units at 20 seconds each (old warp gate times). Upon training, the unit is removed and +1 to a "WarpSupply_Stalker" integer array. Supply is also adjusted by triggers. If the integer >= 1, warping the unit from Warp Gates will refund its resource cost and -1 to the unit's Warp Supply int.
If the integer < 1, warping the unit will instantly kill it and refund its resource cost.
The Problem Right now, all the unit costs are normal, which applies to both training and warping. Resources are refunded on a successful warp but you have to have 125/50 to train a stalker even though it will be refunded. I want Warping to not require resources. I haven't changed which abilities are used in Data, just triggers that react when they're used.
So while the player is waiting to place their warped stalker by a pylon, the unit doesn't require any resources except my existing variable check (WarpSupply_Stalkers). Not sure how to do that.
I want Warp tooltips to still display resource costs accurately (100/0, 125/50, etc)
I want training from Gateways to consume resources
I want warping from Warp Gates to not consume resources (and not require them)
Solution #1
I've thought about making duplicate units (SupplyZealot) that trains from the Gateway, so it can have a cost and the normal Zealot won't.
Gateway trains Zealots for (100). "Research Warp Gate" removes cost from zealots (and other units).
(new)Warp Gateway trains (new)SupplyZealots for (100), which are removed upon creation and added to an integer. 6 new units and 6 new buttons Warp Gate trains Zealots for (0) and subtracts from integer.
Drawback: That would require a lot more editing in Data and I'd like to see if there's an easier solution I'm overlooking.
Solution #2
Change all costs to 0 and subtract the correct resources via trigger when Gateway units start training. Add them back when it's cancelled.
Drawback: Tooltips would no longer display unit costs.
Solution #3
When a warp-in command is failed due to lack of resources, check for warp supply integer and if >= 1, warp in at the mouse location.
Drawback: Still get the audio for "not enough minerals".
Thanks for your help. I'm a programmer but this is the first time I've used the editor and I don't know many tricks.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm creating a Gateway/Warp Gate melee mod. Most of it functions as intended right now.
Basically Gateways train units and Warp Gates warp them in after they're trained as two separate commands. Intended to make Gateways more interesting. Protoss have an additional 40 "warp supply" for units not on the map.
When Warp Gate is researched,
Gateways train units at 20 seconds each (old warp gate times). Upon training, the unit is removed and +1 to a "WarpSupply_Stalker" integer array. Supply is also adjusted by triggers.
If the integer >= 1, warping the unit from Warp Gates will refund its resource cost and -1 to the unit's Warp Supply int.
If the integer < 1, warping the unit will instantly kill it and refund its resource cost.
The Problem
Right now, all the unit costs are normal, which applies to both training and warping. Resources are refunded on a successful warp but you have to have 125/50 to train a stalker even though it will be refunded. I want Warping to not require resources. I haven't changed which abilities are used in Data, just triggers that react when they're used.
So while the player is waiting to place their warped stalker by a pylon, the unit doesn't require any resources except my existing variable check (WarpSupply_Stalkers). Not sure how to do that.
Solution #1
I've thought about making duplicate units (SupplyZealot) that trains from the Gateway, so it can have a cost and the normal Zealot won't.
Gateway trains Zealots for (100).
"Research Warp Gate" removes cost from zealots (and other units).
(new)Warp Gateway trains (new)SupplyZealots for (100), which are removed upon creation and added to an integer. 6 new units and 6 new buttons
Warp Gate trains Zealots for (0) and subtracts from integer.
Drawback: That would require a lot more editing in Data and I'd like to see if there's an easier solution I'm overlooking.
Solution #2
Change all costs to 0 and subtract the correct resources via trigger when Gateway units start training. Add them back when it's cancelled.
Drawback: Tooltips would no longer display unit costs.
Solution #3
When a warp-in command is failed due to lack of resources, check for warp supply integer and if >= 1, warp in at the mouse location.
Drawback: Still get the audio for "not enough minerals".
Thanks for your help. I'm a programmer but this is the first time I've used the editor and I don't know many tricks.