Giter VIP home page Giter VIP logo

edmchits's Introduction

HITS - Hostile Interaction Tracking System

(c) 3303 CMDR Ian Norton [NULL]

HITS is EDMC Plugin that gives risk assessments for ship safety upon jumping into a star system.

The Plugin integrates with your built-in Remlok display system. It currently supports the Windowed and Borderless mode but not yet the "FullScreen" mode when using the "Windows" model of Remlok.

Demo

HITS Video

Installation

Before installing HITS you must install EDMCOverlay from https://github.com/inorton/EDMCOverlay/releases/

This is easy, you can simply download the HITS-1.0.0.msi from the github releases tab and run the installer.

Command Mode

HITS can also respond to text inpit. Simply type "!location" to get the HITS risk report for your current system.

Configuration

By default HITS will contact the HITS server and obtain a traffic report, if you only want to use the graphical overlay you can set "Traffic Reports (on/off)" to "off" and HITS will stop checking for traffic but will still run the overlay server.

Overlay

HITS depends on the EDMCOverlay plugin, be sure to install that first

Overlay API

If you are writing your own plugin and wish to display using the HITS (EDMCOverlay) visual overlay, you can use our handy python client. edmcoverlay.py You should copy the file into your own plugin and make simple calls from there.

Display Model

Each thing you want to display is best thought of as an actor, each actor is referred to by an ID you choose.

You tell each actor to be a shape, line or text, if you tell actor "hud" to be a square first, then later be only text the actor will change, the square will dissapear and be replaced with text.

Each actor will stay on the screen for a short period of time (the TTL) and will automatically vanish when this timer reaches zero.

You control what to render by using the Overlay class.

from edmcoverlay import Overlay

client = Overlay()

The above will create a client object. All graphics (actors) created using this client will exist in your own private namespace. Other plugins won't be able to mess with your graphics (but they can probably paint over them)

def say_hello():
    client.send_message(
      msgid="hello-message",
      text="Hello Commander!",
      color="#ff0000",
      size="normal",
      x=200,
      y=200,
      ttl=10)

The above will display red text saying "Hello Commander!" at 200, 200 for 10 seconds. If you call this code again before 10 seconds has passed, it will reset the TTL to 10 again.

Colors

The overlay server understands HTML color codes and a few simple names (red, green, blue, yellow) etc.

Text Size

The overlay server understands only "normal" and "large" as text sizes.

Raw Graphic API

The overlay server can display more complex graphics, you can render simple rectangles or more complex polygons using a vector shape

def draw_rectangle():
    client.send_raw({
      "id": "my-rectangle",
      "color": "yellow",
      "fill": "green",
      "shape": "rect",
      "ttl": 20
      "x": 100,
      "y": 400,
      "h": 100,
      "w": 300
    })

The above will draw a 300x100 yellow edged, green filled rectangle at 100,400 with a ttl of 20

def draw_triangle():
    client.send_raw({
      "id": "my-triangle",
      "color": "blue",
      "shape": "vect",
      "ttl": 10,
      "vector": [
        {
          "x": 100,
          "y": 200,
          "marker": "cross",
          "color": "red",
          "text": "hello"
        },
        {
          "x": 190,
          "y": 240
        },
        {
          "x": 270,
          "y": 480,
          "marker": "circle",
          "color": "green"
        },
        {
          "x": 100,
          "y": 200
        } 
      ]
    })

The above should draw a hollow triangle with blue lines, one corner will have a red "x" and the text "hello", another corner will have a green circle.

edmchits's People

Contributors

inorton avatar seldonlabs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

edmchits's Issues

Full Screen Support

We only support windowed and borderless mode at current.

Fullscreen mode will require dll injection.. is rather tricky

EDMCOverlay2/Linux Support?

I discovered HITS earlier today whilst cantering through EDMC's plugins page, and I'm surprised that I missed it before; I really like the way it looks, and indeed how blends into the style of Elite itself. Attempting to run it under Linux (after running the .msi and copying out the result), however, results in the following error:

