MiX Bus Stops 0.2.0 (beta)
==========================

Free. It is in beta: rides are tested; the admin panel is still being tested.
Feedback and bug reports: discord.gg/MZCdmvFrQ, message B1.


What it does
------------
The bus stops along your map's roads become a fast-travel network.

- A driver stands at every bus stop on the map. Players walk up and talk to the driver
  (the normal "talk" prompt) to open a destination menu.
- The menu lists every other open bus stop plus any monuments the admin has opened as
  destinations, 12 to a page, each with its own icon.
- Monument destinations are chosen by the admin. Bus stops are open by default; monuments
  start closed, so nothing lands a player inside a monument until you decide it should.
- Every destination gets a safe landing spot, worked out by the plugin when it loads on a
  new map. A spot is rejected if it is:
    - in water, or underground
    - on top of a building or structure (more than 6 m above the ground below it)
    - somewhere a person cannot walk (no walkable ground), or without head room
      (inside rocks, trees or deployables)
    - in radiation (low-tier radiation is allowed by default, see the config)
    - inside someone's building privilege
    - within 60 m of a hostile NPC, turret or APC, or in their line of sight within 100 m
  Of the spots that pass, the one furthest from any threat wins, then the one closest to
  the stop or monument centre. Oil rigs land on the boat dock. A destination with no
  spot that passes is marked NO SAFE LANDING in the menu and cannot be ridden to. An admin can set a
  landing spot by hand, and a hand-set spot always wins.
- Countdown: after picking a destination the player waits 3 seconds. Moving more than
  2 m, or being hit by someone, cancels the ride.
- Fares: 10 scrap per ride by default. The fare item and amount are set in the admin
  panel, and each destination can have its own fare. If MixCommerce is installed you
  can charge from its wallet instead of an item.
- Combat block: a player who was in a fight with another player in the last 30 seconds
  cannot ride. Wounded, mounted or swimming players cannot ride either, and there is a
  60 second cooldown between rides.
- The ride is also refused if a hostile NPC is within 30 m of the landing right now, or
  if a hostile player would land in a safe zone.
- Arrival protection: for 8 seconds after waking up at the other end, the player takes
  no damage, NPCs and turrets ignore them, and nobody can loot them while they are
  still asleep. Attacking anyone ends the protection early.
- The drivers cannot be hurt, are not saved into the map save (so a restart never
  duplicates them), and turrets ignore them.


Install
-------
1. Copy plugins/MixBusStops.cs into carbon/plugins (Carbon) or oxide/plugins (Oxide).
2. Copy the data/MixBusStops folder into carbon/data (Carbon) or oxide/data (Oxide), so the
   pictures end up in carbon/data/MixBusStops/art.
3. The plugin loads by itself. Drivers appear at every bus stop within a second or two, and
   the safe landings are worked out over the next few seconds.

The pictures are optional: any picture that is missing is drawn in flat colours instead,
and the menus work while the pictures are still loading. To swap a picture, put a PNG with
the same file name in the same place and reload the plugin. data/MixBusStops/art/README.txt
has every file name and size.


Commands
--------
Chat
  /busadmin                          opens the admin panel (admins and mixbusstops.admin)
                                     STOPS: rename a stop, open or close it, change its fare,
                                       teleport there, set the landing spot where you stand
                                       or clear it
                                     DESTINATIONS: open or close monuments, set the landing
                                       spot where you stand, clear it, take a test ride
                                     SETTINGS: fare item and amount, wallet on or off,
                                       cooldown, countdown, protection and fight block times

Server console or RCON (or an admin's F1 console)
  mixbus.status [stops|dests]        drivers, open destinations, landings, hooks in use
  mixbus.rebuild                     re-places every driver and works the landings out again
  mixbus.dest <name> [on|off]        shows a destination, or opens or closes it
  mixbus.landing <name>              shows a destination's landing and why other spots
                                     were turned down
  mixbus.testride <player> <name> [check]
                                     sends an online player on a free test ride; with
                                     "check" it only runs the checks and moves nobody

Names can contain spaces, for example: mixbus.dest Launch Site on


Permission
----------
  mixbusstops.admin                  use /busadmin and the console commands in game
                                     (server admins can always use them)


Config highlights (carbon/configs/MixBusStops.json or oxide/config/MixBusStops.json)
-----------------------------------------------------------------------------------
  "Allow landings in low-tier radiation (blocked by any clothing)": true
      Some monuments have very large low-radiation zones that reach the roadside stops.
      Low-tier radiation is stopped by any clothing, so these spots are allowed by default.
      Set it to false to reject any radiation at all (a few stops may then have no landing).
  "Reject landings with a hostile NPC or turret within (m)": 60
  "Reject landings with a hostile NPC or turret in line of sight within (m)": 100
  "Refuse a ride when a hostile NPC is this close to the landing (m)": 30
  "Turrets ignore the drivers": true
  "Leave out monuments whose prefab path contains": ["power substations"]
      monuments that never show up in the destination list
  "Driver name", "Driver outfit", "Driver distance in front of the shelter (m)"

Fares, cooldown, countdown, protection and fight block times are set in the admin panel
and kept in data/MixBusStops/data.json.


Optional plugins (used only if installed)
-----------------------------------------
  MixCommerce    lets fares be paid from its wallet instead of an item
  MixGovern      a player who is raid blocked there cannot ride
Without them, fares are paid in the chosen item and nothing is raid blocked.


Tested on
---------
Carbon 2.0.258 on Rust build 25083359 (game version 2633.288.1), September 2026.
Rides to several destinations were tested in game on our own test server. The admin panel
is still being tested.

Oxide: not tested. The script compiles without Carbon's shims, but it has not been run on
an Oxide server yet. If you try it there, please tell us how it went.


Licence
-------
Free to run and change on your own servers. No resale, and no re-hosting anywhere except
directory.mixapps.store. See LICENCE.txt.
