• 0

    posted a message on Require Resources to Train But Not Warp

    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.

    Posted in: Triggers
  • 0

    posted a message on [UI] Protoss Supply Mod and Warp Gate Function

    W Hotkey:
    What I want is for Warp Gates to display a number over each unit's training button to show how many of that unit can be trained, instead of (or in addition to) the current feature which shows the number of Warp Gates off cooldown.
    For example, I train 3 stalkers from Gateways. With one Warp Gate selected, the Stalker button should show "3" (StalkersInWarpSupply = 3).


    I don't know where to set up that kind of function, if it's possible.

     

    I'm a programmer but I've never used the SC2 Editor until now. I had a concept for a change to Gateways that would make them worth having selectively after researching Warp Gate. Most of the changes were easy to make, but there are a few I'm stuck on.


    Gateway units are removed after being trained at the Gateway and a variable is modified to add +1 for that unit type.
    If the variable is greater than 1, a Warp Gate can then warp the unit in. I refer to this as 'Warp Supply'.

     

    Posted in: Miscellaneous Development
  • To post a comment, please or register a new account.