Hide markers when not in field of view

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

User avatar
steeffeen
Translator
Translator
Posts: 2472
Joined: 14 Oct 2012, 16:22
Location: Germany

Re: Hide markers when not in field of view

Post by steeffeen »

TGYoshi wrote:Or simply read the maniascript source file.

Code: Select all

enum ELabelsVisibility {
 None,
 Never,
 Always,
 WhenInFrustum,
 WhenVisible,
 WhenInMiddleOfScreen,
};
where are not talking about name labels
that the UI has attributes to define the visibility of player name labels doesn't mean that the xml tag for Hud3dMarkers has such an attribute as well
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks
    User avatar
    steeffeen
    Translator
    Translator
    Posts: 2472
    Joined: 14 Oct 2012, 16:22
    Location: Germany

    Re: Hide markers when not in field of view

    Post by steeffeen »

    i noticed that the hiding and showing of markers with the visibility="WhenVisible" attribute is quite delayed and i wonder why it's the case
    the client knows the position of the player and of the marker, shouldn't it be possible to hide the marker as soon as it's behind something?
    i guess the check for visibility isn't performed each tick for performance reasons?
      Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

      ManiaControl, FancyManiaLinks
      User avatar
      steeffeen
      Translator
      Translator
      Posts: 2472
      Joined: 14 Oct 2012, 16:22
      Location: Germany

      Re: Hide markers when not in field of view

      Post by steeffeen »

      i'm facing a problem with markers visiblity
      lets say we have custom object like a crystal which can be picked up and carried by a player, while it's picked up the player is marked with a marker visiblity="WhenInFrustum" which works quite fine
      but while the object is dropped it needs to be marked still because it could be on the other end of the map and not visible directly, when we use "WhenInFrustum" and the player is actually seeing the object itself the crystall is kinda doubled, because you see the crystall object AND the crystall marker, i think that's not really nice..
      the only solution i see is a value like visiblity="WhenNotInMiddleOfScreen"

      is there a chance that this value could be implemented?
      or does anyone have a better solution?

      btw: just to point that out again, the attribute is called "visiblity" and not "visible"
        Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

        ManiaControl, FancyManiaLinks
        Akbalder
        Posts: 1059
        Joined: 15 Jun 2010, 11:00
        Contact:

        Re: Hide markers when not in field of view

        Post by Akbalder »

        There may be an ugly solution. :lol:
        You can create a second fake marker displaying nothing with the visiblity WhenInMiddleOfScreen.
        In the marker's maniascript, you can check if this second marker is visible to show or hide the real marker.
        User avatar
        steeffeen
        Translator
        Translator
        Posts: 2472
        Joined: 14 Oct 2012, 16:22
        Location: Germany

        Re: Hide markers when not in field of view

        Post by steeffeen »

        Akbalder wrote:There may be an ugly solution. :lol:
        You can create a second fake marker displaying nothing with the visiblity WhenInMiddleOfScreen.
        In the marker's maniascript, you can check if this second marker is visible to show or hide the real marker.
        oh god :lol:
        i will try that xD

        //Edit: just want to note that this solution works! thanks for the hint :thumbsup:
          Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

          ManiaControl, FancyManiaLinks
          Post Reply

          Return to “ManiaScript”

          Who is online

          Users browsing this forum: No registered users and 3 guests