1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Ability for target point?

Discussion in 'World Editor Help Zone' started by Rugarus, Jun 21, 2018.

  1. Rugarus

    Rugarus

    Joined:
    Dec 2, 2016
    Messages:
    718
    Resources:
    0
    Resources:
    0
    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?
     
  2. Kaijyuu

    Kaijyuu

    Joined:
    Jun 2, 2004
    Messages:
    848
    Resources:
    0
    Resources:
    0
    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.
     
  3. Rugarus

    Rugarus

    Joined:
    Dec 2, 2016
    Messages:
    718
    Resources:
    0
    Resources:
    0
    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?
     
  4. Kaijyuu

    Kaijyuu

    Joined:
    Jun 2, 2004
    Messages:
    848
    Resources:
    0
    Resources:
    0
    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).
     
  5. Rugarus

    Rugarus

    Joined:
    Dec 2, 2016
    Messages:
    718
    Resources:
    0
    Resources:
    0
    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?
     
  6. Kaijyuu

    Kaijyuu

    Joined:
    Jun 2, 2004
    Messages:
    848
    Resources:
    0
    Resources:
    0
    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.
     
  7. Rugarus

    Rugarus

    Joined:
    Dec 2, 2016
    Messages:
    718
    Resources:
    0
    Resources:
    0
    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.
     
  8. Kaijyuu

    Kaijyuu

    Joined:
    Jun 2, 2004
    Messages:
    848
    Resources:
    0
    Resources:
    0
    Yeah a not-in-use player should work fine. Set the player slot's name and allegiance at map initialization, so it doesn't look weird or be hostile.
     
  9. Daffa

    Daffa

    Joined:
    Jan 30, 2013
    Messages:
    7,746
    Resources:
    28
    Packs:
    1
    Maps:
    8
    Spells:
    17
    Tutorials:
    2
    Resources:
    28
    If the unit is unkillable, try locust.
     
  10. nedio95

    nedio95

    Joined:
    Mar 24, 2011
    Messages:
    1,055
    Resources:
    1
    Spells:
    1
    Resources:
    1
    ^ 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