Modify a marker using a client side script

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Post Reply
Akbalder
Posts: 1059
Joined: 15 Jun 2010, 11:00
Contact:

Modify a marker using a client side script

Post by Akbalder »

I tried to modify a marker using a client side script but it doesn't seem to work. :evil:
On the client side, UI.Hud3dMarkers = "something" seems to have no effect.
Does anyone know how to do it?
User avatar
steeffeen
Translator
Translator
Posts: 2472
Joined: 14 Oct 2012, 16:22
Location: Germany

Re: Modify a marker using a client side script

Post by steeffeen »

i don't know why but you can't modify the UI from the client side script, even BigMessage and stuff like that can't be modified

for dynamic markers i suggest looking into the realm script or my speedball2 beta version
    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: Modify a marker using a client side script

    Post by steeffeen »

    small tutorial:

    - create the hud3dmarker

    Code: Select all

    UI.Hud3dMarkers = """<marker pos="1 2 3" manialinkframeid="Marker_Frame"/>"""
    - create the markers layer

    Code: Select all

    declare MarkersLayer <=> UIManager.UILayerCreate();
    MarkersLayer.Type = CUILayer::EUILayerType::Markers;
    UIManager.UIAll.UILayers.add(MarkersLayer);
    - create the manialink for markers layer and modify the marker itself with it

    Code: Select all

    <frame id="Marker_Frame" hidden="1">
    	<label id="Label"/>
    </frame>
    <script><!--
    main() {
    	declare Label <=> (Page.GetFirstChild("Label") as CMlLabel);
    
    	Label.Value = "Marker text";
    }
    --></script>
      Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

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

      Re: Modify a marker using a client side script

      Post by Akbalder »

      With this method, the markers don't look like the default markers. :?

      EDIT: Does Anyone know the style used by default markers?
      User avatar
      steeffeen
      Translator
      Translator
      Posts: 2472
      Joined: 14 Oct 2012, 16:22
      Location: Germany

      Re: Modify a marker using a client side script

      Post by steeffeen »

      Akbalder wrote:With this method, the markers don't look like the default markers. :?

      EDIT: Does Anyone know the style used by default markers?
      i tried to find the style representing the default markers.. but couldn't find the correct one :/
      in speedball i added a quad with bgcolor="aaa6"
        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: Modify a marker using a client side script

        Post by steeffeen »

        this isn't exactly about the initial topic but still concerning Hud3dMarkers:

        1. may it be possible to assign a specific manialinkframe in a Markers ManialinkPage to multiple Hud3dMarkers? that would be great as a mode may need a variable number of markers with the same style

        2. could a frame with hidden="1" set hidden automatically again after its Hud3dMarker has been removed please? right now the frame is hidden until an according marker is set, then it's visible - good, but it stays visible when the marker isn't set anymore leading to a manialink control somewhere on the screen :/

        3. it would be great if we could use multiple ::Markers UIlayers, because now only a single one is working

        Thanks in advance! :thx:

        Regards
        Steff
          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 1 guest