• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Wondering alone

Status
Not open for further replies.
Level 7
Joined
Jun 23, 2009
Messages
297
I created a special unit, wich is invulnerable, but as i dont want it to be used as a spy, i want it to be at a minimum distance from a player owned unit...
I mean, the unit is called Healer, and i dont want the healer to be used as a spy, so i want it to be allways close to a unit of the same player...
How can i make that? I seriously have no idea where to start...
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
I'm not quite sure what you mean..

However if you don't need to have the unit to attack, then set it's Combat - Attacks enabled to none in object manager. Then use unit - issue order targeting a unit - follow.

That's a simple solution, however not knowing your system it's difficult to say if it satisfies your needs.
 
Level 12
Joined
Dec 10, 2008
Messages
850
I think he means he wants the unit to be invulnerable, but cant be used to follow the enemy heros/troops/ watch their base. I can only think of a way to do this as long as it is within the acual main town, using rects and other things. But thats only if thats what he wants
 
Level 7
Joined
Jun 23, 2009
Messages
297
Yeah, Coolty thats what i want... Its invulnerable, so it can go anywhere, but i dont want it to be used as a spy... so if its not close to a unit owned by the same player, it goes back to base or something...
I thought of this:

  • Wondering
  • Events
  • Unit - A Unit Leaves (Region 1)
  • Conditions
  • Actions
  • Unit - Move (triggering unit) instantly to (region 2)

But i realased that, if i did it like this, the healer would be usless in combat, when the player invades the enemy's base... since they have to leave region 1...
 
Level 17
Joined
Mar 17, 2009
Messages
1,349
Maker says it right... you might want to get the GetClosestUnit jass systme in the Jass section...

Then GetClosestUnit to the invulnerable unit,
then you check for whether the distance is greater or not then the distance you define;
if greater --> teleport.

You might want to be checking for the distance at 1 second intervals... I mean it doesn't have to be precise in this case you know...
 
Status
Not open for further replies.
Top