Bodyguard Companion Drones


Enhanced Companion Drones with Bodyguard behavior mode. Drones prioritize following and protecting the player. Everything is controlled from one in-game panel: attack/construction/mining modes, behaviour mode, speed, follow distance, threat radius and the mining zone - no console commands needed. Rocket-based area combat. Based on Companion Drones 2.0 by MrJakobLaich.

Content
9 days ago
2.0 - 2.1
885
Combat
Owner:
hoang0109
Source:
N/A
Homepage:
N/A
License:
GNU GPLv3
Created:
1 year, 6 days ago
Latest Version:
2.2.0 (9 days ago)
Factorio version:
2.0 - 2.1
Downloaded by:
885 users

Bodyguard Companion Drones — 2.2.0 (Bản cập nhật lớn)

QUAN TRỌNG: Bản 2.2.0 được tái xây dựng trên codebase mới (companion-drones-gadgetroch fork, Factorio 2.1).
KHÔNG tương thích save của các bản 2.1.x trở xuống — vui lòng tạo save mới sau khi cập nhật.


Có gì mới trong 2.2.0 (so với 2.1.1 trên Mod Portal)

1. Vũ khí SMG (mới)

  • Súng đạn vật lý bắn liên thanh: tầm 18, cooldown 0.1s, sát thương 20 × 1.6, tiếng súng thật + vỏ đạn văng.
  • Chọn vũ khí trong Mod settings → Startup → "Drone Weapon Type": smg (mặc định) hoặc laser.
  • Đổi setting + load lại save: vũ khí đã lắp trong drone tự chuyển đổi theo lựa chọn.
  • SMG cũng là item craft được (recipe riêng), và với grid 10x10 bạn có thể trộn cả laser + SMG trên cùng drone.
  • Thông số phỏng theo mod smg-equipment của RedRafe (GNU GPLv3).

2. Grid thiết bị 10x10 (mới)

  • Nâng từ 10x2 (5 equipment) lên 10x10 (25 equipment 2x2).
  • Tự do lắp khiên, lò phản ứng, roboport, vũ khí — "thích để gì thì để".

3. Máu drone tùy chỉnh (mới)

  • Setting "Drone Max Health": mặc định 1000 (cũ: 250 cứng), chỉnh được 250–10000.

4. Trạm robot làm việc rộng hơn (mới)

  • MK2: vùng làm việc 128x128 (cũ 16x16), 69 robot, 4 trạm sạc.
  • MK3: vùng làm việc 256x256 (cũ 24x24), 100 robot.

5. Codebase mới ổn định hơn

  • Logic AI escort/xây dựng/chiến đấu kế thừa từ gadgetroch fork: chống giật, chống mất drone, xử lý tốt surface/force thay đổi.
  • Fix can_attack luôn false (trước đây drone không bao giờ chủ động đi săn mục tiêu — nay có).
  • Fix crash Factorio 2.1: prototype.max_healthget_max_health(), spill_item_stack dạng bảng.
  • Fix lỗi vòng khai thác không biến mất khi tắt (API rendering 2.x) + tự dọn vòng "mồ côi" trong save.
  • Bỏ popup "MAJOR MOD UPDATE DETECTED!" — không còn thông báo update khi load save.

Tính năng giữ nguyên từ bodyguard

Chế độ Khai thác (Mining)

  • Bật/tắt: phím ALT+M, nút shortcut trên thanh, hoặc nút trong bảng điều khiển.
  • Vùng khai thác neo tại chỗ bạn đứng khi bật (vòng tròn xanh, bán kính mặc định 10 — chỉnh trong bảng điều khiển).
  • Drone tự đào quặng / chặt cây / đập đá / bắt cá trong vùng; item bay thẳng vào inventory người chơi (tràn thì rơi tại chỗ).
  • Tự dừng khi: có địch trong vùng quét, hoặc bạn rời vùng quá xa — an toàn thì tự tiếp tục.
  • Tắt chế độ: vòng tròn biến mất ngay, drone trở về hộ tống.

Bảng điều khiển Companion (trong game)

  • Mở: nút drone màu xanh trên thanh shortcut hoặc lệnh /companion_config.
  • Nội dung:
  • 3 nút chế độ (tấn công / xây dựng / khai thác) — sáng = đang bật.
  • Slider tốc độ drone (0.5x–3x).
  • Mục Khai thác (hiện khi chế độ bật): khoảng cách min/max, bán kính vùng, góc + checkbox chọn loại tài nguyên (quặng/cây/đá/cá).
  • Trạng thái: số drone đang hoạt động.
  • Công cụ: Reset companions / Reschedule.

Remote API công khai (giữ từ bản cũ)

  • bodyguard-companion-apiget_companion_entities(player_index)
  • bodyguard-companion-speedset_factor(v) / get_factor()

Lệnh console

Lệnh Tác dụng
/companion Cấp drone mới (hữu ích khi vào server giữa chừng)
/companion_config Mở/tắt bảng điều khiển
/reset_companions Reset drone về trạng thái sạch (sửa khi kẹt)
/reschedule_companions Buộc drone kiểm tra lại công việc

