• 0

    posted a message on How to make a proper victory/defeat trigger that works?!

    So first make 2 unit group global variables "Leader Group A" and "Leader Group B". At the beginning of the match I'd put all the heroes in their respective group.

    So It'd look something like this.

    Melee Initialization
        Events
            Game - Map initialization
        Local Variables
        Conditions
        Actions
            Unit Group - Add "Hero 1" to Leader group A (This is a 'add unit to unit group' action)
            Unit Group - Add "Hero 2" to Leader group A
            Unit Group - Add "Hero 3" to Leader group A
            Unit Group - Add "Hero 4" to Leader group B
            Unit Group - Add "Hero 5" to Leader group B
            Unit Group - Add "Hero 6" to Leader group B
    

    Then my win/lose trigger would look like this.

    Win/lose
        Events
            Unit - Any Unit dies
        Local Variables
        Conditions
            Or
                Conditions
                    (Triggering unit) == Hero 1
                    (Triggering unit) == Hero 2
                    (Triggering unit) == Hero 3
                    (Triggering unit) == Hero 4
                    (Triggering unit) == Hero 5
                    (Triggering unit) == Hero 6
        Actions
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    (Number of Living units in Leader group A) == 0
                Then
                    Game - End game in Defeat for player 1 (Show dialogs, Show score screen)
                    Game - End game in Defeat for player 2 (Show dialogs, Show score screen)
                    Game - End game in Defeat for player 3 (Show dialogs, Show score screen)
                    Game - End game in Victory for player 4 (Show dialogs, Show score screen)
                    Game - End game in Victory for player 5 (Show dialogs, Show score screen)
                    Game - End game in Victory for player 6 (Show dialogs, Show score screen)
                Else
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    (Number of Living units in Leader group B) == 0
                Then
                    Game - End game in Victory for player 1 (Show dialogs, Show score screen)
                    Game - End game in Victory for player 2 (Show dialogs, Show score screen)
                    Game - End game in Victory for player 3 (Show dialogs, Show score screen)
                    Game - End game in Defeat for player 4 (Show dialogs, Show score screen)
                    Game - End game in Defeat for player 5 (Show dialogs, Show score screen)
                    Game - End game in Defeat for player 6 (Show dialogs, Show score screen)
                Else
    

    The main action in the above part is "End game for player". They are underneath "if then" actions.

    Posted in: Triggers
  • 0

    posted a message on How to make a proper victory/defeat trigger that works?!

    In that case, I would probably make 2 "leader groups" and use that same 'number of units in "leader group" condition, but have it set to 0. When that happens, end the game for all players on that team in loss, and victory for the other team. Does that make sense, or would it help to show it more in trigger form?

    Posted in: Triggers
  • 0

    posted a message on Spacing in this forum

    Testing
    Testing

    It works! Thanks!

    Posted in: Off-Topic
  • 0

    posted a message on Spacing in this forum

    @Nebuli2: Go

    Yes, exactly.

    Edit: And Interestingly enough if I quote you and preview it, it isn't spaced out like yours is...

    Posted in: Off-Topic
  • 0

    posted a message on Spacing in this forum

    So I was wondering if there's a way to single space on these forums without using code tags. If I try to, it'll just throw everything together. I end up having to double space no matter what and often it just seems like more space than necessary.

    Example

    I'm single spacing each sentence now. I'm single spacing each sentence now. I'm single spacing each sentence now. I'm single spacing each sentence now. (see how it bunches the sentences together as if I had never hit "enter" after each one.)

    or

    I'm double spacing each sentence now.

    I'm double spacing each sentence now.

    I'm double spacing each sentence now.

    I'm double spacing each sentence now.

    But I can't do:

    I'm single spacing each sentence now.
    I'm single spacing each sentence now.
    I'm single spacing each sentence now.
    I'm single spacing each sentence now.
    

    Unless I use code tags, which often isn't needed.

    Posted in: Off-Topic
  • 0

    posted a message on [Resolved][General] How often does SC2 check events for triggers?

    I assume it's the smallest amount you could make a periodic event fire at.

    Posted in: Triggers
  • 0

    posted a message on How to make a proper victory/defeat trigger that works?!

    event - Unit dies

    Condition - triggering unit = "leader"

    (you could throw "Or" in here and do the same condition for each players leader. Or whatever works best for how your game is set up)

    Action - End game for (triggering player) in defeat

    (at the beginning you could put all the leaders into a unit group called "leader group" and then do this)

    If

    'number of units in "leader group" = 1'

    then

    end game in victory for owner of unit in "leader group"

    Posted in: Triggers
  • 0

    posted a message on Add a trigger into a mod file that overwrites the melee Melee initialization?

    Maybe you could bypass it by spawning structures outside the map (set the option to ignore placement) and making them invincible.

    Posted in: Triggers
  • 0

    posted a message on Shared Nuke Ammunitions

    I'll throw out a guess.

    Perhaps you could use a remove charge from ability action.

    Posted in: Triggers
  • 0

    posted a message on Change the map for a certain player?

    "Set playable map area" action.

    Posted in: Triggers
  • 0

    posted a message on Turning Trigger Off, Order of Action Execution Problems

    The behavior method Mille mentioned will work. Personally I'd make a global boolean variable as an array. Then instead of turning triggers on or off, I'd set the variable[triggering player] to true/false.

    Posted in: Triggers
  • 0

    posted a message on Pathing cost

    Hey guys, so I have a building set up that spawns and sends some units at the enemy if they're within a certain proximity (via triggers). Currently its just done by seeing if a unit is in a region surrounding the building. Because there's a lot of cliffs I was thinking maybe there'd be a better way to do it via pathing cost. It seems there's one pathing function that includes units in it, and one that disregards units completely. The disregarding units completely seems like it would be best, except it also disregards things such as rock barriers. Because this is a map that has a tug of war element to it, the first function can result in huge pathing cost values (especially if you use a point thats inside of an existing unit, although I was able to bypass that problem by using a function that searches for free space. Still, when there's lots of units in the way, I doubt this method will still work).

    So is there a way to include certain units in the pathing calculation?

    Any other suggestions?

    Posted in: Triggers
  • 0

    posted a message on Create a Tower (Dota style)

    Perhaps you could give a short term invisible buff/behavior to units that attack heroes. You could then search out enemy heroes within the radius of the tower that have this buff and tell the tower to attack them.

    Posted in: Triggers
  • 0

    posted a message on Leaderboard Background

    @Scythe1250: Go

    If the only way of getting resources is through bounties, then you can use player property changes, and indicate minerals. However, if you can also harvest minerals, or pick them up on the map, then this would activate from those as well.

    Edit: Perhaps making conditions that check that it wasn't the person's own building, or their ally would be simple enough to overcome this problem. Then again, I've never used classic leaderboards, so I'm not entirely sure how they work.

    Posted in: Triggers
  • 0

    posted a message on [Solved] Random player from player group

    Why not just set a local variable to a random integer 1-15 then use a condition that checks if that player number is in the player group you want. If not, have it pick a new integer. You can set this up by putting the set variable action in a loop, and having an if then action that breaks the loop when the condition is true.

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