[PAM]-E.L.A. - Path Auto Miner Exclusive Local Area
Фото и видео: 1 из 4. Материалы автора из Steam Workshop.
О материале
«[PAM]-E.L.A. - Path Auto Miner Exclusive Local Area» — материал мастерской Space Engineers. Моды, чертежи кораблей, скрипты и миры для Space Engineers. Данные Steam, описание автора и ссылка для установки через подписку. Совместимость редакцией не проверена.
Описание автора
Version
1.0.0 (2019-11-08)
- Initial release
- Fully functional as intended
Motivation
Having found the great [PAM] script by Keks, you'll probably end up controlling a lot of drones and let them do all the dirty mining work. But a growing fleet needs more and more planning. The drone paths must not cross, otherwise they will crash into each other. Although this is pretty unlikely, with greater fleet and having them running in the background all the time, this will eventually happen. In open space crossings can be avoided, but you have to remember all the paths and plan well ahead. In a narrow hangar situation crossing can probably not be avoided and an additional solution is needed. This is why the idea of an additional utility script was born.
Idea
The basic idea for this utility script is using already existing PAM functionality to do some more automated drone management. There already is a PAM-Controller that can send commands to multiple drones from a central control station or via programmable block (PB) arguments. Now PAM-ELA will send commands to PAM-Controller via it's PB, the controller then sends those commands via antenna to the drones. The hangar is considered as an exlusive resource, where only one drone is allowed to move in and all other drones have to stop and wait for the first to leave. Leaving can either mean flying away or dock to a connector. The area itself is defined by sensors, that can deliver the information who is inside.
Requiremens
- You need the PAM script
- One PAM-Controller is needed to command drones (see PAM guide for setup).
- All drones must use PAM and broadcast to that controller.
- Drones' broadcast-name must equal the grid-name.
- A sensor is needed to detect drones entering the exclusive area.
Setup
Get the [PAM]-E.L.A. script and install it to a PB on your station (or where your hangar is).
You need a PAM-Controller running in its own PB on the same station. If your PAM-Controller has the default tag [PAM-Controller], PAM-ELA will find it. Otherwise (if you have multiple PAM-Controllers managing separate fleets) set your custom tag in the head section of the PAM-ELA script:
const string controllerTag = "[PAM-Controller]";
If you have multiple PAM-Controllers for separate fleets and each has its own hangar you will need one PAM-ELA per PAM-Controller and use unique tags so they can be assigned. If you just have multiple hangars for one large fleet, you'll need one PAM-Controller only, but one PAM-ELA per hangar.
Set up a sensor in your hangar. The area should cover the hangar and some outside area. If your hangar has doors, you probably have such a sensor already which can be used for PAM-ELA. Tag this sensor with [PAM-ELA] or a custom tag defined in the script:
const string sensorTag = "[PAM-ELA]";
If your hangar is larger than a sensor can cover, you just can add more sensors. The logic combines them to one large exclusive area. The additional ones probably don't run the hangar door. The sensor must be configured to detect ships (size depends on your drones) but NOT detect subgrids. A drone will be considered a subgrid after connection, and the sensor should consider the area to be free then.
The list of requests to enter the area can be shown on any LCD panel tagged with [PAM-ELA]. Using indexed text sufaces like on the PB or in a cockpit is also possible, the tag therefor has to look like [PAM-ELA:#] with # being the text surface index starting at 1. For a custom tag change this line in the script header:
const string panelTag = "[PAM-ELA]";
There is always only one active drone allowed to move in the exclusive area. Other drones will be sent the STOP command via the PAM-Controller. When a stopped drone becomes top of the reuqest list, it will be activated via the CONT command. If it does not react and free the area (maybe because the job was done), after minutes it will be sent CONT again every minute. After minutes however, it will be sent the HOMEPOS command, finally clearing the area. You can confugure this in these lines:
const int resendContAfter = 1; // minutes const int sendHomeAfter = 3; // minutes
PAM-ELA will keep the script usage at a minimum. This includes not scanning the grid for new tagged blocks every now and then. If you change anything PAM-ELA related just recompile the script in its PB.
Please check if your drones are correctly configured. Check your PAM-Controller's PB for its custom data settings and note the <Broadcast_Channel> name. Now check every drone's PB (running PAM) for its custom data. Make sure broadcasting is enabled and the channel name is the same (basic PAM-Controller setup so far, for any help on this refer to the PAM guide). Now additionally for PAM-ELA to run properly, in the drone's PB custom data, you also have to check that the <Ship_Name> setting matches the drone's grid name. The sensor only detects the grid name, but the PAM-Controller only sends commands to this custom name, so they have to match.
Enable_Broadcast=true Ship_Name= Broadcast_Channel=#
When you record the paths for your drones keep in mind that PAM-ELA now allows for crossings inside the exlusive area. But still every drone needs its own space where it enters or leaves the area. If the area is occupied it will stop and wait there and you don't want other approaching drones to run into it.
Limitations
PAM offers the commands STOP to halt and CONT to resume drones. But CONT does not exactly mean to continue what the drone was just doing at STOP. If the drone was sent home having its job not completed, it may get stopped by PAM-ELA and then send the CONT command to resume. Instead of the expected moving home CONT does tell the drone to go to job area and resume mining. If the drone did move home because its job was done, it has nothing to do on CONT and so will just hang around. To handle this, PAM-ELA notices when a drone takes too long to free the area and send CONT again and after 3 minutes send HOMEPOS. So this situation is solved eventually but it may take some time. It does work if the drone came home for a reason like being full or having low energy, it will notice that condition on CONT and temporarily move home then.
Как установить и запустить
Откройте оригинальную страницу в Steam Workshop, проверьте версию игры, зависимости и порядок загрузки в описании автора. Нажмите «Подписаться» и дождитесь загрузки Steam. Включите материал в меню модификаций или контента игры, если это требуется. Совместимость и запуск редакцией не проверены.