• 0

    posted a message on Should this array not be set to false?
    Global Variables
        Unit Has Reached Waypoint = True <Boolean[9][40][7]>
    
        Local Variables
            loopCounter = 0 <Integer>
            loopCounter 2 = 0 <Integer>
            loopCounter 3 = 0 <Integer>
        Conditions
        Actions
            General - While (Conditions) are true, do (Actions)
                Conditions
                    loopCounter < 9
                Actions
                    General - While (Conditions) are true, do (Actions)
                        Conditions
                            loopCounter 2 < 40
                        Actions
                            General - While (Conditions) are true, do (Actions)
                                Conditions
                                    loopCounter 3 < 7
                                Actions
                                    Variable - Set Unit Has Reached Waypoint[loopCounter][loopCounter 2][loopCounter 3] = False
                                    Variable - Modify loopCounter 3: + 1
                            Variable - Modify loopCounter 2: + 1
                    Variable - Modify loopCounter: + 1
    

    Also what's with the colors?

    Anyway, through various debugging I've tracked the problem to this trigger. What it seems to be doing is setting only one of the entries to False and the rest remain True.

    Context: 9 is because there are 9 players, 40 is because there are 40 units per player, 7 is because there are 7 places that I'm tracking.

    Changing the code to this makes it work for some reason:

            General - While (Conditions) are true, do (Actions)
                Conditions
                    loopCounter < 9
                Actions
                    General - While (Conditions) are true, do (Actions)
                        Conditions
                            loopCounter 2 < 40
                        Actions
                            Variable - Set Unit Has Reached Waypoint[loopCounter][loopCounter 2][0] = False
                            Variable - Set Unit Has Reached Waypoint[loopCounter][loopCounter 2][1] = False
                            Variable - Set Unit Has Reached Waypoint[loopCounter][loopCounter 2][2] = False
                            Variable - Set Unit Has Reached Waypoint[loopCounter][loopCounter 2][3] = False
                            Variable - Set Unit Has Reached Waypoint[loopCounter][loopCounter 2][4] = False
                            Variable - Set Unit Has Reached Waypoint[loopCounter][loopCounter 2][5] = False
                            Variable - Set Unit Has Reached Waypoint[loopCounter][loopCounter 2][6] = False
                            Variable - Modify loopCounter 2: + 1
                    Variable - Modify loopCounter: + 1
    
    Posted in: Triggers
  • 0

    posted a message on Yet another arithmetic problem - Modulus

    Erm, how is your sequence even starting with 10 when you have a remainder of 4 to start? From what I can tell, your first iteration is:

    z = (var3 mod var2) = ((var - (cw - 1)) mod 6) = (5 - (2 - 1)) mod 6 = (5 - 1) mod 6 = 4 mod 6 = 4

    Then your next sequence is:

    z = (5 - (3 - 1)) mod 6) = 3 mod 6 = 3

    Posted in: Triggers
  • 0

    posted a message on How to auto hotkey units at int.

    @penguinwars: Go

    If it's for a unit that is placed on the map, you can select it under value.

    Posted in: Triggers
  • 0

    posted a message on Setting upgrade cost at init.

    Yes. Use the function Catalog Reference Set.

    Under Type, select Ability. Under Object, select the Ability that contains the upgrade. Find the field that relates to your desired upgrade. Looking at the Default Button field for existing upgrades is easy, but if it's custom, opening your ability in the data editor to see which tree the specific ability it's in is nice as well.

    Oh, the new value it asks for is a string, so to do calculations you'll have to use a Convert function, but that's fairly obvious.

    Posted in: Triggers
  • 0

    posted a message on [Solved]Issue Order Persists on Unit Revive

    @bulletbutter: Go

    Alright, so I made a more robust method of doing this that won't bug out from running over the same point or being forced to path above a point, etc.

    It uses an array of units and a two-dimensional array of booleans as well as the original point array and order array. There is also a Constant integer that is used to define the number of units spawned as well as the sizes of the two new arrays. If you wanted to have different wave sizes, you could just change this to a non-constant and just make the arrays large enough to be able to hold your largest wave size.

    Units are spawned via a loop that keys off of the constant. Each pass spawns a unit, assigns it to the unit array using the loop counter as the index, then issues the initial orders to the unit.

    There are 8 triggers that relate to the 8 waypoints I've placed. They're all pretty much identical in what they do. What they do is run a loop to determine which unit in the array the unit is and set an entry in the boolean array to true, using the loop counter and a specific # as the indexes. I would have done these 8 triggers as 1 using a loop, but there is no preset for Any Point, and I feel that using other events to get around this would be less efficient in terms of system resources. It's not like the triggers are very large, anyway.

    When the units revive, a loop triggers that cycles as many times as the number of units in the wave. There is an if-then statement that checks to see if the triggering unit is a unit in the array, using the loop counter as the index. On a true, it runs another loop that cycles as many times as there are waypoint. There is an if-then statement in this loop that checks to see if an entry in the boolean array is false, using the first and second loop counters as index #s. If it is false, then it issues the unit order in the order array using the second loop counter as the index.

    As for anti-walling, it's actually fairly straightforward. You create a new unit type (Pathing Tester) that is invisible within your unit spawn area and have it always stay there. Then you create a trigger that triggers when your builders build something with a comparison of the pathing cost of the Pathing Tester to your 'end' point. If it is -1 (what the game uses for infinity in this case) then remove building, refund cost, etc.

    Posted in: Triggers
  • 0

    posted a message on Help With Scroll Bar

    So I was just fiddling around with it and I noticed that scrolling down and back up and make the offset of your first achievement slightly different. I also changed the 775 in Scroll Bar Move where it is (-1/(Scroll Bar Length/775)) to 735 and it seemed to close that gap. I can't tell you why because I don't really understand your code enough.

    Posted in: Triggers
  • 0

    posted a message on Ability that deals damage based on current weapon's damage

    My guess? Make a dummy ability that targets a unit but doesn't do anything otherwise.

    Make a function that retrieves the damaging effect of parameter unit's currently equipped weapon.

    Make a trigger that fires when a unit is targeted by your dummy ability that deals damage, using the function you created to get the damaging effect by inputting the unit.

    If it weren't so late at night I'd try and implement it in a map and upload it.

    Posted in: Triggers
  • 0

    posted a message on Custom Function Problem

    Try adding back "Damage Effect". I'm thinking the game acquires Triggering Damage Taken from Damage Effect.

    Posted in: Triggers
  • 0

    posted a message on [Solved]Issue Order Persists on Unit Revive

    @bulletbutter: Go

    I'm assuming it's a tower-defense type map? Just be aware that if it's a map where players can alter pathing by putting stuff in the way, this code may be exploitable if they make it so the pathing of the unit goes above it's rally point.

    Posted in: Triggers
  • 0

    posted a message on Stalker Blink Micro - Works sometimes?

    @SoulTaker916: Go

    Well I meant the action as in the issue order command. Blink having no cooldown didn't change anything.

    Posted in: Triggers
  • 0

    posted a message on Is this possible?
    Quote from Forge_User_35205748: Go

    Im having a bit of difficulty understanding what your issue is.

    You can suck create units via trigger You can take Minerals/Gas from a player via triggers.

    It seems you are hold up on supplys. The existing supply system is fine for most cases but, you should consider scrapping it for your own supply system via triggers and use it todo all the fancy things you want. Then, you force the real supply in game to constantly mimic yours for the GUI.

    So I want to alter the costs of a specific unit rather than a unit type so that triggers that later call on that unit receive that value. So my 50 mineral 1 supply stalker would be included with a trigger that is something like "Get all units that cost 50 minerals" or "Get all units that cost 1 supply", etc.

    @Telenil: Go

    Yeah I'm trying to avoid having to make a data copy of every unit as well as change my triggers to spawn specific copy units rather than the unit they are copying.

    Posted in: Triggers
  • 0

    posted a message on [Solved]Issue Order Persists on Unit Revive

    @bulletbutter: Go

    If you were to order your points sequentially by sweeping down the map, would your order sequence remain the same? If so, I would suggest storing the orders in an array and issuing them through that with a condition that the unit isn't further down the map's y axis than the point it's supposed to go to.

    Made and uploaded a map demonstrating this concept. The start button will issue the order array to the marine. You'll see that every time you kill him with the DT, he'll keep on moving. The only issue with this is you can get him to path backwards if you put the DT in a way that will path him above the Y of the point, but I reckon you can use the concept in a way that avoids this. If it comes down to it, you can have the game calculate several paths distances and use some math to figure out where it is on an single-dimension (the overall path) whether it is 'below' or 'above' points to do the same thing I was talking about.

    Posted in: Triggers
  • 0

    posted a message on Is this possible?

    I want to make it so when any unit is created via a tirgger, it takes on the mineral/vespene/supply costs of another unit.

    As an example, if I were to create a Stalker (125/50/2), it would take on the costs of a Marine (50/0/1). I don't want to change the unit type cost, rather than current cost of the specific unit. I know you can change life like this, I'm just unsure of how to do this with the above things. Set unit property doesn't include any, but unit property includes supplies used/supplies made, which is puzzling to me. I can set a unit's life to a unit's supplies used/made, but not vice versa, etc.

    Posted in: Triggers
  • 0

    posted a message on Stalker Blink Micro - Works sometimes?
    Quote from TheLazzoro: Go

    @Tudentau: Go

    I think you need to change your event to "Unit Takes Damage" as this event will trigger every time a unit is damaged by something. This is only a theory, but I think the "Unit Is Attacked" event only fires when a unit acquires a target, which in your case is not what you want. Could you test if the stalker blinks if it is acquired by a new target while below 50% health? You could eventually also just micro the attacker yourself to move away from the stalker and then start attacking again while the stalker is below 50% health.

    I originally used this, but changed to Unit Is Attacked because it causes the stalker to blink before actually taking the hit, which is what you want when blink microing. As far as I could tell, it had the same problems with not blinking.

    I've tested two stalkers fighting each other, multiple stalkers attacking one, etc.

    I implemented the chat message with a counter to ensure that it wasn't failing based on the conditions/event. The failure is coming from the action, but I'm not sure why.

    Posted in: Triggers
  • 0

    posted a message on Button Woes

    How do I make submenus only show for the player who has control of the unit?

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