Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

What happened to my victory condition?

Discussion in 'Triggers & Scripts' started by jsmoove, Aug 9, 2020.

Tags:
  1. jsmoove

    jsmoove

    Joined:
    Apr 1, 2020
    Messages:
    53
    Resources:
    0
    Resources:
    0
    I seem to have lost the trigger that controls victory conditions (though defeat still works for some reason?)

    The map I based my project on has these triggers:

    Melee Game - Use melee time of day (for all players)
    Melee Game - Limit Heroes to 1 per Hero-type (for all players)
    Melee Game - Set starting resources (for all players)
    Melee Game - Remove creeps and critters from used start locations (for all players)
    Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
    Trigger - Add SetRaceVariables <gen> to the trigger queue (Checking conditions)




    And here is what I have now:

    Melee Game - Use melee time of day (for all players)
    Melee Game - Set starting resources (for all players)
    Melee Game - Remove creeps and critters from used start locations (for all players)
    Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
    Trigger - Add SetRaceVariables <gen> to the trigger queue (Checking conditions)



    I've looked everywhere for the victory defeat conditions and I can't find the trigger in either map but victory/defeat works just fine in the original map.
     
  2. TheFireMage

    TheFireMage

    Joined:
    Jul 23, 2018
    Messages:
    195
    Resources:
    0
    Resources:
    0
    You mean this?
    • Melee Game - Enforce victory/defeat conditions (for all players)
     
  3. jsmoove

    jsmoove

    Joined:
    Apr 1, 2020
    Messages:
    53
    Resources:
    0
    Resources:
    0
    So that trigger won't work because it triggers defeat before the player can choose their race in this pop-up system.

    Here is the map I am basing it off of.
    Blizz-Like Melee Settings For Extra Races 2.5

    And attached is my map. (Please don't share, we will be moving those settings to an original map whenever we get these triggers worked out)

    I have no idea where the victory conditions ARE, let alone why they don't work anymore and I'm pretty sure that is the reason we get massive lag everytime a building is destroyed ( since the victory/defeat condition is based on the placement of buildings)

    I'm also concerned about data leak. the OP map is dinged for data leak. I get the concept but I have no idea how to identify it or fix it. I'm not sure if that has anything to do with the victory conditions or lag but it probably does? Please help!
     

    Attached Files:

  4. Whitewolf8

    Whitewolf8

    Joined:
    Aug 31, 2011
    Messages:
    289
    Resources:
    6
    Models:
    1
    Maps:
    4
    Tutorials:
    1
    Resources:
    6
    From the look of it the trigger comments note it's in SetRaceVariables, at least the IDs of buildings that would keep it happening. As for the actual function, uhhh...
    Seems like it's in the custom map code (Select the map icon/name in trigger editor)

    While trying it out I didn't get any lag smashing buildings though, so not sure what's happening there for you, but anyways, that system seems to have been made for the patches before 24 players were a thing so that alone might make it a bit funky? My knowledge of this stuff in general isn't much right now and looking at this hurts my brain so can't really help there, but hopefully this will at least point in a general direction.
     
  5. jsmoove

    jsmoove

    Joined:
    Apr 1, 2020
    Messages:
    53
    Resources:
    0
    Resources:
    0
    I should Have clarified. The lag happens in multiplayer. If you play without another human player then it doesn't lag even with multiple AI players.
     
  6. Whitewolf8

    Whitewolf8

    Joined:
    Aug 31, 2011
    Messages:
    289
    Resources:
    6
    Models:
    1
    Maps:
    4
    Tutorials:
    1
    Resources:
    6
    Ah. well damn i wouldn't really have a way to test that out then. Good luck to you!
     
  7. BloodSoul

    BloodSoul

    Joined:
    May 10, 2009
    Messages:
    865
    Resources:
    2
    Spells:
    2
    Resources:
    2
    The victory/defeat conditions had been slightly changed (for worse) and moved to the map header. It's supposed to be called when the race dialog finishes. Otherwise, everyone loses the match.
    Code (vJASS):

    function Trig_AlteredMeleeCreateStartingUnits_Actions takes nothing returns nothing
        call DisableTrigger( GetTriggeringTrigger() )
        call AlteredMeleeStartingUnits()
        call AlteredMeleeInitVictoryDefeat() // <===
        call AlteredMeleeStartingAI()
    endfunction
     


    I've adjusted a few things here and there, and it should be working now.
     

    Attached Files:

  8. jsmoove

    jsmoove

    Joined:
    Apr 1, 2020
    Messages:
    53
    Resources:
    0
    Resources:
    0
    Thanks! I haven't tried it yet in multiplayer but it seems like the issues are resolved