SC2Mapster Forums

Development > Triggers

Regional problems

  • 7 posts
    #1 Nov 14, 2012 at 18:23 UTC - 0 likes

    I want to make a region where if a unit leaves it, it respawn in the same region.

    I have 8 regions set up and 8 points in the center of each region. I made a variable "builders area" and added the 8 regions to it and made another variable "builder spawn points" and added the points to it in map init:

    BuilderSpawn Points

    Variable - Set Builder Spawn Point[1] = BSpawn 1 LT

    Variable - Set Builder Spawn Point[2] = BSpawn 2 LT

    Variable - Set Builder Spawn Point[3] = BSpawn 3 LT

    Variable - Set Builder Spawn Point[4] = BSpawn 4 LT

    Variable - Set Builder Spawn Point[5] = BSpawn 1 RT

    Variable - Set Builder Spawn Point[6] = BSpawn 2 RT

    Variable - Set Builder Spawn Point[7] = BSPawn 3 RT

    Variable - Set Builder Spawn Point[8] = BSpawn 4 RT

    Build Regions

    Variable - Set Build Region[1] = Build area 1 LT

    Variable - Set Build Region[2] = Build area 2 LT

    Variable - Set Build Region[3] = Build area 3 LT

    Variable - Set Build Region[4] = Build area 4 LT

    Variable - Set Build Region[5] = Build area 1 RT

    Variable - Set Build Region[6] = Build area 2 RT

    Variable - Set Build Region[7] = Build area 3 RT

    Variable - Set Build Region[8] = Build area 4 RT

    I set up this trigger:

    Events

    Unit - Any Unit Leaves (Triggering region)

    Local Variables

    Conditions

    (Triggering region) == Build Region[(Triggering player)]

    Actions

    Unit - Remove (Triggering unit) from the game

    Unit - Create 1 (Unit type of (Triggering unit)) for player (Owner of (Triggering unit)) at Builder Spawn Point[(Triggering player)] using default facing (No Options)

    It seems obvious to me but not for the game for some reason.

    Can any1 tell me what did i do wrong here?

    #2 Nov 17, 2012 at 11:17 UTC - 0 likes

    Your use of triggering regions, player, etc are incorrect. In the event you HAVE to set which specific regions is being entered as triggering regions does not tell which regions activated the trigger (ie what if you had another region completely unrelated to these sets). Triggering player should also be owner of triggering unit too within the condition. You also may not need to save the points if there are placed a simple as the center of the regions or something else consistent.

    Last edited Nov 17, 2012 by hobbidude

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

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

    #3 Nov 17, 2012 at 12:28 UTC - 0 likes

    You are removing the unit before creating one of the triggering unit (which does no longer exist).

    Move it instead.

    Events
    
    Unit - Any Unit Leaves (Build Region[1])
    Unit - Any Unit Leaves (Build Region[2])
    Unit - Any Unit Leaves (Build Region[3])
    Unit - Any Unit Leaves (Build Region[4])
    Unit - Any Unit Leaves (Build Region[5])
    Unit - Any Unit Leaves (Build Region[6])
    Unit - Any Unit Leaves (Build Region[7])
    Unit - Any Unit Leaves (Build Region[8])
    
    Local Variables
    
    Conditions
    
    (Triggering region) == Build Region[(Triggering player)]
    
    Actions
    
    Move Triggering Unit to Builder Spawn Point (Triggering Player)
    Issue Order to Triggering Unit to STOP replacing existing orders
    
    Last edited Nov 17, 2012 by DogmaiSEA
    #4 Nov 18, 2012 at 14:02 UTC - 0 likes

    @DogmaiSEA: Go

    Im not sure thats correct dogmai as i see no reason why it can't recall info about the triggering unit else a unit dies event would have no purpose. Granted yes moving would be better than killing and creating.

    Last edited Nov 18, 2012 by hobbidude
    #5 Nov 18, 2012 at 15:09 UTC - 0 likes

    I didn't say that was causing the problem, I merely stated that he was doing it and that he should move it instead.

    The problem was the way in which he set up the events, which is what you said in the previous post.

    #6 Nov 18, 2012 at 15:45 UTC - 0 likes

    Thx for the clarification.

    #7 Nov 19, 2012 at 03:36 UTC - 0 likes

    Np mate, in hindsight I worded it poorly. I gotta work on that.

  • 7 posts

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