2021-06-08 13:59:59.388 - INFO - 62386:140004381419328:62386 <plugins>.edmcoverlay._edmcoverlay._Overlay.__init__:37: edmcoverlay2: hiiiiiii
2021-06-08 13:59:59.388 - DEBUG - 62386:140004381419328:62386 <plugins>.edmcoverlay._edmcoverlay._Overlay.__init__:42: edmcoverlay2: init
2021-06-08 13:59:59.388 - INFO - 62386:140004256904768:62401 <plugins>.edmcoverlay._edmcoverlay._Overlay.__server:95: edmcoverlay2: server running
2021-06-08 13:59:59.388 - DEBUG - 62386:140004381419328:62386 <plugins>.edmcoverlay._edmcoverlay.edmcoverlay._edmcoverlay:210: edmcoverlay2: overlay class instantiated
2021-06-08 13:59:59.388 - DEBUG - 62386:140004381419328:62386 <plugins>.edmcoverlay.load.plugin_edmcoverlay:21: edmcoverlay2: got lib: <module 'edmcoverlay' from '/home/bradleyr/.local/share/EDMarketConnector/plugins/edmcoverlay/__init__.py'>
2021-06-08 13:59:59.389 - DEBUG - 62386:140004381419328:62386 <plugins>.edmcoverlay.load.plugin_edmcoverlay:23: edmcoverlay2: got internal lib: <module 'edmcoverlay._edmcoverlay' from '/home/bradleyr/.local/share/EDMarketConnector/plugins/edmcoverlay/_edmcoverlay.py'>
2021-06-08 13:59:59.389 - INFO - 62386:140004381419328:62386 <plugins>.edmcoverlay.load.plugin_start3:66: edmcoverlay2: plugin start!
2021-06-08 13:59:59.389 - INFO - 62386:140004381419328:62386 plug.Plugin.__init__:46: loading plugin "cargo-manifest-2_1_0" from "/home/bradleyr/.local/share/EDMarketConnector/plugins/cargo-manifest-2.1.0/load.py"
2021-06-08 13:59:59.794 - INFO - 62386:140004381419328:62386 plug.Plugin.__init__:46: loading plugin "FuelStatus" from "/home/bradleyr/.local/share/EDMarketConnector/plugins/FuelStatus/load.py"
2021-06-08 13:59:59.794 - DEBUG - 62386:140004381419328:62386 <plugins>.FuelStatus.load.plugin_start3:22: fuelstatus plugin loaded
2021-06-08 13:59:59.794 - INFO - 62386:140004381419328:62386 plug.Plugin.__init__:46: loading plugin "HITS" from "/home/bradleyr/.local/share/EDMarketConnector/plugins/HITS/load.py"
2021-06-08 13:59:59.796 - ERROR - 62386:140004381419328:62386 plug.Plugin.__init__:61: : Failed for Plugin "HITS"
Traceback (most recent call last):
  File "/home/bradleyr/Games (NVME)/Utilities/Elite Dangerous/EDMarketConnector/plug.py", line 52, in __init__
    newname = module.plugin_start3(os.path.dirname(loadfile))
  File "/home/bradleyr/.local/share/EDMarketConnector/plugins/HITS/load.py", line 43, in plugin_start3
    plugin_start()
  File "/home/bradleyr/.local/share/EDMarketConnector/plugins/HITS/load.py", line 53, in plugin_start
    _overlay = edmcoverlay.Overlay()
AttributeError: 'NoneType' object has no attribute 'Overlay'
2021-06-08 13:59:59.797 - ERROR - 62386:140004381419328:62386 plug.load_plugins:158: Failure loading found Plugin "HITS"
Traceback (most recent call last):
  File "/home/bradleyr/Games (NVME)/Utilities/Elite Dangerous/EDMarketConnector/plug.py", line 156, in load_plugins
    found.append(Plugin(name, os.path.join(config.plugin_dir_path, name, 'load.py'), plugin_logger))
  File "/home/bradleyr/Games (NVME)/Utilities/Elite Dangerous/EDMarketConnector/plug.py", line 52, in __init__
    newname = module.plugin_start3(os.path.dirname(loadfile))
  File "/home/bradleyr/.local/share/EDMarketConnector/plugins/HITS/load.py", line 43, in plugin_start3
    plugin_start()
  File "/home/bradleyr/.local/share/EDMarketConnector/plugins/HITS/load.py", line 53, in plugin_start
    _overlay = edmcoverlay.Overlay()
AttributeError: 'NoneType' object has no attribute 'Overlay'

I use EDMCOverlay2 for overlay functionality on Linux so can understand that HITS would be unlikely to work out of the box, but presuming it uses much of the same resources as it's Windows equivalent (EDMCOverlay2 'aims to be 100% compatible with EDMC Overlay'), is there anything that can be done to get it working?

Change of report for no traffic

I've notice out in the black that on no traffic available it errors out, any chance this could be a non descriptive response something like 'No ships passed through this system' instead please.

