28 Commits

Author SHA1 Message Date
OgelGames
5ad0a8c229
Use minetest.load_area everywhere (#287)
also change `technic.get_or_load_node` to return loaded node instead of nil
2022-10-31 12:40:17 +11:00
SX
99b9001319
Use switching station ref counters (#265)
* Use switching station ref counters

* Fix luacheck and switch supply/demand reporting

* Make switch_index local, fix switching station infotext

* Remove unnecessary variable
2022-05-04 14:58:20 +02:00
Jordan Leppert
c6e605ceec
Particle effect when quarry digs a node (#257)
* Magenta particle explosion effect when quarry digs a node

* Option to enable dig particle effects, disabled by default. Reduced particle count to 20.

* Changed dig particle effect - a particle starts in each of the 8 corners of the cube and move to the middle

* Only generate dig particles if network lag is < 35000

* Replaced quarry dig effect with a particle spawner - the node's particles stream towards the quarry, stopping just in front of it, like they're being sucked up.

* Simplifying dig particle vector maths using vector functions

* Fixing comment typo

* Dig particles now accelerate towards the quarry along a particular axis, causing them to approach the quarry in a curve. This also means they end inside the node in front of the quarry, which improves how the effect looks when digging deep down.

* Adding network to run_nodes call, using network passed through to check lag for quarry dig particles

* Missing local

* Missing local

* Using vector.new to copy a vector and make a 0,0,0 vector

* Update technic/machines/HV/quarry.lua

Co-authored-by: OgelGames <olliverdc28@gmail.com>

* Adding enable_quarry_dig_particles to README

* Renaming enable_quarry_dig_particles to quarry_dig_particles

* Reorganising quarry_dig_particles position in config list

* Missing comma

Co-authored-by: OgelGames <olliverdc28@gmail.com>
Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>
2022-01-20 15:38:06 +02:00
nixnoxus
a39a454c49
Move to MT 5.0.0+ translation system (#255)
* convert to `minetest.get_translator`

* fix material translation

* fix material translation

* Revert "fix material translation"

This reverts commit 35d0979d5828f481b6e53c04f20739983ba35087.

* update */locale/*

* `S("Chernobylite Block")`

* restore non-breaking spaces

* fix technic_chests/spec/api_spec.lua

* fix S(...)

* update technic/locale/

* update german translations

* fix placeholder `%s` in *.zh_CN.tr translations
2022-01-07 13:17:43 +01:00
SX
39d786918c Network code refactoring 2021-11-30 07:29:05 +02:00
SX
314d87b692 Remove duplicate function (#220)
Removed technic.sw_pos2network
2021-10-24 17:01:01 +03:00
SX
3fef85cab0 Add technic_on_disable callback (#592) (#207)
This adds a new callback to trigger when the machine is no longer powered by the technic power grid. Also allows mods to override the infotext if needed.

Co-authored-by: sfence <sfence.software@gmail.com>
2021-09-11 13:46:19 +03:00
SX
320f0b7351 Report all nodes count while building network (#152)
Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>
2021-02-05 18:28:09 +02:00
SX
5e78d73aa5 Merge networks tests + better queue handling 2020-12-09 01:49:50 +02:00
SX
f7b1f4394b Merge networks during build 2020-12-08 18:17:28 +02:00
SX
24f31d8158 Async network build, remove switch_max_range 2020-12-08 13:38:13 +02:00
SX
2958cf3fd1 (#108) Remove first 3 meta read loops 2020-11-21 18:35:34 +01:00
SX
968c64b415 Optimize machine run loops. Battery box reduce node swapping, simpler formspec, no stack splitting, default digiline channel empty (#113)
* Battery cable check is broken, always run batteries

* (#108 #112) Optimize run loops, reduce node swapping, simpler formspec, no stack splitting, default digiline channel empty

Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>
2020-11-05 14:50:07 +02:00
SX
6a777fbeb9 Use technic.conf for all technic mod settings, update admin commands, some cleanup, averages for network lag detection (#111)
* Configs to correct place, use moving average for net lag, improve admin commands

* Fix luacheck warnings

* Handle file paths, missing cfg file and Settings:set simlar way engine does

* Quarry and radiation settings to technic.conf

Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>
2020-11-05 12:39:49 +02:00
SX
7b658a4291 Do not add duplicates to PR_nodes when cable placed near SC 2020-10-31 04:43:37 +02:00
SX
d206956810 Destroy network if ref switch disappears, cleanup switching station code
Remove rest of SP_nodes from code, it does not contain anything

Reset switch infotext, export machine_tiers

Add tests for cable building between active networks

Remove all networks when cable is placed between networks

Fix SC connectivity issues
2020-10-31 04:43:16 +02:00
SX
bdf8d2e0cc Make default_timeout dynamic, remove power_monitor from machine group 2020-10-31 04:43:10 +02:00
SX
6bbe8e1da5 Fix SC/build/dig bugs, some cleanup 2020-10-31 04:43:10 +02:00
SX
8c5aca5856 Net building tests
Fix few cable place/dig issues

Tests for machine build/dig

Fix machine build/dig bugs

Fix test for machine building

Fix machines acting like cables when placed

Inline fixtures for building/digging tests

fix ignored luacheck warnings

(#105)

fix long lines

(#105)

Add more tests for bugs found

Fix tests, add minetest.get_us_time (implement using socket.gettime)
2020-10-31 04:42:24 +02:00
SX
16f0683c21 Network node placement, utilize locals for frequent names
(#95) Place/remove network nodes. Cleanup sw_pos

(#96) SC infotext / reduce timeout ABM workload
2020-10-31 04:41:45 +02:00
SX
c6aa02897b Network handles timeouts, remove second switch ABM 2020-10-31 04:38:45 +02:00
SX
11fe7a7bf7 Add machines to all_nodes, no holes in arrays, check if node is added already
Comment out debug prints

Network node place/dig, simple remove_network test

Luacheck warnings

Fix network check

Fix overridden global table
2020-10-31 04:38:21 +02:00
SX
193447ea20 Tests for network constructor
Cleanup network.lua

Add minetest vector.lua

Add tests for network constructor
2020-10-31 04:38:01 +02:00
SX
f66c644fce Remove metadata for supply,demand,battery_count,battery_charge,battery_charge_max
Remove switching station from networks

Disable few debug prints, add removed machines to LBM

clear_networks refatoring #95

Functions remove_network_node and add_network_branch #95

Fix undef network_id, remove flatten #95
2020-10-31 04:37:21 +02:00
SX
c08732cd87 Fix digiline event and luacheck warnings
Add fake get_modpath for busted
2020-10-31 04:37:12 +02:00
SX
a259576894 Network refactoring, proper multi switch support WIP
Update network utils, globalstep use networks, update switch ABM

Removing switching stations from network
2020-10-31 04:36:26 +02:00
SX
79233d764a Add busted unit testing for technic
Fix test framework and luacheck, Add metadata cleanup ABM

Added busted and contentdb badges
2020-10-31 04:35:35 +02:00
SX
7a4826e77d Move basic global network funcs to network.lua 2020-10-31 04:33:20 +02:00