SC2Mapster Forums

Development > Triggers

HELP-Triggers and region

  • 2 posts
    #1 Nov 23, 2012 at 19:57 UTC - 0 likes

    I suck with triggers but how do you make a trigger that every 30 seconds if a unit is in the region it gives minerals to the player that owns the unit? please help

    #2 Dec 13, 2012 at 05:47 UTC - 0 likes

    <<reply 1083761>>

    I've worked out a very simple possibility of doing this. Note I haven't tested anything.
    I don't like just handing out fully working and efficient triggers since the best way to learn something is by figuring it out yourself, not copy pasting.
    But here's something to give you a start.

    Requirements: 1 Global Variable with the type as Unit to track which unit was first to enter the region so you can track who is currently in control.

    Unit Enters Region
        Events
            Unit - Any Unit Enters (Entire map)
        Local Variables
        Conditions
        Actions
            Variable - Set Current Unit in Region = (Triggering unit)
            General - Repeat (Actions) forever
                Actions
                    General - Wait 30.0 Game Time seconds
                    Player - Modify player (Owner of (Triggering unit)) Minerals: Add 100

    Unit Leaves Region
        Events
            Unit - Any Unit Leaves (Entire map)
        Local Variables
        Conditions
            (Triggering unit) == Current Unit in Region
        Actions
            Trigger - Stop all instances of Unit Enters Region

    http://www.sc2pod.com/achievement.php?id=13914

  • 2 posts

You must login to post a comment. Don't have an account? Register to get one!