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 haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Rubbed the right way, the genie is out of its lamp! The 12th Concept Art Contest Results have been announced.
    Dismiss Notice
  4. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  5. 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] How to skip an animation?

Discussion in 'Triggers & Scripts' started by kamermanbr, Jun 21, 2009.

  1. kamermanbr

    kamermanbr

    Joined:
    Oct 9, 2008
    Messages:
    132
    Resources:
    0
    Resources:
    0
    how can i do, when RED press for example " up " during a animation, the animation finish?

    for now i have this xD
    • Events
      • Player - Player 1 (Red) Presses the Up Arrow key



    edit: another question:

    is this right?

    • Ai move1
      • Events
        • Time - Elapsed game time is 120.00 seconds
      • Conditions
        • (Player 2 (Blue) controller) Equal to Computer
        • (Player 3 (Teal) controller) Equal to Computer
        • (Player 4 (Purple) controller) Equal to Computer
        • (Player 5 (Yellow) controller) Equal to Computer
        • (Player 6 (Orange) controller) Equal to Computer
        • (Player 7 (Green) controller) Equal to Computer
        • (Player 8 (Pink) controller) Equal to Computer
        • (Player 9 (Gray) controller) Equal to Computer
        • (Player 10 (Light Blue) controller) Equal to Computer
      • Actions
        • Unit Group - Pick every unit in (Units in (Playable map area) owned by (Triggering player)) and do (Actions)
          • Loop - Actions
            • Unit - Order (Picked unit) to Attack-Move To (Position of Uber Immortal (Giant) 0519 <gen>)




    Last question,

    when a player leave the game, i wanna put her units in control of a pc ( not in control of another player! )
    like in the map castle fight.

    Plz this is really important to my map... i wait for response
     
    Last edited: Jun 21, 2009
  2. ap0calypse

    ap0calypse

    Joined:
    Jan 26, 2007
    Messages:
    4,777
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    First question:

    does this action meet your requirements?
    • Animation - Play (Last created unit)'s stand animation

    I believe it will stop it's animation and play the standard one.

    Second question: yes... and no :p
    You didn't remove the leaks and the trigger causes lag because of that.
    Trigger

    • AI Move 1
      • Events
        • Time - Elapsed game time is 120.00 seconds
      • Conditions
      • Actions
        • For each (Integer A) from 1 to 10, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ((Player((Integer A))) controller) Equal to Computer
              • Then - Actions
                • Set Group = (Units in (Playable map area) owned by (Player((Integer A))))
                • Unit Group - Pick every unit in Group and do (Actions)
                  • Loop - Actions
                    • Set Loc = (Position of Uber Immortal (Giant) 0519 <gen>)
                    • Unit - Move (Picked unit) instantly to Loc
                • Custom script: call DestroyGroup(udg_Group)
              • Else - Actions
        • Custom script: call RemoveLocation(udg_Loc)

    I've done it like this, because you probably have other triggers that run after 120 seconds, now you can add them all in 1 trigger, like this ^^

    Erm... I've got an idea bout your last question, but it'll take some time and there might be easier solutions ^^
    This is the first thing that pops into my head, sorry for that :D

    Whenever a player leaves, set a boolean variable (I call it "PlayerLeft") with the array = 'player number of leaving player' to true.
    Then you've got a constant looping trigger (your AI-trigger) which creates a loop from 1 to 12 (number of players in your map).

    If "PlayerLeft[Integer A]" is true, then do your AI-commands, otherwise do nothing (don't even set the "Do Nothing" command, leave it blank :p).

    For example:
    Example trigger

    • Example
      • Events
        • Time - Every 10.00 seconds of game time
      • Conditions
      • Actions
        • For each (Integer A) from 1 to 10, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • PlayerLeft[(Integer A)] Equal to True
              • Then - Actions
                • Set Group = (Units in (Playable map area) owned by (Player((Integer A))))
                • Unit Group - Pick every unit in Group and do (Actions)
                  • Loop - Actions
                    • Set Loc = (Center of (Attack-Area))
                    • Unit - Order (Picked unit) to Attack-Move To (Center of (Playable map area))
                • Set Group = (Units in (Playable map area) matching (((Owner of (Matching unit)) Equal to (Player((Integer A)))) and ((Unit-type of (Matching unit)) Equal to Footman)))
                • Unit Group - Pick every unit in Group and do (Actions)
                  • Loop - Actions
                    • Set Loc = (Center of (Build-Area))
                    • Unit - Order (Picked unit) to build a Barracks at Loc
                • Unit - Order (Barracks) to train/upgrade to a Footman
              • Else - Actions
        • Custom script: call RemoveLocation(udg_Loc)
        • Custom script: call DestroyGroup(udg_Group)


    I hope I've done everything right... I've done it in a hurry, but it should be about correct :p


    allright, now I have a favour to ask of you...
    This sounds nooby and lame, but...
    click my dragons in my signature, please :cute: (ctrl + click them so you don't lose any time ^^)
     
  3. kamermanbr

    kamermanbr

    Joined:
    Oct 9, 2008
    Messages:
    132
    Resources:
    0
    Resources:
    0
    already clicked. xD
    already give +rep.


    and i will click every day you dragons but plz help me a little more xD
    about the anymation skipe, i talk about the animation mode, no a unit animation.

    about the second question: THANKS i try it but i have a problem..
    • AI move
      • Events
        • Time - Elapsed game time is 120.00 seconds
      • Conditions
      • Actions
        • For each (Integer A) from 1 to 10, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ((Picked player) controller) Equal to Computer
              • Then - Actions
                • Set Group = (Units in (Playable map area) owned by (Picked player))
                • Unit Group - Pick every unit in Group and do (Actions)
                  • Loop - Actions
                    • Set loc = (Position of Uber Immortal (Giant) 0519 <gen>)
                    • Unit - Order (Picked unit) to Attack-Move To loc
                • Custom script: call DestroyGroup(udg_Group)
              • Else - Actions
        • Custom script: call RemoveLocation(udg_loc)


    if you see, i cant put this part:
    • If - Conditions
    • ((Player((Integer A))) controller) Equal to Computer


    how can i do it?



    3 question:
    i dont underesting, sorry xD
     
  4. ap0calypse

    ap0calypse

    Joined:
    Jan 26, 2007
    Messages:
    4,777
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Thanks :D
    It's a player controller comparison, instead of "Picked Player", or "Matching Player", select "Conversion - Convert player index to player" and set that to "for loop Integer A"


    So, you've got this trigger, right?
    Player Leaves
    • player leaves
      • Events
        • Player - Player 1 (Red) leaves the game
        • Player - Player 2 (Blue) leaves the game
        • Player - Player 3 (Teal) leaves the game
        • Player - Player 4 (Purple) leaves the game
        • Player - Player 5 (Yellow) leaves the game
        • Player - Player 6 (Orange) leaves the game
        • Player - Player 7 (Green) leaves the game
        • Player - Player 8 (Pink) leaves the game
        • Player - Player 9 (Gray) leaves the game
        • Player - Player 10 (Light Blue) leaves the game
      • Conditions
      • Actions
        • Set PlayerLeft[(Player number of (Triggering player))] = True

    (it's just to show the action actually).

    Then you can create an AI-trigger (I gave an example-trigger, I don't know how to explain it otherwise...).
    Erm... what do you want the AI to do?

    Edit: whow, forgot to answer the second question xD
     
  5. kamermanbr

    kamermanbr

    Joined:
    Oct 9, 2008
    Messages:
    132
    Resources:
    0
    Resources:
    0
    the ai need to go foward, only that, but need to be in 3 etaps because there are destructibles blocking the way, and theya re destroyed when you kill the boss.
     
  6. ap0calypse

    ap0calypse

    Joined:
    Jan 26, 2007
    Messages:
    4,777
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Can you send me the map? (upload it at the hive's pastebin) since I have no idea what kind of map it is :p
     
  7. kamermanbr

    kamermanbr

    Joined:
    Oct 9, 2008
    Messages:
    132
    Resources:
    0
    Resources:
    0
  8. ap0calypse

    ap0calypse

    Joined:
    Jan 26, 2007
    Messages:
    4,777
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    it should be about this:

    It's a very simple AI, but your AI was even more simple ^^
    (delete the other AI-triggers, unless you still plan on using them).
     

    Attached Files:

  9. Slaydon

    Slaydon

    Joined:
    Jan 6, 2008
    Messages:
    2,432
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    Kamermanbr, if you havent solved the second question yet, The trigger needs all to be Computers, so if you make 9 Different "If Then Else"
     
  10. kamermanbr

    kamermanbr

    Joined:
    Oct 9, 2008
    Messages:
    132
    Resources:
    0
    Resources:
    0
    apoca, 1 qestion, in the cinematic skip, wath do you press to skip? =P




    also here is a problem:
    • Giantshow
      • Events
        • Unit - Uber Immortal (Giant) 0519 <gen> Is attacked
      • Conditions
      • Actions
        • Set Cinematic = True
        • Unit - Pause all units
        • Cinematic - Turn cinematic mode On for (All players)
        • If (Cinematic Equal to False) then do (Skip remaining actions) else do (Do nothing)
        • Player Group - Pick every player in (All players) and do (Actions)
          • Loop - Actions
            • Camera - Apply Camera 003 <gen> for (Picked player) over 0.00 seconds
            • Camera - Lock camera target for (Picked player) to Uber Immortal (Giant) 0519 <gen>, offset by (0.00, 0.00) using Default rotation
        • Set Duration = 5.00
        • Cinematic - Send transmission to (All players) from Uber Immortal (Giant) 0519 <gen> named Uber Immortal (Gian...: Play GruntYesAttack1 <gen> and display Time for Killing....... Modify duration: Set to Duration seconds and Wait
        • If (Cinematic Equal to False) then do (Skip remaining actions) else do (Do nothing)
        • Wait 2.00 game-time seconds
        • Animation - Play Uber Immortal (Giant) 0519 <gen>'s spell animation
        • If (Cinematic Equal to False) then do (Skip remaining actions) else do (Do nothing)
        • Wait 3.00 game-time seconds
        • If (Cinematic Equal to False) then do (Skip remaining actions) else do (Do nothing)
        • Cinematic - Turn cinematic mode Off for (All players)
        • Camera - Pan camera for (Owner of (Triggering unit)) to (Center of Gate1 <gen>) over 1.00 seconds
        • Set Cinematic = False
        • Player Group - Pick every player in (All players) and do (Actions)
          • Loop - Actions
            • Camera - Apply Camera 008 <gen> for (Picked player) over 0.00 seconds
        • Set loc = (Center of Event1 <gen>)
        • For each (Integer A) from 1 to 10, do (Actions)
          • Loop - Actions
            • Unit - Create 1 Archer for Player 11 (Dark Green) at loc facing Default building facing degrees
            • Unit - Make (Last created unit) Vulnerable
        • Custom script: call RemoveLocation(udg_loc)
        • Unit - Unpause all units
        • Trigger - Turn off (This trigger)




    in this part, i need create 5 archers in one location and 5 in other..
    the trigger only create 1 archer.. so dont do nothing ^^

    • Set loc = (Center of Event1 <gen>)
    • For each (Integer A) from 1 to 10, do (Actions)
      • Loop - Actions
        • Unit - Create 1 Archer for Player 11 (Dark Green) at loc facing Default building facing degrees
        • Unit - Make (Last created unit) Vulnerable
     
  11. ap0calypse

    ap0calypse

    Joined:
    Jan 26, 2007
    Messages:
    4,777
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Press escape to skip, I thought that was obvious xD

    Erm... try "For each (Integer B)", sometimes the loops are messed up if there are multiple loops at the same time :/
    If that doesn't work, I'll create a small JASS-loop for it ^^

    I thought you had to create 10 archers at the same position, though :eek: (I probably didn't look good).
    Then do for loop integer B from 1 to 5 and do the same as my trigger, but copy/paste the loop-triggers and set loc to your position after the first actions.
    Mehh, I hope you understand it :p
     
  12. kamermanbr

    kamermanbr

    Joined:
    Oct 9, 2008
    Messages:
    132
    Resources:
    0
    Resources:
    0
    wow i discover 1 thing. i am really stupid ^^
    sorry i dont underesting xDDDD
     
  13. ap0calypse

    ap0calypse

    Joined:
    Jan 26, 2007
    Messages:
    4,777
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    It should be about this ^^
    • For each (Integer B) from 1 to 5, do (Actions)
      • Loop - Actions
        • Set loc = (Center of Event1 <gen>)
        • Unit - Create 1 Archer for Player 11 (Dark Green) at loc facing Default building facing degrees
        • Unit - Make (Last created unit) Vulnerable
        • Set loc = (Center of Other Region)
        • Unit - Create 1 Archer for Player 11 (Dark Green) at loc facing Default building facing degrees
        • Unit - Make (Last created unit) Vulnerable


    That should create 5 units at Event1 and 5 units at the other region (why make them vulnerable, actually? Shouldn't it be invulnerable? ^^)
     
  14. kamermanbr

    kamermanbr

    Joined:
    Oct 9, 2008
    Messages:
    132
    Resources:
    0
    Resources:
    0
    i do it vulnervable because when i play the map, that archers are invulnerable, dont know why
     
  15. Cokemonkey11

    Cokemonkey11

    Wurst Reviewer

    Joined:
    May 9, 2006
    Messages:
    3,237
    Resources:
    18
    Tools:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    2
    JASS:
    7
    Resources:
    18
    do they have the invulnerability ability?