Python 3.x support

Hi, I'm the new maintainer for EDMC itself. I intend to move releases over to Python 3.7 sometime in the next 1-2 weeks. As such your users who upgrade EDMC will see your plugin stop working at that point.

I'm first looking at adding some code to the upcoming final Python 2.7-based release of EDMC to detect plugins that don't yet have a plugin_start3() method and alert the user. So your users will start getting that alert when I release (what is planned to be) 3.4.6.0 / 3.46.

If you check EDMC Available Plugins I can tell you that at least 'Habitable Zone' has already updated, so you could use it as a reference. Several others have as well, including dual Python 2.7/3.7 support.

CG activity not reported

I noticed during a recent CG that HITS was reporting zero activity in the CG location which struck me as odd, so I was wondering whether or not information is being submitted to the server anymore.

Support for getting statistics on a commander profile

I'd like the ability to message !stats to another commander and then EDMCHits would respond with the number of players that the commander to whom the message was sent has been logged as killing in HITS.

I'm happy to contribute the changes to the load.py file, but it looks like it would require a new response be supported by the edmc.edhits.space:8080 in order to enable something like this to work.

Would you be open to this idea?

Unable to activate this plugin?

I've extracted HITS and EDMCOverlay-master into EDMC Plugins directory but I don't get anything when jumping between systems.

They are both shown as enabled Plugins in the settings menu for EDMC.

Server address is: edmc.edhits.space:8080

The game is running on the Primary monitor of a 3 monitor setup and is running in Borderless mode.

What am I doing wrong?

Are the commands for HITS still working?

It appears to be that whenever I input the !location+the name of any given system it no longer shows me on the EDMC overlay the given xyz system status of ships passed safely and destroyed alike. Am I missing something? Thanks for your feedback :)

Broken yellow box

I see when I scan a target I see this orange box with a few lines in it I assume its broken or is it supposed to just show that?
image

EDMCOverlay exception: There are no context policies.

I had HITS working for a day but now I have this exception with EDMCOverlay.exe:

2018-01-06T23:22:23 OverlayRenderer: Loading fonts..
2018-01-06T23:22:23 OverlayJsonServer: JSON server thread startup
2018-01-06T23:22:23 EDMCOverlay: unhandled exception!!: Name:EDMCOverlay.exe
There are no context policies.
 System.UnhandledExceptionEventArgs
2018-01-06T23:22:23 EDMCOverlay:    at System.Diagnostics.ProcessManager.OpenProcess(Int32 processId, Int32 access, Boolean throwIfExited)
   at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited)
   at System.Diagnostics.Process.get_HasExited()
   at EDMCOverlay.OverlayRenderer.StartUpdate()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

Suggestion to Add a Github Topic

Github has a tags feature that I've found to be quite useful for finding repos related to Elite Dangerous. I noticed that this one might benefit from adding the elite-dangerous tag. Github calls them topics and says: To associate your repository with the elite-dangerous topic, visit your repo's landing page and select "manage topics." I'm very glad I found this fun project, and hope this would help others to do so as well.

<roadmap> Underworld Database

  • Tag ships when you encounter them by sending a tracking worm over comms.
    Possibly make use of a combination of commander history data and a chat command "!tag"
  • Auto-report ships that attack you

Support for running on second computer over network.

Feature request (Asking humbly and politely)
I run EDMC on a separate computer, giving it access to necessary journal/log files over the network.
In fact, I run almost all my 3rd party apps on a second computer.

Any chance for added functionality allowing HITS to run on a second computer together with EDMC.
Would require a warning window rather than an overlay to display HITS messages.

(If this somehow is already possible, I have missed it)

<server> !location is case sensitive

If I jump to a system the plugin works fine, as well as if I simply type !location in chat, however if I try (for example) !location Ceos or !location Alioth the plugin doesn't ever display anything in response.

Also would you consider aliasing !location as !loc?

Would like to edit this so the text is center screen on a 5760 x 1080 setup.

Greetings,

As I see there is still fairly recent activity on this hopefully asking in here might save me a lot of time digging through the code to find that for which I'm seeking.

I play E:D on a triple 1920 x 1080 setup. (running as a single 5760 x 1080 monitor) Hence, the text displayed from the overlay places it on my left side. I would like it centered as it should be.

I'm sure I just need to add 1920 to somewhere in the setup file, but I'm not finding it right away. I'm not a coder, even if I've done a fair bit of scripting in my day.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.