Skip to content

Commit 7e06bfe

Browse files
committed
Merge branch 'release/5.9.0'
2 parents abab40f + 4753922 commit 7e06bfe

630 files changed

Lines changed: 116370 additions & 25877 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ All are welcome to make pull requests and issues for this scenario, if you are i
5656

5757
| Scenario Version* | Version Name | Factorio Version** |
5858
|---|---|---|
59-
| [v5.7][s5.8] | Home and Chat Bot | [v0.17.47][f0.17.49] |
59+
| [v5.9][s5.9] | Control Modules and Documentation | [v0.17.63][f0.17.63] |
60+
| [v5.8][s5.8] | Home and Chat Bot | [v0.17.47][f0.17.49] |
6061
| [v5.7][s5.7] | Warp System | [v0.17.47][f0.17.47] |
6162
| [v5.6][s5.6] | Information Guis | [v0.17.44][f0.17.44] |
6263
| [v5.5][s5.5] | Gui System | [v0.17.43][f0.17.43] |
@@ -75,6 +76,7 @@ All are welcome to make pull requests and issues for this scenario, if you are i
7576

7677
\*\* Factorio versions show the version they were made for, often the minimum requirement.
7778

79+
[s5.9]: https://github.com/explosivegaming/scenario/releases/tag/5.9.0
7880
[s5.8]: https://github.com/explosivegaming/scenario/releases/tag/5.8.0
7981
[s5.7]: https://github.com/explosivegaming/scenario/releases/tag/5.7.0
8082
[s5.6]: https://github.com/explosivegaming/scenario/releases/tag/5.6.0
@@ -90,6 +92,7 @@ All are welcome to make pull requests and issues for this scenario, if you are i
9092
[s1.0]: https://github.com/explosivegaming/scenario/releases/tag/v1.0
9193
[s0.1]: https://github.com/explosivegaming/scenario/releases/tag/v0.1
9294

95+
[f0.17.63]: https://wiki.factorio.com/Version_history/0.17.0#0.17.63
9396
[f0.17.49]: https://wiki.factorio.com/Version_history/0.17.0#0.17.49
9497
[f0.17.47]: https://wiki.factorio.com/Version_history/0.17.0#0.17.47
9598
[f0.17.44]: https://wiki.factorio.com/Version_history/0.17.0#0.17.44

config/_file_loader.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
--- This contains a list of all files that will be loaded and the order they are loaded in
2-
-- to stop a file from loading add "--" in front of it, remove the "--" to have the file be loaded
3-
-- config files should be loaded after all modules are loaded
4-
-- core files should be required by modules and not be present in this list
1+
--- This contains a list of all files that will be loaded and the order they are loaded in;
2+
-- to stop a file from loading add "--" in front of it, remove the "--" to have the file be loaded;
3+
-- config files should be loaded after all modules are loaded;
4+
-- core files should be required by modules and not be present in this list;
5+
-- @config File-Loader
56
return {
67
--'example.file_not_loaded',
78
'modules.factorio-control', -- base factorio free play scenario

config/action_buttons.lua

Lines changed: 41 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
--- Config for the different action buttons that show on the player list
2-
-- each button has the button define(s) given along side an auth function, and optional reason callback
3-
-- if a reason callback is used then Store.set(action_name_store,player.name,'BUTTON_NAME') should be called during on_click
4-
-- buttons can be removed from the gui by commenting them out of the config at the bottom of this file
5-
-- the key used for the name of the button is the permision name used by the role system
6-
local Gui = require 'expcore.gui'
7-
local Roles = require 'expcore.roles'
8-
local Store = require 'expcore.store'
9-
local Game = require 'utils.game'
10-
local Reports = require 'modules.addons.reports-control'
11-
local Warnings = require 'modules.addons.warnings-control'
12-
local Jail = require 'modules.addons.jail-control'
13-
local Colors = require 'resources.color_presets'
14-
local format_chat_player_name = ext_require('expcore.common','format_chat_player_name')
1+
--- Config for the different action buttons that show on the player list;
2+
-- each button has the button define(s) given along side an auth function, and optional reason callback;
3+
-- if a reason callback is used then Store.set(action_name_store,player.name,'BUTTON_NAME') should be called during on_click;
4+
-- buttons can be removed from the gui by commenting them out of the config at the bottom of this file;
5+
-- the key used for the name of the button is the permission name used by the role system;
6+
-- @config Player-List
7+
8+
local Gui = require 'expcore.gui' --- @dep expcore.gui
9+
local Roles = require 'expcore.roles' --- @dep expcore.roles
10+
local Store = require 'expcore.store' --- @dep expcore.store
11+
local Game = require 'utils.game' --- @dep utils.game
12+
local Reports = require 'modules.control.reports' --- @dep modules.control.reports
13+
local Warnings = require 'modules.control.warnings' --- @dep modules.control.warnings
14+
local Jail = require 'modules.control.jail' --- @dep modules.control.jail
15+
local Colors = require 'resources.color_presets' --- @dep resources.color_presets
16+
local format_chat_player_name = ext_require('expcore.common','format_chat_player_name') --- @dep expcore.common
1517

1618
local action_player_store = 'gui.left.player-list.action-player'
1719
local action_name_store = 'gui.left.player-list.action-name'
@@ -50,7 +52,8 @@ local function teleport(from_player,to_player)
5052
return true
5153
end
5254

53-
-- teleports the user to the action player
55+
--- Teleports the user to the action player
56+
-- @element goto_player
5457
local goto_player =
5558
Gui.new_button()
5659
:set_sprites('utility/export')
@@ -66,7 +69,8 @@ Gui.new_button()
6669
end
6770
end)
6871

