Project

General

Profile

Actions

Feature #1490

open

Lua API: workers control

Added by Alexandr Ignatiev 8 days ago. Updated 5 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Scripting API
Target version:
Start date:
06/07/2025
Due date:
% Done:

0%

Estimated time:

Description

Since we have a function for manipulating specialists server-side, logically we could have API to place or remove workers:
  • (City):work_tile(Tile t, Specialist pref_spec?)
  • (City):work_tile(Tile t, Tile take_from)
  • (City):reclaim_worker(Tile t, Specialist pref_spec?)
  • (City):reclaim_all_workers()
  • (City):auto_arrange_workers()
  • (City):worked_iterate(bool center?)
  • (City):cma_controlled() -- this maybe could return cma name, see my 2.6 tweaked branch

This allows saving and restoring citizens state. Functions for pinning workers/switching CMA on and off/placing tasks/etc may be added later if needed

Actions #1

Updated by Marko Lindqvist 6 days ago

Alexandr Ignatiev wrote:

  • (City):cma_controlled() -- this maybe could return cma name, see my 2.6 tweaked branch

Is this client-side only, or do you mean to support server-side CMA with this? Server-side CMA is currently available for web-client only. Allowing regular clients to use it might cause bigger multiplayer games to burn too much server-side CPU when CMA of all cities of all players are handled on the server.

Actions #2

Updated by Alexandr Ignatiev 5 days ago

Marko Lindqvist wrote in #note-1:

Is this client-side only, or do you mean to support server-side CMA with this? Server-side CMA is currently available for web-client only. Allowing regular clients to use it might cause bigger multiplayer games to burn too much server-side CPU when CMA of all cities of all players are handled on the server.

I had a vision that CMA has in some moment migrated to servers. Well, if not, it should be a boolean property, maybe with :cma_name() method in clients. Maybe we should then have some special API for web servers?

Actions

Also available in: Atom PDF