1. The long-awaited results for Concept Art Contest #11 have finally been released!
    Dismiss Notice
  2. The mythological era has spawned some interesting characters around. Check them out and be sure to vote for them in the 30th Poll of the Texturing Contest.
    Dismiss Notice
  3. The 20th iteration of the Terraining Contest is upon us! Join and create exquisite Water Structures for it.
    Dismiss Notice
  4. Hivers united and created a bunch of 2v2 melee maps. Vote for the best in our Melee Mapping Contest #4 - Poll!
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice

[Trigger] Making the unit can't leave the arena

Discussion in 'Triggers & Scripts' started by Saishy, Apr 28, 2008.

  1. Saishy

    Saishy

    Joined:
    Mar 23, 2008
    Messages:
    947
    Resources:
    0
    Resources:
    0
    I'm doing a kind of hero arena with animes characters, you can choose between some arenas in the begin of the game, but I don't want they to be able to leave these arenas with flying units or teleport or anything like that.

    I want to make a trigger that detect if a unit leaves the arena, and them blink them to the last point they was in the arena, because if I just teleport them to the middle, they can use that to do a direct attack from bases, if I teleport them to bases, they can use that to flee. So I want to teleport them to the last location inside arena before they leave it.

    Someone can help-me?
     
  2. xXCRIMINALXx

    xXCRIMINALXx

    Joined:
    Jul 24, 2007
    Messages:
    308
    Resources:
    3
    Maps:
    2
    Tutorials:
    1
    Resources:
    3
    event - unit leaves region
    condition - (your choice)
    action - unit - move instantly to (where you want)
     
  3. Saishy

    Saishy

    Joined:
    Mar 23, 2008
    Messages:
    947
    Resources:
    0
    Resources:
    0
    OHHhhh you saved me thanks.... ¬¬
    (Ironic)

    yeah, now tell me how I would know where the unit was before leave the arena?
     
  4. xXCRIMINALXx

    xXCRIMINALXx

    Joined:
    Jul 24, 2007
    Messages:
    308
    Resources:
    3
    Maps:
    2
    Tutorials:
    1
    Resources:
    3
    You'll need a system in such case which will propably cause the game heavier a bit (as far as i think) which detects every unit location every X seconds, when the unit leaves he will teleport him to the location he was in the X second.
     
  5. Saishy

    Saishy

    Joined:
    Mar 23, 2008
    Messages:
    947
    Resources:
    0
    Resources:
    0
    >.<

    I don't think this is a good ideia...
    Anyone know how to do a trigger that see the future?

    Edit: I Had a great ideia! Take the angle of the unit and the center of the arena and them start moving the unit in the direction of the arena until it reaches the arena! (Still needs some seconds of move after reach because can stuck on walls)
    But I don't know how to do that trigger...
     
  6. StygianSaint

    StygianSaint

    Joined:
    Apr 17, 2008
    Messages:
    20
    Resources:
    0
    Resources:
    0
    isnt u can place some invisible path blocker around the arena with stats that block air unit? and if someone try to blink outside arena, just move that unit to random position in arena. depend on luck, that unit will pop in his own base or enemy base or middle of arena, -Blink with your own risk-

    or just simply put them to enemy base, so if they blink = suicide, WAHAHAHA
     
  7. lolreported

    lolreported

    Joined:
    Aug 16, 2007
    Messages:
    666
    Resources:
    10
    Tools:
    1
    Maps:
    3
    Spells:
    6
    Resources:
    10
    It's simple:

    • How To Do a Simple UnLeave Trigger
      • Events
        • Unit - A unit enters DONOTLEAVE <gen>
      • Conditions
        • ((Triggering unit) is A Hero) Equal to True
      • Actions
        • Set point[1] = (Position of (Triggering unit))
        • Set point[2] = (point[1] offset by 100.00 towards ((Facing of (Triggering unit)) + 180.00) degrees)
        • Unit - Move (Triggering unit) instantly to point[2]
        • Custom script: call RemoveLocation(udg_point[1])
        • Custom script: call RemoveLocation(udg_point[2])


    Hope this works :)
     
  8. Saishy

    Saishy

    Joined:
    Mar 23, 2008
    Messages:
    947
    Resources:
    0
    Resources:
    0
    I didn't understand that part:

    Set point[2] = (point[1] offset by 100.00 towards ((Facing of (Triggering unit)) + 180.00) degrees)

    Isn't easier to just move the unit 100 points toward the center of the region each halfsecond?

    [-- This is what I'm using... with no actions xD --]
    Events:
    Unit - A unit leaves Mystic Fountain <gen>
    Conditions:
    Arena is equal to Mystic Fountain
     
  9. lolreported

    lolreported

    Joined:
    Aug 16, 2007
    Messages:
    666
    Resources:
    10
    Tools:
    1
    Maps:
    3
    Spells:
    6
    Resources:
    10
    Trust me, you should do it in this way, and:

    • Set point[2] = (point[1] offset by 100.00 towards ((Facing of (Triggering unit)) + 180.00) degrees)


    "point[]" is a point-array variable.

    What do you not understand?
     
  10. Saishy

    Saishy

    Joined:
    Mar 23, 2008
    Messages:
    947
    Resources:
    0
    Resources:
    0
    this: (point[1] offset by 100.00 towards ((Facing of (Triggering unit)) + 180.00) degrees)

    What it does?

    And the event cannot be that because I have more than one arena, and its impossible to do a region that covers all the blank spaces, its easier just to make a leaves region.

    Edit: I got it, the enter event will loop each time the unit still in the region because it will make it enter again and again xD
    But its still not possible to do a region covering all the blank areas...
     
  11. lolreported

    lolreported

    Joined:
    Aug 16, 2007
    Messages:
    666
    Resources:
    10
    Tools:
    1
    Maps:
    3
    Spells:
    6
    Resources:
    10
    Use the leave event then, this action...

    (point[1] offset by 100.00 towards ((Facing of (Triggering unit)) + 180.00) degrees)

    ...will move the unit 100.00 range backwards when it leaves/enters the region.