• 0

    posted a message on [Trigger] Creating Objectives & Transmissions

    Quote from rentonsmiley45:
    @WraithChaser: Go

    Hiya i was wondering if you could answer a question about objectives it would be a big help. I was wondering is there a way to make it so you are required to destory 0/20 nexus's or save 0/20 "any unit". I know how to make the objectives but i just dont want to to say complete right when i destory the first object, i would need to kill all 20 for it to say complete. Just any help would be very much appreciated
    ----

    I have come up with something along those lines while working on a remake of the StarCraft map "Wasteland", where you are supposed to find Jim Raynor, build a barracks and then build 10 marines. It is not exactly what you want but it'll point you in the right direction. I'll add some notes on how to modify this for your problem after the triggers.

    ============================================
    create objective: build 10 marines
        Events
        Local Variables
        Conditions
        Actions
            Objective - Create a Active Primary objective with text (Combine ("Marines built: ", (Text((Marine count for player 1, counting Complete))), "/10")) and description ""
            Data Table - Save (Last created objective) as "build 10 marines objective" in the Global data table

    update objective: build 10 marines
        Events
        Local Variables
        Conditions
        Actions
            Objective - Set ("build 10 marines objective" from the Global data table) text to (Combine ("Marines built: ", (Text((Marine count for player 1, counting Complete))), "/10"))
            Trigger - Run check objective: build 10 marines  (Check Conditions, Don't Wait until it finishes)

    check objective: build 10 marines
        Events
        Local Variables
        Conditions
            (Marine count for player 1, counting Complete) >= 10
        Actions
            Trigger - Run complete objective: build 10 marines  (Check Conditions, Don't Wait until it finishes)

    check objective: build 10 marines
        Events
        Local Variables
        Conditions
            (Marine count for player 1, counting Complete) >= 10
        Actions
            Trigger - Run complete objective: build 10 marines  (Check Conditions, Don't Wait until it finishes)

    Marine built
        Events
            Unit - Any Unit training progress is Completed
        Local Variables
        Conditions
            (Triggering progress unit type) == Marine
            (Marine count for player 1, counting Complete) <= 10
        Actions
            Trigger - Run update objective: build 10 marines  (Ignore Conditions, Don't Wait until it finishes)

    Marine dies
        Events
            Unit - Any Unit dies
        Local Variables
        Conditions
            (Unit type of (Triggering unit)) == Marine
        Actions
            Trigger - Run update objective: build 10 marines  (Ignore Conditions, Don't Wait until it finishes)
    ===================================================================

    There are different ways of interpreting your request:
    1) There are 20 Nexuses on the map and the player should destroy them all. If new ones get built, those ones need to be destroyed too.
    This is closer to my marines (and easier to implement), because you can just count the number of units of a certain type on the map. In the place where you describe how many Nexuses are left to be killed, instead of using the basic number, use an expression like '20 - x'. And change the 'check objective' accordingly.

    2) You want to track the number of times the player has destroyed a Nexus, regardless of whether new ones get built (or e. g. perhaps someone else kills some Nexuses). Then you would need to introduce a global variable that gets incremented each time a Nexus is killed. That variable is then displayed in the (updated) Objective text.

    I hope that helps.

    Regards,
    OpposingFranz

    Posted in: Tutorials
  • To post a comment, please or register a new account.