Unit Highlighted in HUD

Widescreen

Member
Reaction score
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.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,492
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:
Code:
Space center
    Events
        Time - Every 0.30 seconds of game time
    Conditions
    Actions
        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.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
609
If you're not using them for anything else, you could give the desired units the Worker classification under Stats - Unit Classification. That makes them appear in the bottom left instead of top left, and all such units are grouped together into the same button, but it's a way of having quick access without making them Heroes. In WC3 DotA terms it's like Visage's Familiars.

Another alternative is to create a dummy Hero with the same icon, and put it somewhere off the map. That hero will still have its icon appear in the upper left, so it can be selected that way. Then you make a trigger that detects when the dummy Hero is selected, and selects your desired unit(s) instead. Have another trigger that continuously updates that dummy Hero's HP and Mana to be the same rate as your main unit, and the HP/Mana bars will be the same as well! It won't flash red when your unit is attacked though (maybe yet another trigger that detects when your unit is damaged, and deals some tiny amount to the dummy Hero?).
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Happy Sunday!
    +1
  • The Helper The Helper:
    I will be out of town until Sunday evening
    +1
  • The Helper The Helper:
    I am back! Did you miss me LOL
    +1
  • jonas jonas:
    where did you go?
  • The Helper The Helper:
    Jefferson TX on a Paranormal Investigation of a haunted bed and breakfast - I got some friends that are paranormal investigators and they have an RV and do YouTubes
    +1
  • The Helper The Helper:
    It was a lot of fun. The RV was bad ass
  • jonas jonas:
    That sounds like fun!
    +1
  • The Helper The Helper:
    it was a blast!
  • The Helper The Helper:
    I am going to post the Youtube of the investigation in the forums when it is ready
    +1
  • jonas jonas:
    cool!
  • vypur85 vypur85:
    Sounds cool TH.
  • tom_mai78101 tom_mai78101:
    I was on a Legend of Zelda marathon...
  • tom_mai78101 tom_mai78101:
    Am still doing it now
    +1
  • jonas jonas:
    which one(s) are you playing?
  • jonas jonas:
    I played a little bit of the switch title two weeks ago and found it quite boring
  • The Helper The Helper:
    just got back from San Antonio this weekend had the best Buffalo Chicken Cheesesteak sandwhich in Universal City, TX - place was called Yous Guys freaking awesome! Hope everyone had a fantastic weekend!
    +1
  • The Helper The Helper:
    Happy Tuesday!
  • The Helper The Helper:
    We have been getting crazy numbers reported by the forum of people online the bots are going crazy on us I think it is AI training bots going at it at least that is what it looks like to me.
  • The Helper The Helper:
    Most legit traffic is tracked on multiple Analytics and we have Cloud Flare setup to block a ton of stuff but still there is large amount of bots that seem to escape detection and show up in the user list of the forum. I have been watching this bullshit for a year and still cannot figure it out it is drving me crazy lol.
    +1
  • Ghan Ghan:
    Beep boop
    +1
  • The Helper The Helper:
    hears robot sounds while 250 bots are on the forum lol
  • The Helper The Helper:
    Happy Saturday!
    +1

    The Helper Discord

    Members online

    Affiliates

    Hive Workshop NUON Dome World Editor Tutorials

    Network Sponsors

    Apex Steel Pipe - Buys and sells Steel Pipe.
    Top