• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Ability for target point?

Status
Not open for further replies.
Level 12
Joined
Dec 2, 2016
Messages
733
Is there an ability that basically you click it and then click on a point on your screen and you can get the target point.


Like for example, I activate the ability then click on a spot on the screen and my trigger creates a unit and orders the unit to move to that location?
 
Level 11
Joined
Jun 2, 2004
Messages
849
This is what Channel is for. Set its Data - Options to "Visible, Targeting Image", its Data - Target Type to "Point Target", and it's area of effect to 100 or so. Viola, point targeted ability that does nothing, but you can detect with triggers.
 
Level 12
Joined
Dec 2, 2016
Messages
733
This is what Channel is for. Set its Data - Options to "Visible, Targeting Image", its Data - Target Type to "Point Target", and it's area of effect to 100 or so. Viola, point targeted ability that does nothing, but you can detect with triggers.

Thanks, is there a way to take away control of a unit?

Like while my hero is casting the ability, I create a new unit that heads to the target position. So actually two questions. #1) I need to somehow not allow the user to reset the path of the spawned unit. I want him to head to the target path. And #2) How can I detect if the unit has reached the target point? Or do I need to continually check if the unit's position is = to the target point?
 
Level 11
Joined
Jun 2, 2004
Messages
849
1) Give it to an allied computer player. All other methods have downsides.
2) You can put a region there and check if they enter it. Or a unit, and use the "Unit Within Range" event. Or periodically check if they're close enough to the point (since in all likelihood they'll never stand exactly on it).
 
Level 12
Joined
Dec 2, 2016
Messages
733
1) Give it to an allied computer player. All other methods have downsides.
2) You can put a region there and check if they enter it. Or a unit, and use the "Unit Within Range" event. Or periodically check if they're close enough to the point (since in all likelihood they'll never stand exactly on it).

If I give it to an allied player, that player has to exist before the game is created right? Like lets say I have players 1-12, red, blue, teal etc all the way up to brown. I would then need some like other color or a player 13 already existing before the game starts? Or is there another way to give the control to another player?
 
Level 11
Joined
Jun 2, 2004
Messages
849
You don't really have to give the slot a Computer controller but it makes it easier to set the player's name/etc to what you want.

Oh and if you expect this computer player to be controlling a LOT of units, you may want to use multiple slots instead of just one. The pathing engine lags if a player has over ~100 units. Notable for TDs and hero defenses and line wars and the like.
 
Level 12
Joined
Dec 2, 2016
Messages
733
You don't really have to give the slot a Computer controller but it makes it easier to set the player's name/etc to what you want.

Oh and if you expect this computer player to be controlling a LOT of units, you may want to use multiple slots instead of just one. The pathing engine lags if a player has over ~100 units. Notable for TDs and hero defenses and line wars and the like.

Basically my hero spawns a unit, and I don't want him to have control over it until the unit expires which is 5 seconds. So do I just set the control of the unit to a player color not in use? I don't want to have to create a computer slot unless I have to.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
If the unit is unkillable, try locust.
^ This

Otherwise, you could remove the selection size of the unit. Although, I think that would still be select-able by dragging a box. Not 100% sure, but it is an easy test if you have WE.

There are also various periodic triggers that you could run for deselecting the unit and re-ordering the original order. Which can actually break a bit if a player is fast enough.

Also, don't forget that you have 4 Neutral players, if you decide to go the "dummy player" way.
2 of them are fairly obvious (Hostile & Passive) but the other two are fairly often overlooked. (Victim & I don't remember the name of the fourth) Depending on how many players can create this unit and what interaction they have in-between each other and your map design, this information may satisfy your needs.

I would say, that it would be better to explain what you are trying to achieve, instead of asking how to do a part of it. There may be a better way of doing what you want without a unit or a different way that we do not consider under the current problem provided.

regards
-Ned
 
Status
Not open for further replies.
Top