How to change HUD Marker text dynamically?

  • I would like to set up a Kismet sequence that will dynamically change an AOCHUDMarker actor’s text. Is there a way to this? I assume it would be possible by using a Modify Property node, but what is the name of the property I would need to change?

  • Are you using the ‘Float Text Agatha/Mason’ Property for the text or the HUDMarker Extension of the TBSHUD section?

  • @Hordy
    I’m using the Float Text Agatha and Float Text Mason properties under the AOCHUDMarker section.

    The text properties under the TBSHUD section don’t seem to do anything when I set them. Not sure how they work.

  • @Eggplant
    To change the properties you mentioned, specify the property name ‘FloatTextAgatha’ and/or ‘FloatTextMason’ in the ‘Modify Property’ node.

    Alternatively you may use the ‘Add and Attach TO2 Hud Marker(s)’ Kismet node in conjunction with ‘remove TO2 Hud Marker(s)’, to display a different HUD text.

    The text properties under the TBSHUD section work just fine if you enable ‘Initial Have HUD Marker’ and ‘Use HurdMarker Extension’.

  • @Hordy
    I’ve tried setting the FloatTextAgatha/FloatTextMason properties using the Modify Property node already and it didn’t work. Tried it again just now to double check and still nothing. See screenshot: (Broadcast Message is there just to verify that the event is actually firing. It is.)

    Also this isn’t for a TO2 map so I don’t think the TO2 specific nodes will work on it?

  • @Eggplant
    I tested in the editor as well and the text changed. Did you test on a dedicated server as a client? The change might not be replicated then. Your Kismet looks fine. I also used the AOCGame mode in editor.

    Even if the Node has TO2 in it’s name, it may still work for other game mode. It’s worth a try.

  • @Hordy
    I only tested it in the editor. There must be something you’re doing differently from me if you got it to work, but I have no idea what. I tried changing the game modes around (tried AOCFFA, AOCTeamObjective, CMWTO2, AOCGame) to see if that had anything to do with it, but it didn’t make a difference.

    I also just tried using Add and Attach TO2 HUD Markers, but it didn’t work unless I set the game mode to CMWTO2 (this will be for a FFA map, so I won’t be able to do that).

    Edit: Did you use a AOCHUDMarker or CMWHUDMarker actor? I just tried switching from using a AOCHUDMarker actor to a CMWHUDMarker actor instead and the Modify Property node worked when I tried it on that. However, the problem with using a CMWHUDMarker actor is that it seems to get destroyed if the pawn I attach it to dies, even though there’s a property named “Destroy Self If Base Killed Or Destroyed” and I don’t have it checked off. I think this is also the type of HUD actor that gets created by the TO2 HUD Kismet nodes, so I’m concerned about there being unforeseen issues with using them in a non-TO2 map.

    Edit 2: It seems it is not actually being destroyed when the pawn dies, just stops rendering, and I’m able to re-attach it to a new pawn if I detach it from the previous one. But the HUD marker becomes brighter each time it is re-attached, as though it is being rendered multiple times. I’m getting the sense that the CMWHUDMarker actors are only designed to be created and used through the TO2 HUD Kismet nodes, which don’t seem to be an option in an FFA map.

    Edit 3: Attempted to use the TBSHUD text properties instead of the Float Text properties (on an AOCHUDMarker actor). I tried checking off Use HUDMarker Extension and Initial Have HUDMarker like you suggested but I still don’t see the text. Only the image is visible.

  • @Eggplant
    If the TO2 nodes don’t work use an Actor Factory with the factory set to ‘ActorFactoryActor’ and the Actor Class set to CMWHudMarker.
    After is was spawned set the text with the modify property node.
    Then use the ‘Attach to Actor’ node.

    Tested in editor.

  • @Hordy
    The last time I tried to use Actor Factory (unrelated to this) it failed when it was run on a server. The object would be spawned on the clients as expected, but any Kismet actions performed on the object after that would not be replicated to the clients (it had all worked fine when tested within the editor).

  • Did you try using a server to client bridge in Kismet?

  • @Hordy
    I did some testing with it on a server just now and using Server to Client Bridge didn’t seem to help either. I did discover that it will successfully replicate changes to the spawned actor if they’re performed within the same sequence immediately afterwards, but it seems the server will not be able to replicate any additional actions onto the spawned actor outside of that. This makes it impossible to change the text later on or despawn the HUD actor after the pawn is killed (I tried 2 different methods to do this, one by setting bDestroySelfIfBaseKilledOrDestroyed=1 in Modify Property, and one by calling a Destroy node following the pawn’s Death event. These worked fine in the editor).

    There is another problem with using a CMWHUDMarker instead of an AOCHUDMarker: If a client’s pawn/camera location is too far away from the pawn that the HUD marker is attached to and line of sight is blocked, the HUD marker will be invisible to the client (I have run into a similar issue with AOCHUDMarkers, but unlike CMWHUDMarkers, they will correct themselves once the client’s pawn/camera moves close enough).

  • For bDestroySelfIfBaseKilledOrDestroyed to work you need to set a base too. For instance, the marker should disappear if the pawn is killed if you attach it to a pawn.
    If the marker still persists, place for each text a different marker and hide/show/attach as needed.

    In general, I would not advise to use any of these Markers, because they caused lagspikes on my servers (method UpdateDynamicHUDMarkers in aocbasehud was too expensive according to profiling).
    Maybe because TB uses Scaleforms to render them.

    Now I’m using SpriteComponents which can also be displayed always infront any obstacles blocking the view, like HUD elements.

    But this is only possible using uscript, I think.

  • @Hordy
    It was attached to a pawn. It was successfully destroyed upon the pawn’s death when tested in the editor, but not when tested on a server. It appears that nothing about the spawned HUD actor is replicated to clients once the Kismet sequence that caused it to spawn has finished (it would not let me change the text later on either), so I don’t think attempting to hide the HUD actor when I need to replace it with a new one would work either.

    Anyway, I think I might give up on this idea for now since CMWHUDMarkers have too many issues that are either impossible or very difficult to work around (without using a TO2 map) and AOCHUDMarkers apparently do not support changing the text after their creation. I have not looked into learning uscript yet and I don’t think it would be worth the time it would take to learn it for what I’m attempting to do here.

Log in to reply