69-
-- teleports the action player to the user
72+
--- Teleports the action player to the user
73+
-- @element bring_player
7074
local bring_player =
7175
Gui.new_button()
7276
:set_sprites('utility/import')
@@ -82,7 +86,8 @@ Gui.new_button()
8286
end
8387
end)
8488

85-
-- kills the action player, if there are alive
89+
--- Kills the action player, if there are alive
90+
-- @element kill_player
8691
local kill_player =
8792
Gui.new_button()
8893
:set_sprites('utility/too_far')
@@ -98,15 +103,16 @@ Gui.new_button()
98103
end
99104
end)
100105

101-
-- reports the action player, requires a reason to be given
106+
--- Reports the action player, requires a reason to be given
107+
-- @element report_player
102108
local report_player =
103109
Gui.new_button()
104110
:set_sprites('utility/spawn_flag')
105111
:set_tooltip{'player-list.report-player'}
106112
:set_style('tool_button',tool_button_style)
107113
:on_click(function(player,element)
108114
local action_player_name = get_action_player_name(player)
109-
if Reports.player_is_reported_by(action_player_name,player.name) then
115+
if Reports.is_reported(action_player_name,player.name) then
110116
player.print({'expcom-report.already-reported'},Colors.orange_red)
111117
else
112118
Store.set(action_name_store,player.name,'command/report')
@@ -118,10 +124,11 @@ local function report_player_callback(player,reason)
118124
local by_player_name_color = format_chat_player_name(player)
119125
game.print{'expcom-report.non-admin',action_player_name_color,reason}
120126
Roles.print_to_roles_higher('Trainee',{'expcom-report.admin',action_player_name_color,by_player_name_color,reason})
121-
Reports.report_player(action_player_name,reason,player.name)
127+
Reports.report_player(action_player_name,player.name,reason)
122128
end
123129

124-
-- gives the action player a warning, requires a reason
130+
--- Gives the action player a warning, requires a reason
131+
-- @element warn_player
125132
local warn_player =
126133
Gui.new_button()
127134
:set_sprites('utility/spawn_flag')
@@ -135,18 +142,19 @@ local function warn_player_callback(player,reason)
135142
local action_player_name,action_player_name_color = get_action_player_name(player)
136143
local by_player_name_color = format_chat_player_name(player)
137144
game.print{'expcom-warnings.received',action_player_name_color,by_player_name_color,reason}
138-
Warnings.add_warnings(action_player_name,player.name)
145+
Warnings.add_warning(action_player_name,player.name,reason)
139146
end
140147

141-
-- jails the action player, requires a reason
148+
--- Jails the action player, requires a reason
149+
-- @element jail_player
142150
local jail_player =
143151
Gui.new_button()
144152
:set_sprites('utility/item_editor_icon')
145153
:set_tooltip{'player-list.jail-player'}
146154
:set_style('tool_button',tool_button_style)
147155
:on_click(function(player,element)
148156
local action_player_name,action_player_name_color = get_action_player_name(player)
149-
if Roles.player_has_role(action_player_name,'Jail') then
157+
if Jail.is_jailed(action_player_name) then
150158
player.print({'expcom-jail.already-jailed',action_player_name_color},Colors.orange_red)
151159
else
152160
Store.set(action_name_store,player.name,'command/jail')
@@ -157,18 +165,19 @@ local function jail_player_callback(player,reason)
157165
local action_player_name,action_player_name_color = get_action_player_name(player)
158166
local by_player_name_color = format_chat_player_name(player)
159167
game.print{'expcom-jail.give',action_player_name_color,by_player_name_color,reason}
160-
Jail.jail_player(action_player_name,player.name)
168+
Jail.jail_player(action_player_name,player.name,reason)
161169
end
162170

163-
-- temp bans the action player, requires a reason
171+
--- Temp bans the action player, requires a reason
172+
-- @element temp_ban_player
164173
local temp_ban_player =
165174
Gui.new_button()
166175
:set_sprites('utility/clock')
167176
:set_tooltip{'player-list.temp-ban-player'}
168177
:set_style('tool_button',tool_button_style)
169178
:on_click(function(player,element)
170179
local action_player_name,action_player_name_color = get_action_player_name(player)
171-
if Roles.player_has_role(action_player_name,'Jail') then
180+
if Jail.is_jailed(action_player_name) then
172181
player.print({'expcom-jail.already-banned',action_player_name_color},Colors.orange_red)
173182
else
174183
Store.set(action_name_store,player.name,'command/temp-ban')
@@ -182,7 +191,8 @@ local function temp_ban_player_callback(player,reason)
182191
Jail.temp_ban_player(action_player,player.name,reason)
183192
end
184193

185-
-- kicks the action player, requires a reason
194+
--- Kicks the action player, requires a reason
195+
-- @element kick_player
186196
local kick_player =
187197
Gui.new_button()
188198
:set_sprites('utility/warning_icon')
@@ -197,7 +207,8 @@ local function kick_player_callback(player,reason)
197207
game.kick_player(action_player,reason)
198208
end
199209

200-
-- bans the action player, requires a reason
210+
--- Bans the action player, requires a reason
211+
-- @element ban_player
201212
local ban_player =
202213
Gui.new_button()
203214
:set_sprites('utility/danger_icon')
@@ -235,7 +246,7 @@ return {
235246
if not Roles.player_allowed(player,'command/give-warning') then
236247
return not Roles.player_has_flag(action_player,'report-immune')
237248
end
238-
end, -- can report any player that isnt immune and you arnt able to give warnings
249+
end, -- can report any player that isn't immune and you aren't able to give warnings
239250
reason_callback=report_player_callback,
240251
report_player
241252
},

config/advanced_start.lua

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
--- This file is used to setup the map starting settings and the items players will start with
2+
-- @config Advanced-Start
23

34
--- These are called factories because they return another function
45
-- use these as a simple methods of adding new items
@@ -61,14 +62,14 @@ end
6162
]]
6263

6364
return {
64-
skip_intro=true, -- skips the intro given in the default factorio free play scenario
65-
skip_victory=true, -- will skip the victory screen when a rocket is launched
66-
disable_base_game_silo_script=true, -- will not load the silo script at all
67-
research_queue_from_start=true, -- when true the research queue is useible from the start
68-
friendly_fire=false, -- weather players will be able to attack each other on the same force
69-
enemy_expansion=false, -- a catch all for in case the map settings file fails to load
70-
chart_radius=10*32, -- the number of tiles that will be charted when the map starts
71-
items = { -- items and there condition for being given
65+
skip_intro=true, --- @setting skip_intro skips the intro given in the default factorio free play scenario
66+
skip_victory=true, --- @setting skip_victory will skip the victory screen when a rocket is launched
67+
disable_base_game_silo_script=true, --- @setting disable_base_game_silo_script will not load the silo script at all
68+
research_queue_from_start=true, --- @setting research_queue_from_start when true the research queue is useible from the start
69+
friendly_fire=false, --- @setting friendly_fire weather players will be able to attack each other on the same force
70+
enemy_expansion=false, --- @setting enemy_expansion a catch all for in case the map settings file fails to load
71+
chart_radius=10*32, --- @setting chart_radius the number of tiles that will be charted when the map starts
72+
items = { --- @setting items items and there condition for being given
7273
-- ['item-name'] = function(amount_made,production_stats,player) return <Number> end -- 0 means no items given
7374
-- Plates
7475
['iron-plate']=scale_amount_made(100,10,10),

config/bonuses.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
--- Lists all bonuses which can be used, name followed by min max
2+
-- @config Bonuses
3+
24
return {
35
character_mining_speed_modifier={0,3},
46
character_crafting_speed_modifier={0,3},

config/chat_reply.lua

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
--- This file defines the different triggers for the chat bot
2-
local format_time = ext_require('expcore.common','format_time')
2+
-- @config Chat-Reply
3+
4+
local format_time = ext_require('expcore.common','format_time') --- @dep expcore.common
5+
36
return {
4-
allow_command_prefix_for_messages = true, -- when true any message trigger will print to all player when prefixed
5-
messages = { -- will trigger when ever the word is said
7+
allow_command_prefix_for_messages = true, --- @setting allow_command_prefix_for_messages when true any message trigger will print to all player when prefixed
8+
messages = { --- @setting messages will trigger when ever the word is said
69
['discord']={'info.discord'},
710
['expgaming']={'info.website'},
811
['website']={'info.website'},
@@ -39,13 +42,13 @@ return {
3942
return {'chat-bot.map-time',format_time(game.tick,{days=true,hours=true,minutes=true,seconds=true,long=true})}
4043
end,
4144
},
42-
command_admin_only = false, -- when true will only allow chat commands for admins
43-
command_permission = 'command/chat-bot', -- the permision used to allow command prefixs
44-
command_prefix = '!', -- prefix used for commands below and to print to all players (if enabled above)
45-
commands = { -- will trigger only when command prefix is given
45+
command_admin_only = false, --- @setting command_admin_only when true will only allow chat commands for admins
46+
command_permission = 'command/chat-bot', --- @setting command_permission the permission used to allow command prefixes
47+
command_prefix = '!', --- @setting command_prefix prefix used for commands below and to print to all players (if enabled above)
48+
commands = { --- @setting commands will trigger only when command prefix is given
4649
['dev']={'chat-bot.not-real-dev'},
4750
['blame']=function(player)
48-
local names = {'Cooldude2606','arty714','badgamernl',player.name}
51+
local names = {'Cooldude2606','arty714','badgamernl', 'mark9064', 'aldldl', 'Drahc_pro',player.name}
4952
for _,next_player in pairs(game.connected_players) do
5053
names[#names + 1] = next_player.name
5154
end

config/compilatron.lua

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
-- config file for the compliatrons including where they spawn and what messages they show
1+
--- Config file for the compliatrons including where they spawn and what messages they show
2+
-- @config Compilatron
3+
24
return {
3-
message_cycle=60*15, -- 15 seconds default, how often (in ticks) the messages will cycle
4-
locations={ -- defines the spawn locations for all compilatrons
5+
message_cycle=60*15, --- @setting message_cycle 15 seconds default, how often (in ticks) the messages will cycle
6+
locations={ --- @setting locations defines the spawn locations for all compilatrons
57
['Spawn']={x=0,y=0}
68
},
7-
messages={ -- the messages that each one will say, must be same name as its location
9+
messages={ --- @setting messages the messages that each one will say, must be same name as its location
810
['Spawn']={
911
{'info.website'},
1012
{'info.read-readme'},

config/death_logger.lua

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
--- This config controls what happens when a player dies mostly about map markers and item collection
2-
-- allow_teleport_to_body_command and allow_collect_bodies_command can be over ridden if command_auth_runtime_disable is present
1+
--- This config controls what happens when a player dies mostly about map markers and item collection;
2+
-- allow_teleport_to_body_command and allow_collect_bodies_command can be over ridden if command_auth_runtime_disable is present;
33
-- if not present then the commands will not be loaded into the game
4+
-- @config Death-Logger
5+
46
return {
5-
--allow_teleport_to_body_command=false, -- allows use of /return-to-body which teleports you to your last death
6-
--allow_collect_bodies_command=false, -- allows use of /collect-body which returns all your items to you and removes the body
7-
use_chests_as_bodies=false, -- weather items should be moved into a chest when a player dies
8-
auto_collect_bodies=true, -- enables items being returned to the spawn point in chests upon corpse expiring
9-
show_map_markers=true, -- shows markers on the map where bodies are
10-
include_time_of_death=true, -- weather to include the time of death on the map marker
11-
map_icon=nil -- the icon that the map marker shows; nil means no icon; format as a SingleID
7+
--WIP_allow_teleport_to_body_command=false, -- allows use of /return-to-body which teleports you to your last death
8+
--WIP_allow_collect_bodies_command=false, -- allows use of /collect-body which returns all your items to you and removes the body
9+
use_chests_as_bodies=false, --- @setting use_chests_as_bodies weather items should be moved into a chest when a player dies
10+
auto_collect_bodies=true, --- @setting auto_collect_bodies enables items being returned to the spawn point in chests upon corpse expiring
11+
show_map_markers=true, --- @setting show_map_markers shows markers on the map where bodies are
12+
include_time_of_death=true, --- @setting include_time_of_death weather to include the time of death on the map marker
13+
map_icon=nil --- @setting map_icon the icon that the map marker shows; nil means no icon; format as a SingleID
1214
}

config/discord_alerts.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
--- Config file used to enable and disable different push messages for discord
2+
-- @config Discord-Alerts
3+
24
return {
35
player_reports=true,
46
player_warnings=true,

config/expcore-commands/auth_admin.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
--- This is a very simple config file which adds a admin only auth function
2-
-- not much to change here its more so it can be enabled and disabled from ./config/file_loader.lua
1+
--- This is a very simple config file which adds a admin only auth functio;
2+
-- not much to change here its more so it can be enabled and disabled from ./config/file_loader.lua;
33
-- either way you can change the requirements to be "admin" if you wanted to
4-
local Commands = require 'expcore.commands'
4+
-- @config Commands-Auth-Admin
5+
6+
local Commands = require 'expcore.commands' --- @dep expcore.commands
57

68
Commands.add_authenticator(function(player,command,tags,reject)
79
if tags.admin_only then

0 commit comments

Comments
 (0)