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. Lead your forces to battle in the 15th Techtree Contest. The call is yours, commander!
    Dismiss Notice
  4. The reforging of the races is complete. Come see the 14th Techtree Contest Results.
    Dismiss Notice
  5. It's time to choose your horse in the race - the 32nd Modeling Contest Poll is up!
    Dismiss Notice
  6. 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] Multiple build Quest

Discussion in 'Triggers & Scripts' started by Traxamillion, Mar 1, 2010.

  1. Traxamillion

    Traxamillion

    Joined:
    Sep 14, 2007
    Messages:
    1,387
    Resources:
    5
    Models:
    1
    Icons:
    3
    Tutorials:
    1
    Resources:
    5
    I have a quest where you need to build 3 of the same building. However I do not know how to make it work more than once, and on top of that the trigger isn't even working for one construction of the quest heres what i have so far.


    • Build Pig Farm
      • Events
        • Map initialization
      • Conditions
      • Actions
        • Quest - Create a Required quest titled Housing and Hunger with the description Construct three Pig..., using icon path ReplaceableTextures\CommandButtons\BTNBasicStruct.blp
        • Set Farm = (Last created quest)
        • Quest - Enable Farm
        • Quest - Mark Farm as Discovered


    • Build Pig Farm Complete
      • Events
        • Map initialization
        • Unit - A unit owned by Player 1 (Red) Finishes construction
      • Conditions
        • (Unit-type of (Triggering unit)) Equal to Pig Farm
      • Actions
        • Set Farm = (Last created quest)
        • Quest - Mark Farm as Completed


    +rep to anyone who can help.

    Thanks.
     
  2. Teelo

    Teelo

    Joined:
    Mar 31, 2009
    Messages:
    709
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Uhh... Okay. The first chunk of code creates the quest, enables it, and marks it discovered.
    The second chunk fires both during map initialization, and whenever a unit finished building something. It marks the quest completed.

    So, it would be created during map initialization, then instantly marked completed by the second trigger.

    Can you give us a bit more information on what you want the triggers to do?
     
  3. Traxamillion

    Traxamillion

    Joined:
    Sep 14, 2007
    Messages:
    1,387
    Resources:
    5
    Models:
    1
    Icons:
    3
    Tutorials:
    1
    Resources:
    5
    Ok so the Quest is;

    "Construct three pig farms"

    So after Player 1 (red) builds 3 pig farms i Want the Quest to be completed.
     
  4. Teelo

    Teelo

    Joined:
    Mar 31, 2009
    Messages:
    709
    Resources:
    1
    Maps:
    1
    Resources:
    1
    • Build Pig Farm Complete
    • Events
    • Unit - A unit owned by Player 1 (Red) Finishes construction
    • Conditions
    • (Unit-type of (Triggering unit)) Equal to Pig Farm
    • (Number of living Pig Farm units owned by Player 1 (Red)) Greater than or equal to 3
    • Actions
    • Set Farm = (Last created quest)
    • Quest - Mark Farm as Completed
    • Trigger - Turn off (This trigger)
     
  5. Traxamillion

    Traxamillion

    Joined:
    Sep 14, 2007
    Messages:
    1,387
    Resources:
    5
    Models:
    1
    Icons:
    3
    Tutorials:
    1
    Resources:
    5
    Ok im going to try it but I'm having trouble finding the "number of living..." condition trigger, can you tell me what category it falls under?
     
  6. Teelo

    Teelo

    Joined:
    Mar 31, 2009
    Messages:
    709
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Integer Comparison; Count living units owned by player.
     
  7. Traxamillion

    Traxamillion

    Joined:
    Sep 14, 2007
    Messages:
    1,387
    Resources:
    5
    Models:
    1
    Icons:
    3
    Tutorials:
    1
    Resources:
    5
    hmm it did not work :/
     
  8. Riptokus

    Riptokus

    Joined:
    Aug 7, 2007
    Messages:
    112
    Resources:
    2
    Maps:
    1
    Tutorials:
    1
    Resources:
    2
    • Build Pig Farm
      • Events
        • Map initialization
      • Conditions
      • Actions
        • Quest - Create a Required quest titled Housing and Hunger with the description Construct three Pig..., using icon path ReplaceableTextures\CommandButtons\BTNBasicStruct.blp
        • Set Farm = (Last created quest)
        • Quest - Enable Farm
        • Quest - Mark Farm as Discovered

    You do not need to enable or mark it discovered, since it starts in that state.

    • Build Pig Farm Complete
      • Events
        • Map initialization
        • Unit - A unit owned by Player 1 (Red) Finishes construction
      • Conditions
        • (Unit-type of (Triggering unit)) Equal to Pig Farm
      • Actions
        • Set Farm = (Last created quest)
        • Quest - Mark Farm as Completed

    I see two problems with this second trigger. The first problem is, when the event "Map initialization" runs, there is no "Triggering Unit". As such, it should not have that event because it will ALWAYS fail it's conditional check.

    Second, when you do Set Farm = (Last created quest), you are setting the quest you have labled "Farm" to the last created quest, which can be anything at all. When you set it the first time, as long as you never overwrite what you set it as, the variable "Farm" would always refer to "Housing and Hunger", however, you unset that when in the second action you set farm to the last created quest. You can eliminate that line and it should work fine.
    Reworked

    • Build Pig Farm
      • Events
        • Map initialization
      • Conditions
      • Actions
        • Quest - Create a Required quest titled Housing and Hunger with the description Construct three Pig..., using icon path ReplaceableTextures\CommandButtons\BTNBasicStruct.blp
        • Set Farm = (Last created quest)

    You do not need to enable or mark it discovered, since it starts in that state.

    • Build Pig Farm Complete
      • Events
        • Unit - A unit owned by Player 1 (Red) Finishes construction
      • Conditions
        • (Unit-type of (Triggering unit)) Equal to Pig Farm
      • Actions
        • Quest - Mark Farm as Completed
        • Trigger - Turn off (This trigger)