Compass GUI

Shows which direction the player is facing with a GUI

Total Downloads: 5,337 - First Release: Jul 15, 2015 - Last Update: Oct 27, 2017

5/5, 12 likes
  1. Todays update made compass disappear. The commands work, there are no errors on the console, but f1 shows AddUI: Unknown Parent : Overlay
     
  2. Wulf

    Wulf Community Admin

    Any CUI/GUI plugins will not work until a fix is made via a Rust update.
     
  3. thank you
     
  4. how to move to left or right side not middle
     
  5. Play with the numbers in the configuration file. In the thread you can also search for my posts where I guide some people.
     
  6. Can anyone else get this gui to work after the latest update?
     
  7. hello this plugin works, but i think it is crashing the server, when i leave server on .. it will freeze server i think compass is responsible.
     
  8. Ok ... I've got the compass working but even though I've set the config file to NOT display player coordinates it still does. Am I missing something?
     
    Last edited by a moderator: Jul 15, 2017
  9. OK ... I figured it out! There is a BUG in the code where it determines what to display if 'displaycoords' is false (disabled). The codeing problem was that no matter WHAT you set 'displaycoords' to actually does both! In either case, there json string containing the display formatting also needed to be corrected to deal with both situations. The one WITHOUT and then the on WITH.

    Here is the corrected code:

    Code:
                        CommunityEntity.ServerInstance.ClientRPCEx(new Network.SendInfo() { connection = player.net.connection }, null, "DestroyUI", new Facepunch.ObjectList("EyesPosition", null, null, null, null));
                        if (!displaycoords)
                        {
                            CommunityEntity.ServerInstance.ClientRPCEx(new Network.SendInfo() { connection = player.net.connection }, null, "AddUI", new Facepunch.ObjectList(json1.Replace("{eyeposition}", GetEyesPosition(player)).Replace("{xmin}", xmin).Replace("{xmax}", xmax).Replace("{ymin}", ymin).Replace("{ymax}", ymax), null, null, null, null));
                        }
                        else
                        {
                            CommunityEntity.ServerInstance.ClientRPCEx(new Network.SendInfo() { connection = player.net.connection }, null, "AddUI", new Facepunch.ObjectList(json2.Replace("{eyeposition}", GetEyesPosition(player)).Replace("{positionx}", posx.ToString()).Replace("{positionz}", posz.ToString()).Replace("{xmin}", xmin).Replace("{xmax}", xmax).Replace("{ymin}", ymin).Replace("{ymax}", ymax), null, null, null, null));
                        }
    This formatting Destroys the UI once and then Adds back the correct one.

    Note also that the string json also needs to be split into two (2) separate versions json1 and string json2 (without and with respectively). So do the following
    1. Make a copy of the whole string deceleration for json and call it json2.
    2. Rename json to json1
    3. Withinw the json1 string remove the LAST major parenthesis group that contains ""text"":""X: {positionx}, Z: {positionz}"",
    Granted this is a QUICK FIX ... and I'll look at a more in-depth solution next.

    I'm also planning on adding modes, one for finer text directions (16 vs. 8) as well as degrees 000°. I'm also going to add in altitude (in Feet or Meters). All with options of course.

    @Developer: Please let me know and I'll hand this code back to you when I'm done ;)
     
    Last edited by a moderator: Jul 16, 2017
  10. This plugin is broken in current rust/oxide
    NetworkData.Write - no handler to write Facepunch.ObjectList -> Facepunch.ObjectList
    NetworkData.Write - no handler to write Facepunch.ObjectList -> Facepunch.ObjectList
    NetworkData.Write - no handler to write Facepunch.ObjectList -> Facepunch.ObjectList
    disconnecting: RPC Error in AddUI


    removed CompassGUI and I can login again
     
  11. Wulf

    Wulf Community Admin

    Wulf updated Compass GUI with a new update entry:

    1.2.1

     
  12. For anyone that wants the compass above your stat bars on the right hand side, this is what I used.
    "X max": "0.96",
    "X min": "0.85",
    "Y max": "0.39",
    "Y min": "0.31"

    upload_2018-1-1_19-15-36.png
     
  13. Sorry if i missed it but is it possible to move it to bottom left or top right of the screen??
     
  14. Very cool!
     
    Last edited by a moderator: Feb 3, 2018
  15. Code:
    {
      "GUI": {
        "X max": "0.56",
        "X min": "0.45",
        "Y max": "0.99",
        "Y min": "0.91"
      },
    
    X is how far in % from the left side of the screen, the min would be the start of the UI and max would be the end of the UI. They have 11% difference, so the UI is 11% wide. It start at 45% from left side of screen and ends at 56% from left side of the screen.

    Y is the same, but from the bottom. The bottom of the UI starts at 91% and ends at 99%, so the UI is 8% of the high.

    To move it to the top right you would need x min 88 and max 99. Play around with it and you should figure it out. :p
     
  16. So for some reason, coordinates are showing even when the switch is turned to false.
     
  17. @Wulf will we be seeing a fix for the broken displaycoords switch anytime soon? Seems that's been broken for quite some time.

    or @PaiN my apologies. Didn't see the maintainer part.
     
  18. Error while compiling: CompassGUI.cs(72,27): error CS0103: The name `true2' does not exist in the current context
     
  19. Wulf

    Wulf Community Admin

    Sounds like you modified the plugin. :p
     
  20. Huh odd. Nonetheless coordinates always stays on even when I turn it to false. Even after fixing the modified plugin LOL