Factorio: Added ability to chat from within the game. (#1068)

* Factorio: Added ability to chat from within the game.
This also allows using commands such as !hint from within the game.

* Factorio: Only prepend player names to chat in multiplayer.

* Factorio: Mirror chat sent from the FactorioClient UI to the Factorio server.

* Factorio: Remove local coordinates from outgoing chat.

* Factorio: Added setting to disable bridging chat out.
Added client command to toggle this setting at run-time.

* Factorio: Added in-game command to toggle chat bridging setting at run-time.

* .

* Factorio: Document toggle for chat bridging feature.

* (Removed superfluous type annotations.)

* (Removed hard to read regex.)

* Docs/Factorio: Fix display of multiline code snippets.
This commit is contained in:
recklesscoder
2022-10-28 00:45:26 +02:00
committed by GitHub
parent 924f484be0
commit cfff12d8d7
5 changed files with 76 additions and 13 deletions

View File

@@ -157,6 +157,7 @@ function on_player_created(event)
{%- if silo == 2 %}
check_spawn_silo(game.players[event.player_index].force)
{%- endif %}
dumpInfo(player.force)
end
script.on_event(defines.events.on_player_created, on_player_created)
@@ -491,6 +492,7 @@ commands.add_command("ap-sync", "Used by the Archipelago client to get progress
["death_link"] = DEATH_LINK,
["energy"] = chain_lookup(forcedata, "energy"),
["energy_bridges"] = chain_lookup(forcedata, "energy_bridges"),
["multiplayer"] = #game.players > 1,
}
for tech_name, tech in pairs(force.technologies) do
@@ -600,5 +602,9 @@ commands.add_command("toggle-ap-send-filter", "Toggle filtering of item sends th
log("Player command toggle-ap-send-filter") -- notifies client
end)
commands.add_command("toggle-ap-chat", "Toggle sending of chat messages from players on the Factorio server to Archipelago.", function(call)
log("Player command toggle-ap-chat") -- notifies client
end)
-- data
progressive_technologies = {{ dict_to_lua(progressive_technology_table) }}

View File

@@ -132,6 +132,8 @@ This allows you to host your own Factorio game.
For additional client features, issue the `/help` command in the Archipelago Client. Once connected to the AP server,
you can also issue the `!help` command to learn about additional commands like `!hint`.
For more information about the commands you can use, see the [Commands Guide](/tutorial/Archipelago/commands/en) and
[Other Settings](#other-settings).
## Allowing Other People to Join Your Game
@@ -148,10 +150,20 @@ you can also issue the `!help` command to learn about additional commands like `
- Type `/toggle-ap-send-filter` in-game
- Type `/toggle_send_filter` in the Archipelago Client
- In your `host.yaml` set
```
factorio_options:
filter_item_sends: true
```
```
factorio_options:
filter_item_sends: true
```
- By default, in-game chat is bridged to Archipelago. If you prefer to be able to speak privately, you can disable this
feature by doing one of the following:
- Type `/toggle-ap-chat` in-game
- Type `/toggle_chat` in the Archipelago Client
- In your `host.yaml` set
```
factorio_options:
bridge_chat_out: false
```
Note that this will also disable `!` commands from within the game, and that it will not affect incoming chat.
## Troubleshooting
@@ -159,13 +171,6 @@ In case any problems should occur, the Archipelago Client will create a file `Fa
contents of this file may help you troubleshoot an issue on your own and is vital for requesting help from other people
in Archipelago.
## Commands in game
Once you have connected to the server successfully using the Archipelago Factorio Client you should see a message
stating you can get help using Archipelago commands by typing `!help`. Commands cannot currently be sent from within
the Factorio session, but you can send them from the Archipelago Factorio Client. For more information about the commands
you can use see the [commands guide](/tutorial/Archipelago/commands/en).
## Additional Resources
- Alternate Tutorial by