Author Topic: [MOD] MoveUI Plugin - Sector Ship Notifier (UI shows all ships in sector!)  (Read 4072 times)

DracoNB

  • Jr. Member
  • **
  • Status:
    Offline
    Posts:
    76
    • View Profile
Features:

  • Shows all ships in sector
  • Filter out Civilian and/or Friendly ships
  • Select ship by left or right clicking on the list (Warning, left mouse WILL fire weapons!) I recommend using right click.
  • Choose faction relation level to consider "friendly"

Pre-Reqs: MoveUI by Dirtyredz (v2.1.1)
Server side requirements: Yes

Client side requirements: Yes

Install:

Download the file. Unzip "ShipNotifier.lua" to your avorion/mods/MoveUI/Scripts/player folder

Edit avorion/mods/MoveUI/config/MoveUIConfig.lua and add the following down with the others:

Code: [Select]
MoveUIConfig.AddUI("ShipNotifier", false)

Where you add it is where it will show up on the main MoveUI screen. I personally put it under "FactionNotifier" since that deals with adding sector faction info and this adds the ship details.

Here is an example video of it in action:



Download:

https://github.com/draconb/avorion-shipnotifier/releases

Download the source code and then unzip the mods folder to your steamapps\common\avorion\mods

Should look like:

steamapps\common\avorion\mods\MoveUI\scripts\player\ShipNotifier.lua

and have a few other files from MoveUI already in that folder such as FactionNotifier.lua. If you don't, its in the wrong spot!

TODO:

Figure out if there is a way to cancel mouse button events so middle mouse button can be used for target selection (it selects then deselects since the mouse isn't over a target)

More options?

Improve contrast? Hard to see depending on the sector / lighting. I added a slight drop shadow to help
« Last Edit: May 24, 2018, 07:57:22 AM by DracoNB »



Ditsydoo

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    3
    • View Profile
This is pretty sweet, now if only I can get the AI to target the enemy I target.



Galovist

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    1
    • View Profile
 ;D Love this mod, so much less delegating small tasks and so much more winning.



Shrooblord

  • Hero Member
  • *****
  • Status:
    Offline
    Posts:
    578
    • View Profile
Ah geebus this is good. Thank you thank you thank you!
Shrooblord



DracoNB

  • Jr. Member
  • **
  • Status:
    Offline
    Posts:
    76
    • View Profile
Ah geebus this is good. Thank you thank you thank you!

Glad you like it, glad its still working for the latest patch I haven't played much myself recently



Shrooblord

  • Hero Member
  • *****
  • Status:
    Offline
    Posts:
    578
    • View Profile
My friend wanted to be able to select Stations in the same way you can select ships. I basically hacked together that functionality by lazily copy-pasting what was already in-place for ships. Not super sure if it's buggy, but it seemed to work fine for us, so give it a try if that sounds interesting to you!

Exact same installation instructions; see the first post.
Shrooblord



Devious

  • Hero Member
  • *****
  • Status:
    Offline
    Posts:
    579
  • Have you seen Rusty?
    • View Profile
    • Rusty's Universe and Community
Awesome, nice to see others joining in on extending MoveUI :)



Devious

  • Hero Member
  • *****
  • Status:
    Offline
    Posts:
    579
  • Have you seen Rusty?
    • View Profile
    • Rusty's Universe and Community
My friend wanted to be able to select Stations in the same way you can select ships. I basically hacked together that functionality by lazily copy-pasting what was already in-place for ships. Not super sure if it's buggy, but it seemed to work fine for us, so give it a try if that sounds interesting to you!

Exact same installation instructions; see the first post.

Interesting, that's one less click than using Sector Overview :)



Shrooblord

  • Hero Member
  • *****
  • Status:
    Offline
    Posts:
    578
    • View Profile
Additionally, I added alphabetical sorting to the list (by ship name) and a tiny tweak to the colours that were used to display the names. My friend and I found the deep purple very hard to read so I made it slightly more pastel.
Shrooblord



Shrooblord

  • Hero Member
  • *****
  • Status:
    Offline
    Posts:
    578
    • View Profile
One more from me.

My friend wanted to know if I could add a "[!]" in front of the Stations' names for Stations that have a Bulletin active on their Bulletin Board, so you can in one glance see whether there are Bulletins available when you jump into a Sector.

The result is the attached file.

