SC2Mapster Forums

Development > Triggers

Dota style/League of legends style victory conditions

  • 5 posts
    #1 Jan 31, 2013 at 05:40 UTC - 0 likes

    Hello, I am attempting to build a simple map with heros that respawn after they die. I am using 8 computer players (2 teams) that automatically fight each other similar to the creep waves in DOTA/League of Legends.

    I am trying to figure out how to set the victory conditions for everyone respectively but not sure how to go about doing it.

    Basically, there will be two bases setup and the objective will be to battle with your heros and destroy the enemy bases. Heros respawn after being killed. There are 8 bases (8 computer players), and to win you have to kill all 4 bases on the enemy team. You lose if your bases are destroyed first.

    How would I go about setting up victory and defeat conditions for this scenario?

    #2 Jan 31, 2013 at 05:46 UTC - 0 likes

    You'll probably be able to use something like this:

    Event: Periodic event every 5 seconds
    Conditions: None
    Actions: 
    
    If
    ---Unit is alive(base 1) = false
    ---Unit is alive(base 2) = false
    ---Unit is alive(base 3) = false
    ---Unit is alive(base 4) = false
    Then
    ----Turn (current trigger) off
    ----Team 1 wins
    
    Else
    ---(Nothing)
    
    If
    ---Unit is alive(base 5) = false
    ---Unit is alive(base 6) = false
    ---Unit is alive(base 7) = false
    ---Unit is alive(base 8) = false
    Then
    ----Turn (current trigger) off
    ----Team 2 wins
    Else
    ---(Nothing)
    

    Basically you check to see if a certain team's bases are all dead. If they're all dead, then the opposite team wins. You can use the "End game for player" action to end the game in victory or defeat. You should also use the "turn trigger off" action to turn off this trigger once one team wins so it can't fire twice.

    Send me a PM with any questions or comments.

    Learn about HotS mods, publishing, and regions here

    #3 Jan 31, 2013 at 07:16 UTC - 0 likes

    @zeldarules28: Go

    Thanks! Now how do I use triggers to make my heros respawn after they die? I have them respawning at starting locations.

    #4 Jan 31, 2013 at 15:01 UTC - 0 likes

    I actually have a very old (but still hopefully accurate) tutorial on Dota maps here.

    Here's the respawn trigger from the tutorial: The only difference is that now you don't need to use custom script for revival anymore. Now you can just use the action "Revive Unit". Basically, you set your hero's 'death time' field to -1 so it's not deleted, then you save your hero to a variable when it dies, wait a few seconds, revive it, move it back to home base, and heal it.

    #5 Feb 01, 2013 at 16:04 UTC - 0 likes

    Hey thanks for the help! Great Tutorial!

  • 5 posts

You must login to post a comment. Don't have an account? Register to get one!