Mod settings đáng chú ý

  • Startup: Drone Weapon Type (laser/smg), Drone Max Health, Set Mode (0 normal / 1 challenge / 2 forgiving / 3 combined), Companion Update Interval.
  • Per player: khoảng cách/góc khai thác mặc định, bán kính quét mối đe dọa, hiện thông báo quan trọng, tốc độ nói chuyện idle.

Credits

  • Mod gốc & logic lõi: Klonan → hồi sinh bởi kubiixx, MrJakobLaich, duy trì bởi Maoman
  • Codebase 2.2.0: fork của Gadgetroch (companion-drones-gadgetroch)
  • Thông số vũ khí SMG: mod smg-equipment của RedRafe (GNU GPLv3) — https://mods.factorio.com/mod/smg-equipment
  • Tổng hợp & phát triển bản bodyguard: Hoang0109

---

Bodyguard Companion Drones — 2.2.0 (English)

IMPORTANT: Version 2.2.0 is rebuilt on a new codebase (companion-drones-gadgetroch fork, Factorio 2.1).
NOT compatible with saves from 2.1.x or older — please start a new save after updating.


What's new in 2.2.0 (compared to 2.1.1 on the Mod Portal)

1. SMG weapon (new)

  • Rapid-fire ballistic gun: range 18, 0.1s cooldown, 20 × 1.6 damage, real gunshot sounds + flying shell casings.
  • Choose in Mod settings → Startup → "Drone Weapon Type": smg (default) or laser.
  • Change the setting + reload the save: weapons already installed in drones are converted automatically.
  • The SMG is also a craftable item, and with the 10x10 grid you can even mix laser + SMG on the same drone.
  • Parameters adapted from the smg-equipment mod by RedRafe (GNU GPLv3).

2. 10x10 equipment grid (new)

  • Upgraded from 10x2 (5 equipment slots) to 10x10 (25 slots of 2x2 equipment).
  • Freely install shields, reactors, roboports and weapons — whatever you like.

3. Adjustable drone health (new)

  • "Drone Max Health" setting: default 1000 (was hardcoded 250), adjustable 250–10000.

4. Much larger roboport working area (new)

  • MK2: 128x128 working area (was 16x16), 69 robots, 4 charging stations.
  • MK3: 256x256 working area (was 24x24), 100 robots.

5. More stable codebase

  • Escort/construction/combat AI inherited from the gadgetroch fork: anti-jitter, anti-lost-drone, proper surface/force change handling.
  • Fixed can_attack always being false — drones now proactively hunt targets instead of only counter-attacking.
  • Fixed Factorio 2.1 crashes: prototype.max_healthget_max_health(), table-form spill_item_stack.
  • Fixed the mining circle not disappearing when the mode is toggled off (2.x rendering API) + automatic cleanup of orphan circles left in saves.
  • Removed the "MAJOR MOD UPDATE DETECTED!" popup — no more update popup on save load.

Features kept from bodyguard

Mining mode

  • Toggle: ALT+M, the shortcut-bar button, or the button in the control panel.
  • The mining zone is anchored where you stand when enabled (blue circle, default radius 10 — adjustable in the panel).
  • Drones automatically mine ore / chop trees / break rocks / catch fish inside the zone; items go straight into the player's inventory (spilled on the ground if full).
  • Automatically pauses when enemies enter the scan zone or you wander too far from the zone — resumes when it is safe again.
  • Toggle off: the circle disappears immediately and drones return to escort duty.

Companion control panel (in-game)

  • Open: the blue drone button on the shortcut bar, or /companion_config.
  • Contents:
  • 3 mode buttons (attack / construction / mining) — lit = enabled.
  • Speed slider for drones (0.5x–3x).
  • Mining section (visible while mining mode is on): min/max distance, zone radius, angle + resource-type checkboxes (ore/trees/rocks/fish).
  • Status: active companion count.
  • Tools: Reset companions / Reschedule.

Public remote API (kept from the old mod)

  • bodyguard-companion-apiget_companion_entities(player_index)
  • bodyguard-companion-speedset_factor(v) / get_factor()

Console commands

Command Purpose
/companion Grant a fresh drone (useful when joining a server mid-game)
/companion_config Open/close the control panel
/reset_companions Reset your drone(s) to a clean state (fixes stuck drones)
/reschedule_companions Force all drones to re-check for available work

Notable mod settings

  • Startup: Drone Weapon Type (laser/smg), Drone Max Health, Set Mode (0 normal / 1 challenge / 2 forgiving / 3 combined), Companion Update Interval.
  • Per player: default mining distances/angle, threat scan radius, show important messages, idle chatter delay.

Credits

  • Original mod & core logic: Klonan → revived by kubiixx, MrJakobLaich, maintained by Maoman
  • 2.2.0 codebase: Gadgetroch fork (companion-drones-gadgetroch)
  • SMG weapon parameters adapted from smg-equipment by RedRafe (GNU GPLv3) — https://mods.factorio.com/mod/smg-equipment
  • Bodyguard integration & development: Hoang0109