05-08-2019, 10:15 PM
This is sort of a two for one patch.
Part 1:
https://github.com/goonstation/goonstati...6/pull/134
Part 1:
- Adds some new functionality to the sensor systems. When you open up the sensors browser window and display the names of the pods and drones near you, you can now click on the names and a little HUD object will appear around your pod pointing you towards your target.
- You can also lock onto target pods just by clicking on them.
- If someone locks onto your pod, a button pops up in the bottom right of your screen alerting you. At the present, it doesn't give you any more information than that. I was considering expanding it to let the user see how many pods are tracking it or what the names of them are but I dunno.
- Each sensor ship-component type has always a specific range for how far out they can scan for ships. Default is 30 tiles. You can track a target with the HUD object rotating around your pod and pointing at the target as long as you are in this range. If the target is further out, then the HUD element turns into a single flashing dot and will not rotate but retain it's angle around your pod where you lost track of it. If the target goes off your Z-level or is more than double your sensor range away from you, you will lose the signal completely.
- You can turn off your engine or run at less than 10% of your maximum power capacity (which is determined by your pod's engine), in order to shake the track. It will require people be 3 times closer than their max sensor range to stay locked onto you.
- Demo 1: https://streamable.com/nix1k (shows the main features)
- Demo 2: https://streamable.com/txwt7 (shows the tracking warning indicator and turning off power to lose trackers)
- Adds a new sprite for the Space GPS that works a lot more like how the nuke disk pinpointer and ID trackers currently work.
- Enter some coordinates (X,Y). And it will display an arrow pointing in the direction nearest to the target.
- GPS Video Demo: https://streamable.com/ohoos
- All new sprites are located in new_stuff.dmi and most of the code points to that location, but you will see changes to pod_HUD.dmi cause I couldn't be bothered to change it to that location everywhere. The GPS sprite should probably be placed in devices.dmi. And I have some alternates for the "Master Caution" warning sprite. Couldn't really get it great with a border I wanted so I just settled for what I had.
- Changed the var/list/shiplist in sensor.dm to var/list/obj/shiplist to make some things easier on the browser drawing, but the rest is really all additions instead of changes.
- The tracking loop in proc/track_target() I tried to keep real lightweight. The worst of it is the adjust_seekrange() proc call which has an istype check. I tried to be pretty clear about it.
- The dots HUD object gets a little wonky when it adjust to an angle that is more than a 30 or so degrees from it's last position. So it'll freak out if you're flying circles around eachother or you keep switching between two targets on either side of you. Don't know how to fix this without a good deal of effort so I'm leaving it.
https://github.com/goonstation/goonstati...6/pull/134