Skip to content

Commit

Permalink
Tweaks/bugfixes (#2)
Browse files Browse the repository at this point in the history
* Fix evolution progress bar not showing progress
* Fix accumulator name and enable by default in no-handcrafting
* Remove game log for player mined
* Add multiple item support for included chests in spawn area
* Add local build script to copy files to factorio scenario folder
* Update Readme
* Update Screenshots
* Add common lua commands reference
  • Loading branch information
deniszholob authored Jun 3, 2021
1 parent 649782a commit 424f322
Show file tree
Hide file tree
Showing 12 changed files with 254 additions and 92 deletions.
25 changes: 25 additions & 0 deletions .build-scripts/build-local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

FACTORIO_DIR="$APPDATA/Factorio/scenarios"
RELEASE_FILE_NAME="dddgamer-softmod-pack"

echo "===== Current dir:"
pwd # your-path-to-this-repository/factorio-softmod-pack
# ls -al

echo "Remove previous contents"
rm -rfv "$FACTORIO_DIR/$RELEASE_FILE_NAME"

# echo "===== Copy Repo folder..."
# Copies everything including dot files/folders
# cp -rfv "./" "$FACTORIO_DIR/$RELEASE_FILE_NAME"

echo "===== Copy Repo folder..."
# Make dir and tar/untar to copy contents without the dot file/folders
# https://stackoverflow.com/questions/2193584/copy-folder-recursively-excluding-some-folders
mkdir -p "$FACTORIO_DIR/$RELEASE_FILE_NAME"
tar cfv - --exclude=".[^/]*" . | (cd "$FACTORIO_DIR/$RELEASE_FILE_NAME" && tar xvf - )

echo "===== Copied folder contents:"
ls -al "$FACTORIO_DIR/$RELEASE_FILE_NAME"

10 changes: 10 additions & 0 deletions .build-scripts/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Build Scripts
Some scripts to automate testing code locally and packaging

## Local
* Copies code to Factorio scenarios folder so it can be tested
* Run `bash .build-scripts/build-local.sh`

## Build a Release
* Creates a zip of the code for user to extract into the Factorio scenario folder
* Run `bash .build-scripts/build-release.sh`
44 changes: 44 additions & 0 deletions .console-lua-commands.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
-- Reveal Map
/c
game.players[1].force.chart(
game.players[1].surface,
{
{game.players[1].position.x - 300, game.players[1].position.y - 300},
{game.players[1].position.x + 300, game.players[1].position.y + 300}
}
)

-- Set enemy evolution
/c
game.forces["enemy"].evolution_factor=0.5

-- Print technologies
/c
for i, tech in pairs(game.players[1].force.technologies) do
game.print(tech)
end

-- Write techs to a file
/c local list = {}
for _, tech in pairs(game.player.force.technologies) do
if tech.research_unit_count_formula then
list[#list+1] = tech.name .. '\t|\t' .. tech.level .. '\t|\t' .. tech.research_unit_count .. '\t|\t' .. tech.research_unit_count_formula .. '\t|\t' .. tech.research_unit_energy
end
end
game.write_file("techs.lua", serpent.block(list) .. "\n", true)

-- Unclock tech research
/c
game.players[1].force.technologies['mining-productivity-16'].researched=true

-- Print research ingredients
/c
game.print(serpent.block(game.players[1].force.technologies['mining-productivity-16'].research_unit_ingredients))


-- Set current research
/c game.players[1].force.current_research = "mining-productivity-16"




Binary file modified .screenshots/dddgamer-softmod.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .screenshots/dddgamer-softmod_game-info.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ If you found the pack or the source code useful, consider supporting me on Patre

### Add to an existing save
* Download the softmod pack zipped file (`dddgamer-softmod-pack.zip`) from the
[Latest Release]
[Latest Release](https://github.com/deniszholob/factorio-softmod-pack/releases/latest)
* Browse to the save file (.zip archive file)
* Local saves are in C:/Users/*[your-username]*/AppData/Roaming/Factorio/saves/
* Open your save game zip
Expand All @@ -36,6 +36,11 @@ If you found the pack or the source code useful, consider supporting me on Patre
## Dev
Some notes to help the dev process.

* Run the local build script to sync to factorio scenarios folder
* See [build-readme](./.build-scripts/readme.md) for more info
* See [common console commands](https://wiki.factorio.com/Console#Set_evolution_factor)
* See [Useful Factorio commands for testing](.console-lua-commands.lua)

**Notes:**
* Previous pack versions are saved on separate branches.
* This pack is not finalized, there are still some modules under development that are not listed in the `control.lua`
Expand All @@ -46,14 +51,19 @@ Dev files will be removed from the release build, see the [github repository](ht

```
.
├── .build-scripts/ <- Scripts for github/travis builds
├── .build-scripts/ <- Scripts for github/travis and local dev builds
├── .screenshots/ <- Screenshots for github
├── locale/ <- Translation strings
├── modules/ <- The actual softmod modules
├── stdlib/ <- Factorio "standard library" classes, main one being the Event
├── util/ <- Contains some utility classes like colors, math, styles.
├── .code-templates.md <- Some code snippets for development purposes.
├── .editorconfig <- Coding styles, see https://editorconfig.org/
├── .gitignore <- Ignore files from source control
├── .travis.yml <- Build pipeline config to create releases on github
├── config.lua <- Just creates a config global for now.
├── control.lua <- Entry file that loads all the other modules, configure what to load here.
├── LICENCE <- Repo licence file
└── README.MD <- This file
```
Expand Down
2 changes: 1 addition & 1 deletion control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ require('modules/common/floating-health')
-- require('modules/common/no-hand-crafting')
require('modules/common/custom-tech')


-- === Can cause problems in multiplayer === ---
-- require('modules/common/research-queue/auto-research')
-- require('modules/common/tasks') -- Has desync problems

Expand Down
3 changes: 1 addition & 2 deletions modules/common/evolution.lua
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,12 @@ function Evolution.fill_master_frame(container, player)
{
type = 'progressbar',
name = Evolution.EVOLUTION_PROGRESS_NAME,
style = 'achievement_progressbar',
tooltip = {"Evolution.master_frame_caption"},
value = 0.2
}
)
evo_progress_bar.style.width = 98
evo_progress_bar.style.height = 2
evo_progress_bar.style.height = 3
evo_progress_bar.style.top_margin = 14

GUI.element_apply_style(container, Styles.btn_menu)
Expand Down
4 changes: 2 additions & 2 deletions modules/common/no-hand-crafting.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ local NO_HAND_CRAFT_DEFAULT_SETTINGS = {
-- Gives steam engine instead of solar panel
useSteamInsteadOfSolar = false,
-- Adds an accumulator to be able to craft at night
addAccumulator = false
addAccumulator = true
}

-- Event Functions --
Expand Down Expand Up @@ -60,7 +60,7 @@ function addNoHandcraftKitItems(player)

-- Accumulators
if NO_HAND_CRAFT_DEFAULT_SETTINGS.addAccumulator then
player.insert {name = 'basic-accumulator', count = 1}
player.insert {name = 'accumulator', count = 1}
end
end

Expand Down
2 changes: 1 addition & 1 deletion modules/dddgamer/game-info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ local SECTION_CONTENT = {
title = '',
content = {
'* Gameplay: Vanilla with QOL Mods',
-- '* Gameplay: Handcrafting is disabled',
-- '* Gameplay: Handcrafting and Blueprints have been disabled',
-- '* NOTE: Handcrafting is Disabled!',
'* Chat with the [color=orange]`[/color] Key (Under the [color=orange]ESC[/color] Key)',
'* Join discord for discussion, voice chat and admin support:',
'https://discord.gg/PkyzXzz',
Expand Down
2 changes: 0 additions & 2 deletions modules/dddgamer/player-logging.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ end
function Player_Logging.on_player_mined_entity(event)
local player = game.players[event.player_index]
local entity = event.entity
game.print(event.entity.name)
game.print(entity.name)
if (
Time.new_player_threshold(player) and
not Player_Logging.entityFilter(entity)
Expand Down
Loading

0 comments on commit 424f322

Please sign in to comment.