Unit Highlighted in HUD

Discussion in 'World Editor Help' started by Widescreen, Apr 16, 2019 at 2:50 PM.

  1. Widescreen

    Widescreen Member

    +0 / 0 / -0
    Hello, I am working in an RPG/Arena/TD, and I want a unit to be highlighted (for easy access) like the Hero is highlighted (shown in picture), but I don't want the unit to become a Hero. The Heroes are Created (purchased) at the beginning of the game.


    Also, I was having trouble to make the spacebar do the same as when you have selected your hero and the camera follows it when you click its "face". I managed to make it center your hero but it will stay in one place if your hero is moving.


    Any ideas? Thank you for your time.
  2. AceHart

    AceHart Your Friendly Neighborhood Admin

    +1,483 / 0 / -0
    The icon coming from "Stats - Hero - Hide interface icon: false" on the unit in the Object Editor, and given that normal units to not have that field, I'd say you are out of luck there.

    As for the spacebar..., well, if you keep space pressed, it will not repeat the event. Hence the "it does not work".
    Though it will work if you press space repeatedly.

    I would suggest a slightly different trigger:
    Space center
            Time - Every 0.30 seconds of game time
            Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
                Loop - Actions
                    Unit Group - Pick every unit in (Units owned by (Picked player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
                        Loop - Actions
                            Set Point = (Position of (Picked unit))
                            Camera - Set a spacebar-point for (Picked player) at Point
                            Custom script:   call RemoveLocation(udg_Point)

    That said, there is an action called "Camera - lock camera to target unit", which will, as is says, literally lock the camera onto a unit;
    as well as "Camera - pan camera with interpolated height", which can be called repeatedly to re-center the camera on a unit as needed.

Share This Page