Changing HUD control point icons

Discussion in 'Mapping Questions & Discussion' started by GrimGriz, Feb 21, 2009.

  1. GrimGriz

    GrimGriz L10: Glamorous Member

    Messages:
    774
    Positive Ratings:
    133
    Has anyone successfully changed HUD CP icons on the fly - or figured out how to get the lock/unlock change to happen via triggers (aside from capping it to lock it)

    The entity accepts an add output, but doing a:
    team_overlay_0 sprites/obj_icons/redd

    didn't seem to do anything (but it didn't error either)

    For the curious:
    What I'm trying to accomplish is to visually unlock a CP by the firing of 2 other triggers. I've got a math counter that gets a +1 when each trigger is fired, and when the math counter hits 2, the capture zone for the CP is enabled (allowing it to be captured).

    What I'd like to have happen is for the CP to appear locked on the HUD until the capture zone is enabled...but I haven't managed to figure that one out yet.

    I'm using custom HUD icons, and I haven't figured out how they decide to apply the padlock (and more importantly how we can get at and use that process).

    - In the meantime, since while the capture zone is disabled it doesn't matter who owns the point, I'm going to use a gray locked icon for blu owning the point or something, and then change owner to 0 when teh cap zone is enabled...but that's a work around. If it can be done properly without changing owner that'd be better, so if you know how or have any ideas, please share.
     
  2. GrimGriz

    GrimGriz L10: Glamorous Member

    Messages:
    774
    Positive Ratings:
    133
    Turns out you can make the lock icon appear for one or both teams by changing the setTeamCanCap on the capture area (rather than messing with the HUD on the CP entity)

    This is how I ended up doing it:

    (it's still not changing the icon on the fly, but it got this particular job done).
     
  3. GrimGriz

    GrimGriz L10: Glamorous Member

    Messages:
    774
    Positive Ratings:
    133
    ok, from what I can tell now:

    when the CP cannot be captured by your team for whatever reason, the game tries add _locked to your sprite name and load that as the icon. So if you make just 1 custom icon and set it so a team can't capture, it's not going to drop a padlock on there. Depending on the name of your sprite, you'll probably get a checkerboard.

    So...depending on the gameplay mechanics used...you could change a CP icon to something completely different by naming the completely different icon normalname_locked and then changing SetTeamCanCap...

    Hope someone else finds this info useful :)
     
  4. Icarus

    aa Icarus

    Messages:
    2,246
    Positive Ratings:
    1,181
    I think snaketemple uses this for it's custom payload HUD.