SC2Mapster Forums

Development > Triggers

How to make a watchtower that provides vision of another area

  • 5 posts
    #1 Jun 24, 2012 at 04:37 UTC - 0 likes

    Title says it all, I just want to create a watchtower that when you capture it doesn't provide vision of itself but of a random region I've created on the other side of the map. I'm fairly new to triggers but it would be nice if there was some way to create a general way for all of them and a straightforward way to link a tower and a region together some-where nicely encapsulated. Like creating a datastructure or something which globally links regions and towers together for this to work.

    #3 Jun 26, 2012 at 03:21 UTC - 0 likes

    In the Data editor, edit the Xel'Naga's sight radius to 0, then make a trigger like this, you should copy the actions for every other player that you have and fill in the correct values, the actions may not exactly be correct, because I'm typing this from memory, but you probably know what I mean:

    Events Any Unit Enters Within 2.0 Of Xel'Naga Tower (30, 100)
    Local Variables
    Conditions
    Actions
         If (Condtions) Then (Actions) Else (Actions)
              If
                   (Owner of (Triggering Unit)) = Player 1
             Then
                  Wait 1.0 Game Seconds
                  Show Example Region For Player 1
            Else
                  Hide Example Region For Player 1
    
    #4 Jun 29, 2012 at 09:42 UTC - 0 likes
    Quote from MoDTassadar: Go

    In the Data editor, edit the Xel'Naga's sight radius to 0, then make a trigger like this, you should copy the actions for every other player that you have and fill in the correct values, the actions may not exactly be correct, because I'm typing this from memory, but you probably know what I mean:

    Events Any Unit Enters Within 2.0 Of Xel'Naga Tower (30, 100)
    Local Variables
    Conditions
    Actions
         If (Condtions) Then (Actions) Else (Actions)
              If
                   (Owner of (Triggering Unit)) = Player 1
             Then
                  Wait 1.0 Game Seconds
                  Show Example Region For Player 1
            Else
                  Hide Example Region For Player 1
    

    This doesn't serve to stop it if both players capture the tower at the same time though, nor does it properly mask the region again if you move away.

    #5 Jun 29, 2012 at 10:03 UTC - 0 likes

    Add a while check for as long as the unit is within range of the tower.

    When I want your opinion...I'll give it to you!

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

    #6 Jun 30, 2012 at 03:36 UTC - 0 likes
    Quote from hobbidude: Go

    Add a while check for as long as the unit is within range of the tower.

    Couldn't find a function which returns the distance between two units, couldn't find a function which returns the position of a unit either, couldn't find a square root function either.

  • 5 posts

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