Todays update made compass disappear. The commands work, there are no errors on the console, but f1 shows AddUI: Unknown Parent : Overlay

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
-
Wulf Community Admin
-
thank you
-
how to move to left or right side not middle
-
-
Can anyone else get this gui to work after the latest update?
-
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.
-
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 -
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)); }
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
- Make a copy of the whole string deceleration for json and call it json2.
- Rename json to json1
- Withinw the json1 string remove the LAST major parenthesis group that contains ""text"":""X: {positionx}, Z: {positionz}"",
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 doneLast edited by a moderator: Jul 16, 2017 -
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 -
Wulf Community Admin
Wulf updated Compass GUI with a new update entry:
1.2.1
-
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"
-
Sorry if i missed it but is it possible to move it to bottom left or top right of the screen??
-
Code:
{ "GUI": { "X max": "0.56", "X min": "0.45", "Y max": "0.99", "Y min": "0.91" },
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. -
So for some reason, coordinates are showing even when the switch is turned to false.
-
Error while compiling: CompassGUI.cs(72,27): error CS0103: The name `true2' does not exist in the current context
-
Wulf Community Admin
-