It includes all the previous changes, but now also overwrites the vanilla file data/scripts/entity/bulletinboard.lua. Will conflict with other mods that overwrite the same file.

Drag and drop the contents into your main Avorion folder.

----

EDIT:

And a bug report: the Persecutor Pirate teams that get spawned on you when you're weak in a certain part of the Galaxy are mislabelled as "Friendly Ships", even though relations with them are Abhorrent, with the "Friendly Threshold" set at 0.


----

Bug Report #2:

While piloting a Faction ship, the relations displayed are those of the ships towards the PLAYER, not towards the Faction. This is confusing behaviour.
« Last Edit: July 12, 2018, 10:37:01 PM by Shrooblord »
Shrooblord



Bix

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    18
    • View Profile
Thanks for this mod, really, this is my number one favorite !

One thing bother me thought, the alphabetic sorting, it's either on the ship.name and not useful at all (for me) or on the ship.title and then can flicker if there's two or more from the same type.
Is it possible to sort by title and/then by name ?

a bit like this :
Code: [Select]
local sort_func = function( a,b ) return a.title.name < b.title.name end
table.sort(ShipData.Ships, sort_func)

But I don't think it would work, I have zero knowledge in coding.


edit :

OK ! I've found with some search !

Code: [Select]
local sort_func = function( a,b ) return (a.title < b.title) or (a.title == b.title and a.name < b.name) end
table.sort(ShipData.Ships, sort_func)

Now everything is fine :D
« Last Edit: July 17, 2018, 10:03:46 PM by Bix »



Delerium76

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    4
    • View Profile
Thanks for this mod, really, this is my number one favorite !

One thing bother me thought, the alphabetic sorting, it's either on the ship.name and not useful at all (for me) or on the ship.title and then can flicker if there's two or more from the same type.
Is it possible to sort by title and/then by name ?

a bit like this :
Code: [Select]
local sort_func = function( a,b ) return a.title.name < b.title.name end
table.sort(ShipData.Ships, sort_func)

But I don't think it would work, I have zero knowledge in coding.


edit :

OK ! I've found with some search !

Code: [Select]
local sort_func = function( a,b ) return (a.title < b.title) or (a.title == b.title and a.name < b.name) end
table.sort(ShipData.Ships, sort_func)

Now everything is fine :D


Looks great, but it would be nice if the stations were separated out with their own heading, like it does in the original mod with "Friendly ships" and "Civilian ships"



DracoNB

  • Jr. Member
  • **
  • Status:
    Offline
    Posts:
    76
    • View Profile
One more from me.

My friend wanted to know if I could add a "[!]" in front of the Stations' names for Stations that have a Bulletin active on their Bulletin Board, so you can in one glance see whether there are Bulletins available when you jump into a Sector.

The result is the attached file.

It includes all the previous changes, but now also overwrites the vanilla file data/scripts/entity/bulletinboard.lua. Will conflict with other mods that overwrite the same file.

Drag and drop the contents into your main Avorion folder.

----

EDIT:

And a bug report: the Persecutor Pirate teams that get spawned on you when you're weak in a certain part of the Galaxy are mislabelled as "Friendly Ships", even though relations with them are Abhorrent, with the "Friendly Threshold" set at 0.


----

Bug Report #2:

While piloting a Faction ship, the relations displayed are those of the ships towards the PLAYER, not towards the Faction. This is confusing behaviour.

Hah, I was actually going to make the stations one separate since the list can already get quite big. You could basically copy/paste the code and rename to it stations everywhere so that way you can place them in two locations and enable/disable as wanted. And yeah I noticed the Player not Faction coloring which is annoying. Meant to fix it but haven't been playing recently.



Bix

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    18
    • View Profile
Mhhh I tried your copy/paste method, but I think I broke everything ^^

-> https://pastebin.com/k494xDfx

The checkboxes are working, or displayed at least, I also have no error in server console, but there's nothing displayed on the UI...

Do someone have hints ?



DracoNB

  • Jr. Member
  • **
  • Status:
    Offline
    Posts:
    76
    • View Profile
Mhhh I tried your copy/paste method, but I think I broke everything ^^

-> https://pastebin.com/k494xDfx

The checkboxes are working, or displayed at least, I also have no error in server console, but there's nothing displayed on the UI...

Do someone have hints ?

You'll need to rename any "ShipNotifier" to "StationNotifier" or similar :)