• 🏆 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!

Move Unit Trigger

Status
Not open for further replies.
Level 2
Joined
Jun 16, 2016
Messages
18
Hello there, i have a question about moving units into dungeon Area Region,

i want to make a trigger which include the following details,
http://www.hiveworkshop.com/pastebin/bd582b9540945df014912833775e68306477/

the trigger works fine but my question is, for the condition i want to add that the player who typed -enter (player [red] for example) must be inside the region of dungeon entrance (Units in Gate 2 <gen>)
what is the suitable condition for that? i mean <triggering unit> inside (Units in Gate 2 <gen>) condition is wrong, triggering unit is wrong, so what should i replace it with?

my 2nd question i want to set a condition which indicate, if there was a player <inside dungeon 1 area> then do nothing
else
  • Unit Group - Pick every unit in (Units in Gate 2 <gen>) and do (Actions)
    • Loop - Actions
      • Unit - Move (Picked unit) instantly to (Center of Region 059 <gen>)
  • [TRIGGER
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,200
Does each player only have 1 unit they control?
Yes. This was clarified in the chatroom.

so what should i replace it with?
Map each player's hero to their player slot ID using a unit array. For example Player 1's hero would be in index 0 (or index 1 if using GUI slot numbering) of this array. Name the array something sensible like "PlayerHeroes".

Then replace triggering unit part of the condition with something like...
PlayerHeroes[(Player Slot Number((Triggering Player)))]
 
Last edited:
Level 2
Joined
Jun 16, 2016
Messages
18
Yes. This was clarified in the chatroom.


Map each player's hero to their player slot ID using a unit array. For example Player 1's hero would be in index 0 (or index 1 if using GUI slot numbering) of this array. Name the array something sensible like "PlayerHeroes".

The replace triggering unit part of the condition with something like...
PlayerHeroes[(Player Slot Number((Triggering Player)))]
hmm.. now my map got -save/load triggers system, for the load trigger should i put in the end of it
PlayerHeroes[(Player Slot Number((Triggering Player)=last created unit? or its not necessary?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,200
PlayerHeroes[(Player Slot Number((Triggering Player)=last created unit?
Yes putting something like that is a good idea. Some save/load systems might not use last created unit so I recommend reading the documentation.
or its not necessary?
It is necessary or the trigger systems might not think that the loaded unit is the player's hero.
 
Status
Not open for further replies.
Top