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,495
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
611
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
  • Varine Varine:
    I'll also probably need to set up a server at some point because these scans take up a huge amount of space. I'll worry about that when I have an office though
  • The Helper The Helper:
    I am sure Ghan could give you some solid advice on the Server stuff
  • The Helper The Helper:
    I hear that the latest IPhones and Samsungs have some of the best cameras out there.
  • jonas jonas:
    phone cameras are good for sending pics on whatsapp, but no good for macro photography
  • jonas jonas:
    I think you should buy a used macro lens, do you already have a system camera?
  • Varine Varine:
    No, I'm still looking into them and kind of leaning towards a Rebel T7 at the moment because it's pretty cheap and lenses seem pretty easy to come by. Used ones are only like 3-400 dollars, which is much cheaper than I was planning
  • jonas jonas:
    I can't really recommend you any specific lens or body due to lack of knowledge, but in my experience camera shops are very helpful, especially those that also sell used parts
  • Varine Varine:
    There's only one camera shop in my town and they seem to specialize in film, but I have time before I need it. I'm not in a rush so I'll keep researching them
  • jonas jonas:
    I think since you have such specific needs, you should find a way to give a try for different systems without having to commit to one
  • jonas jonas:
    It would suck to spend 400$ on a system that doesn't have the capability you need
  • jonas jonas:
    and it will probably take a couple of tries to get the settings right
  • Varine Varine:
    It would but I can also just make sure I can return them. The system I have works, it's pretty straightforward and I tested it with a camera I have. All it really is is a little cartridge that holds the transparency film and a white light source behind it that projects the image into the lens
  • Varine Varine:
    I'll have to fuck with the light a bit and try some different lighting methods to get color accuracy, but I have IT8 targets for that
    +1
  • The Helper The Helper:
    get that color accuracy :)
  • Varine Varine:
    They're really helpful for calibrating things because I'm really colorblind, so I'm not great at doing it by eye
    +2
  • Varine Varine:
    Well the long, slow slog of winter has officially begun here
  • Varine Varine:
    I have a bunch of community service I have to do, and I have a feeling there will be a lot of snow shoveling involved now
  • The Helper The Helper:
    don't know why people choose to live in that kind of weather :)
  • Varine Varine:
    Well
  • Varine Varine:
    My job is here
  • Varine Varine:
    I was born here man I didn't choose shit
  • Varine Varine:
    And also, I keep moving away and it doesn't get any better. I moved to San Antonio and shit froze there AND we had blackouts

    The Helper Discord

    Members online

    No members online now.

    Affiliates

    Hive Workshop NUON Dome World Editor Tutorials

    Network Sponsors

    Apex Steel Pipe - Buys and sells Steel Pipe.
    Top