1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  4. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  5. The Secrets of Warcraft 3 have revealed interesting works. The RESULTS for Abelhawk's Mini-Mapping Contest #15 have come out!
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Night Rider gained several songs for his journey. The poll for the 12th Music Contest has started. Check it out!
    Dismiss Notice
  9. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  10. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Trigger] What just go wrong :'( Please check and help, will rep and thank

Discussion in 'Triggers & Scripts' started by Weigazod, Jun 8, 2016.

  1. Weigazod

    Weigazod

    Joined:
    Feb 22, 2009
    Messages:
    176
    Resources:
    0
    Resources:
    0
    I delete that test map.

    You can download the new version here. Open world editor, go to trigger, enable the victory condition and play yourself.

     
  2. blancfaye7

    blancfaye7

    Joined:
    May 21, 2014
    Messages:
    560
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I can't seem to replicate the bug you're saying here...

    • Victory
      • Events
        • Unit - A unit Dies
      • Conditions
        • ((Dying unit) is A structure) Equal to True
        • (Real((Number of units in (Units in (Playable map area) matching ((((Matching unit) is A structure) Equal to True) and (((Owner of (Killing unit)) is an enemy of (Owner of (Dying unit))) Equal to True)))))) Equal to 0.00
      • Actions
        • Set WinTeam = (All enemies of (Owner of (Dying unit)))
        • Player Group - Pick every player in WinTeam and do (Actions)
          • Loop - Actions
            • Game - Victory (Picked player) (Show dialogs, Show scores)
        • Custom script: call DestroyGroup(udg_WinTeam)


    Your custom script should be this, btw:
    Code (Text):
    Custom script:   call DestroyForce(udg_WinTeam)
    ----

    Also, I suggest you merge defeat and victory conditions in 1 trigger for debugging purposes, (or it may be better that way anyway)
     
  3. Weigazod

    Weigazod

    Joined:
    Feb 22, 2009
    Messages:
    176
    Resources:
    0
    Resources:
    0
    How did you do that?
    The not-getting the bug thing.

    Did you enable the trigger?
    Did you play more than 10 minutes?
    Did you play with more than 1 computer?
    Did you play with more than 2 teams?

    About the custom script. Thank you. I didn't put much thought in that.
     
  4. blancfaye7

    blancfaye7

    Joined:
    May 21, 2014
    Messages:
    560
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I have enabled the trigger and fixed the custom script, then I played 1v1 with a comp. I will try having teams right now.

    EDIT:
    I have replicated it now. I review your victory trigger now and post what's wrong.

    EDIT 2:
    I think I have found the cause of this.
    • (Real((Number of units in (Units in (Playable map area) matching ((((Matching unit) is A structure) Equal to True) and (((Owner of (Killing unit)) is an enemy of (Owner of (Dying unit))) Equal to True)))))) Equal to 0.00

    This line is the problem.
    It should be like this, right?
    Code (Text):
    (Owner of (Killing unit)) is an enemy of (Owner of (MATCHING UNIT))
     
    Last edited: Jun 8, 2016
  5. Weigazod

    Weigazod

    Joined:
    Feb 22, 2009
    Messages:
    176
    Resources:
    0
    Resources:
    0
    i 1v1 with the computer and still receive the problem at 21:58 mark.

    Still how to create a timer?

    I check the trigger but don't know what to do with it.
     
  6. Weigazod

    Weigazod

    Joined:
    Feb 22, 2009
    Messages:
    176
    Resources:
    0
    Resources:
    0
    The trigger that you found in the map i update in the map resource section is the trigger that i rewrote after applying Warseeker's advice and seeing that it still didn't work.

    The original Trigger is in the first post of this thread and it is exactly not different from the line you just posted but i must thank you for point that out for me. Those triggers really put my brain on a Merry-go-around.
     
  7. blancfaye7

    blancfaye7

    Joined:
    May 21, 2014
    Messages:
    560
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Create a variable type Timer.
    Then in actions trigger, search for countdown timer there. There are actions already for that.

    Then you will create another trigger for turning off the Additional Faction <gen>.

    • Off Faction Trigger
      • Events
        • Time - sampleTimer expires
      • Conditions
      • Actions
        • Trigger - Turn off Additional Faction <gen>


    ----

    Warseeker's trigger is this:
    Real((Number of units in (Units in (Playable map area) matching ((((Matching unit) is A structure) Equal to True) and (((Owner of (Matching unit)) is an enemy of (Owner of (Dying unit))) Equal to True)))))) Equal to 0.00

    Mine is:
    (Owner of (Killing unit)) is an enemy of (Owner of (MATCHING UNIT))

    Give this a shot before using my trigger below.

    ----

    Heya. Can you instead use this Victory trigger?
    If it still happens then something is really wrong...
    • Victory
      • Events
        • Unit - A unit Dies
      • Conditions
        • And - All (Conditions) are true
          • Conditions
            • ((Dying unit) is A structure) Equal to True
            • (Number of units in (Units in (Playable map area) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True)))) Equal to 0
      • Actions
        • Set WinTeam = (All players matching ((((Matching player) is an ally of (Owner of (Killing unit))) Equal to True) or ((Matching player) Equal to (Owner of (Killing unit)))))
        • Player Group - Pick every player in WinTeam and do (Actions)
          • Loop - Actions
            • Game - Victory (Picked player) (Show dialogs, Show scores)
        • Custom script: call DestroyForce(udg_WinTeam)
     
  8. Weigazod

    Weigazod

    Joined:
    Feb 22, 2009
    Messages:
    176
    Resources:
    0
    Resources:
    0
    I made the timer trigger. Not sure if it works.

    • Timer
      • Events
        • Time - Elapsed game time is 0.00 seconds
      • Conditions
      • Actions
        • Countdown Timer - Start Timer as a One-shot timer that will expire in 7.00 seconds
        • Countdown Timer - Create a timer window for Timer with title Time to choose cust...
        • Countdown Timer - Show (Last created timer window)
        • Set TimerWin = (Last created timer window)



    • End Timer
      • Events
        • Time - Timer expires
      • Conditions
      • Actions
        • Countdown Timer - Destroy TimerWin
        • Trigger - Turn off Additional Faction <gen>




    And welcome to my 1st version of victory condition. That's almost the 1st version that i made. However, i change it because if the unit that kill the last building is neutral Hostile or the player himself then no one got the win.

    One thing i should note. The trigger doesn't work as it suppose to be mainly must be a problem in the condition part. I don't thing a change in action will do any difference but I run out of option so i will try that.

    I don't think this trigger is appropriate. Sometimes, if you can't fix it just make a new one so if you can make a different one and it works then it's fine.
     
  9. blancfaye7

    blancfaye7

    Joined:
    May 21, 2014
    Messages:
    560
    Resources:
    1
    Maps:
    1
    Resources:
    1
    How about this one?

    -----

    My new trigger has a different set of conditions as well :) I just flavored the actions too because... well... it's definitely weird the trigger doesn't work. lol.
     
  10. Weigazod

    Weigazod

    Joined:
    Feb 22, 2009
    Messages:
    176
    Resources:
    0
    Resources:
    0


    I tested and there is no victory.

    I think we should do a new trigger. I see the event player leave the game and defeat. May be we can do something with that. I got to sleep now. Bye
     
  11. blancfaye7

    blancfaye7

    Joined:
    May 21, 2014
    Messages:
    560
    Resources:
    1
    Maps:
    1
    Resources:
    1
    From scratch it is then. Anybody out there with idea is appreciated;

    Recreating melee victory and defeat conditions.

    ----

    I am currently creating a test map with an in-depth debug messages. It will come in handy.

    ----

    I have finished my trigger and my test map.
    • Enforce victory and defeat conditions
      • Events
        • Unit - A unit Dies
      • Conditions
      • Actions
        • Set vdc_triggeringUnit = (Triggering unit)
        • Set vdc_ownerOfTriggeringUnit = (Owner of vdc_triggeringUnit)
        • Set vdc_alliesOfOwner = (All allies of vdc_ownerOfTriggeringUnit)
        • Game - Display to (All players) the text: ((The unit named + (Name of vdc_triggeringUnit)) + has died or cancelled.)
        • Game - Display to (All players) the text: The conditonal trig...
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (vdc_triggeringUnit is A structure) Equal to True
          • Then - Actions
            • Game - Display to (All players) the text: The triggering unit...
            • Player Group - Pick every player in vdc_alliesOfOwner and do (Actions)
              • Loop - Actions
                • Set vdc_numberOfStructuresTeam = (vdc_numberOfStructuresTeam + (Count structures controlled by (Picked player) (Include incomplete structures)))
            • Game - Display to (All players) the text: (No. of structures left: + (String(vdc_numberOfStructuresTeam)))
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • vdc_numberOfStructuresTeam Equal to 0
              • Then - Actions
                • Game - Display to (All players) the text: ((Name of vdc_ownerOfTriggeringUnit) + and his or her team are defeated!)
                • Game - Display to (All players) the text: Checking if there i...
                • Set vdc_killingUnit = (Killing unit)
                • Set vdc_ownerOfKillingUnit = (Owner of vdc_killingUnit)
                • Set vdc_alliesOfKiller = (All allies of vdc_ownerOfKillingUnit)
                • Set vdc_enemiesOfKiller = (All enemies of vdc_ownerOfKillingUnit)
                • Player Group - Pick every player in vdc_enemiesOfKiller and do (Actions)
                  • Loop - Actions
                    • Set vdc_numberOfStructuresEnemies = (vdc_numberOfStructuresEnemies + (Count structures controlled by (Picked player) (Include incomplete structures)))
                • Game - Display to (All players) the text: (Total no. of structures left to destroy by the killing team: + (String(vdc_numberOfStructuresEnemies)))
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • vdc_numberOfStructuresEnemies Equal to 0
                  • Then - Actions
                    • Game - Display to (All players) the text: ((Name of vdc_ownerOfKillingUnit) + and his or her team are victorious!)
                  • Else - Actions
                    • Game - Display to (All players) the text: ((Name of vdc_ownerOfKillingUnit) + and his or her team still have work to do!)
                • Set vdc_numberOfStructuresEnemies = 0
                • Custom script: call DestroyForce(udg_vdc_alliesOfKiller)
                • Custom script: set udg_vdc_alliesOfKiller = null
                • Custom script: call DestroyForce(udg_vdc_enemiesOfKiller)
                • Custom script: set udg_vdc_enemiesOfKiller = null
              • Else - Actions
                • Game - Display to (All players) the text: ((Name of vdc_ownerOfTriggeringUnit) + and his or her team can still fight!)
            • Set vdc_numberOfStructuresTeam = 0
            • Custom script: call DestroyForce(udg_vdc_alliesOfOwner)
            • Custom script: set udg_vdc_alliesOfOwner = null
          • Else - Actions
            • Game - Display to (All players) the text: The triggering unit...


    The test map is attached to this post.
     

    Attached Files:

    Last edited: Jun 9, 2016
  12. Weigazod

    Weigazod

    Joined:
    Feb 22, 2009
    Messages:
    176
    Resources:
    0
    Resources:
    0

    If this works, you can actually publish this trigger.
     
  13. blancfaye7

    blancfaye7

    Joined:
    May 21, 2014
    Messages:
    560
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Give it a try in the test map. If all possibilities work, then it is time to integrate it to your map. If something goes wrong, then something is wrong with your other triggers, since this is basically version 2 of our work.

    Refactor the code as you see fit. I didn't put Defeat and Victory yet, just a message for testing purposes.

    ----

    The trigger is probably too simple to do. It's just a simple GUI code. Nothing really bigto become a spell code or something.