• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Problem with "Unit enters region"

Status
Not open for further replies.
Level 12
Joined
Mar 23, 2008
Messages
942
Well, first I tried that:

  • Events
  • Unit - A unit enters base1 1 <gen>
    • Conditions
  • (Owner of (Triggering Unit)) Equal to (Random Player from (Allies of Player 2))
    • Actions
  • Unit - Move (Triggering Unit) instantly to (Point)
Didn't worked, I don't know why... (Player 2 is from Force 2)

After I tried that:


  • Events
  • Unit - A unit enters base1 1 <gen>
    • Conditions
  • (Owner of (Triggering Unit)) Not equal to (Random Player from Force1)
    • Actions
  • Unit - Move (Triggering Unit) instantly to (Point)
And did a series of actions in map initialization to add each player to their correct forces (two variables: Force1 and Force2)

And worked! For one time... After I entered the region nothing happened, my enemy entered and got teleported (Ha!) So I went outside, attacked him and went back to my base... and got teleported too!

What I did wrong? The variable losses it value?
 
Level 8
Joined
Jan 23, 2008
Messages
334
Try a "unit group" command to pick a random unit and use picked unit when issuing the order. Make your condition Player comparison equal to player 2 and make it entering unit and not triggering it just makes it easyer to edit later if you want to add options.

edit: You could have just used the Force Editor
 
Random = random which means the pc choose it randomly

Well, first I tried that:

  • Events
  • Unit - A unit enters base1 1 <gen>
    • Conditions
  • (Owner of (Triggering Unit)) Equal to (Random Player from (Allies of Player 2))
    • Actions
  • Unit - Move (Triggering Unit) instantly to (Point)
  • Random = random which means the pc choose it randomly
  • what you need is:
  • [TRIGGER]
    • Events
    • Unit - A unit enters base1 1 <gen>
      • Conditions
    • Boolean comparison (Triggered unit belongs to an allt of player) equal to (True)
      • Actions
    • Unit - Move (Triggering Unit) instantly to (Point)
 
Level 6
Joined
Mar 19, 2008
Messages
207
Well, first I tried that:


  • Events
    • Unit - A unit enters base1 1 <gen>
      • Conditions
    • (Owner of (Triggering Unit)) Equal to (Random Player from (Allies of Player 2))
      • Actions
    • Unit - Move (Triggering Unit) instantly to (Point)
  • Random = random which means the pc choose it randomly
  • what you need is:
  • Events
    • Unit - A unit enters base1 1 <gen>
      • Conditions
    • Boolean comparison (Triggered unit belongs to an allt of player) equal to (True)
      • Actions
    • Unit - Move (Triggering Unit) instantly to (Point)

Fixed!!! PLus hes right random mean Pc chooses Random

EDIT: I guess i didnt fix it just made confusing...
SRY!
 
Level 12
Joined
Mar 23, 2008
Messages
942
The hell ?
A unit enters a region, if the unit is ally of player 1 (for team 1) then move.
Whats so hard about that ?

Well, it seems the players like to complicated the things >.<

And some persons are just posting Unit = Player 2... I WANT FORCE 2!!!

Edit:

  • Events
  • Unit - Unit enters base1 1 <gen>
  • Conditions
  • ((Owner of (Entering Unit)) is an ally of Player 2(Blue)) Equal to True
  • Actions
  • Unit - Move (Entering Unit) Instantly to (Point)
Worked! Thanks best_player_88 and Mc_Flurry!
 
Status
Not open for further replies.
Top