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. The reforging of the races is complete. Come see the 14th Techtree Contest Results.
    Dismiss Notice
  4. It's time to choose your horse in the race - the 32nd Modeling Contest Poll is up!
    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.

Cinematic in a Loop

Discussion in 'World Editor Help Zone' started by Lingonberryjam, Jul 17, 2007.

  1. Lingonberryjam

    Lingonberryjam

    Joined:
    Feb 25, 2005
    Messages:
    230
    Resources:
    0
    Resources:
    0
    EDIT - Maybe this belongs in the Triggers & Scripts section.

    Hullo!

    I'm making my first cinematic. I'm having some problems though, so please take a look at this.

    The cinema is supposed to show all heros being summond in the labyrinth (in the beginning of the game, as you may have guessed :p ). To do this, I'm using a 8-times-loop, 1 for each player. Then I'm checking if that player is playing, and of course not using that condition while testplaying. And if player slot is used by a player I'm showing that hero being summoned. That is how I want it to work.

    The problem is that only the first Hero (for player 1, red) is shown.
    Note that the cinematic does work! It is just that it seem like the "For each (Integer A) from 1 to 8, do (Actions)" does not jump to the next step.

    Here is da trigger;

    • Cinema
      • Events
      • Conditions
      • Actions
        • For each (Integer A) from 1 to 8, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
              • Then - Actions
                • Set tempGroup = (All players)
                • Player Group - Pick every player in tempGroup and do (Actions)
                  • Loop - Actions
                    • Camera - Apply Cameras[(Integer A)] for (Picked player) over 0.00 seconds
                • Custom script: call DestroyForce(udg_tempGroup)
                • Wait 1.00 seconds
                • Set tempPoint[1] = (Center of startpoints[(Integer A)])
                • Set tempPoint[2] = (Position of Loka Brunn 0000 <gen>)
                • Unit - Create 1 Hellcaller for (Player((Integer A))) at tempPoint[1] facing tempPoint[2]
                • Set Hero[(Integer A)] = (Last created unit)
                • Custom script: call RemoveLocation(udg_tempPoint[1])
                • Custom script: call RemoveLocation(udg_tempPoint[2])
                • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
                • Special Effect - Destroy (Last created special effect)
                • Wait 1.50 seconds
              • Else - Actions
        • Wait 3.00 seconds
        • Trigger - Run Start <gen> (checking conditions)


    Can you give me any help making this work out with the Loop? It would be 8 times more in the triggers if I can't use the Loop. Not nice.

    Appreciate any kind of help or ideas of how to solve this!

    Yours truly
    Lingon
     
    Last edited: Jul 17, 2007
  2. Jaakko

    Jaakko

    Joined:
    Apr 25, 2006
    Messages:
    1,298
    Resources:
    4
    Maps:
    4
    Resources:
    4
    Well I tried to figure it out but it seems I can't help you. Maybe first put a comment there so you will see does it really run for 8 times.
     
  3. WoK.Vingador

    WoK.Vingador

    Joined:
    Apr 4, 2007
    Messages:
    28
    Resources:
    1
    Maps:
    1
    Resources:
    1
    You have wait commands inside the loop. This allows other triggers to run during that time, and the (A Integer) is a global variable. Use an integer variable to control the loop. Similar problems may happen if the trigger 'indirectly' executes other trigger, like moving an unit to a region, issuing an order, giving an item to a hero, etc; if there is an associated trigger and that trigger uses the (A Integer) or other of the global variables.
     
  4. Lingonberryjam

    Lingonberryjam

    Joined:
    Feb 25, 2005
    Messages:
    230
    Resources:
    0
    Resources:
    0
    Thanks alot for pointing that out! Knowing that, i could figure out how to fix all the problems i had.

    I changed the loop-integer to a custom one, but still it didnt work. I tried some stuff and found out that the customs scripts was in the way... i moved them out of the loop, and then it worked! I actually dont know why it wont work with the scripts inside of the loop, but whatever. the backside of this is that i dont know if i stop all the leaks. Feel free to tell me if i dont.

    If you're interested, heres the finished trigger (cut off some irrelevant stuff):

    • Cinematic start
      • Events
        • Time - Elapsed game time is 1.00 seconds
      • Conditions
      • Actions
        • For each (Integer tempInteger) from 1 to 8, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
              • Then - Actions
                • Set tempGroup = (All players)
                • Player Group - Pick every player in tempGroup and do (Actions)
                  • Loop - Actions
                    • Camera - Apply Cameras[tempInteger] for (Picked player) over 0.00 seconds
                • Wait 1.00 seconds
                • Set tempPoint[1] = (Center of startpoints[tempInteger])
                • Set tempPoint[2] = (Position of Loka Brunn 0000 <gen>)
                • Unit - Create 1 Hellcaller for (Player(tempInteger)) at tempPoint[1] facing tempPoint[2]
                • Set Hero[tempInteger] = (Last created unit)
                • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
                • Special Effect - Destroy (Last created special effect)
                • Wait 1.50 seconds
              • Else - Actions
        • Custom script: call DestroyForce(udg_tempGroup)
        • Custom script: call RemoveLocation(udg_tempPoint[1])
        • Custom script: call RemoveLocation(udg_tempPoint[2])


    Thanks again. Tallyho!
     
  5. Earth-Fury

    Earth-Fury

    Joined:
    Feb 18, 2004
    Messages:
    538
    Resources:
    1
    Tutorials:
    1
    Resources:
    1