Search found 65 matches
- Sun Apr 26, 2020 11:12 pm
- Forum: Modding help
- Topic: Solved: Regular expression help
- Replies: 12
- Views: 3872
Re: Regular expression help
I just noticed, that LUA has no full RegEx implementation and both mine and Oktokolo's are not working. So i created one within the LUA playground: `^(.+)%-_%-.+`, this returns the same, as the first one in my last post: prefix = string.match(name, "^(.+)%-_%-.+") hover-car-0-_-driver => h...
- Sun Apr 26, 2020 7:39 pm
- Forum: Modding help
- Topic: Solved: Regular expression help
- Replies: 12
- Views: 3872
Re: Regular expression help
So, `.+?(?=-_)` would match everything until `-_`, so it will return hover-car-0-_-driver => hover-car-0 Dodge-Challenger-0-_-driver => Dodge-Challenger-0 Hauling-Truck-0-_-drive => Hauling-Truck-0 hcraft-entity-0-_-driver => hcraft-entity-0 car-vehicle-machine-gun-_-driver => car-vehicle-machine-gu...
- Fri Apr 24, 2020 10:16 pm
- Forum: Modding help
- Topic: Solved: Regular expression help
- Replies: 12
- Views: 3872
Re: Regular expression help
If you want to ignore the rest after the `-`, then `^[^-]+` is a way to do it. item_name = string.match("item-_-ghost", "^[^-]+") log(tostring(item_name)) item_name = string.match("item-0-_-driver", "^[^-]+") log(tostring(item_name)) This will print out `item`...
- Sun Apr 05, 2020 4:02 pm
- Forum: Modding interface requests
- Topic: Readd extra_padding_when_activated, with same functionality as margin/padding
- Replies: 0
- Views: 714
Readd extra_padding_when_activated, with same functionality as margin/padding
In version 9.18.13, the option `LuaStyle::extra_padding_when_activated` got removed. It would be great, if this gets readded, with the same functionality as LuaStyle::margin/LuaStyle::padding. padding :: int or array of int [Write-only] Sets top/right/bottom/left paddings to this value. An array wit...
- Fri Mar 06, 2020 1:38 am
- Forum: Releases
- Topic: Version 0.18.10
- Replies: 16
- Views: 16532
Re: Version 0.18.10
Since we know have access to `debug` with `--instrument-mod`. Can we also get access to change `package.cpath` and `package.path`, it would make creating a remote debugger so much more simple :) we've had access to `debug` all along it turns out, Instrument Mode is a whole other set of super-powers...
- Fri Mar 06, 2020 12:17 am
- Forum: Releases
- Topic: Version 0.18.10
- Replies: 16
- Views: 16532
Re: Version 0.18.10
Since we know have access to `debug` with `--instrument-mod`. Can we also get access to change `package.cpath` and `package.path`, it would make creating a remote debugger so much more simple :) we've had access to `debug` all along it turns out, Instrument Mode is a whole other set of super-powers...
- Thu Mar 05, 2020 11:38 pm
- Forum: Releases
- Topic: Version 0.18.10
- Replies: 16
- Views: 16532
Re: Version 0.18.10
Since we know have access to `debug` with `--instrument-mod`. Can we also get access to change `package.cpath` and `package.path`, it would make creating a remote debugger so much more simple
- Thu Feb 27, 2020 11:39 pm
- Forum: Development tools
- Topic: Code Completion for jetbrains IDEs
- Replies: 6
- Views: 6379
Re: Code Completion for jetbrains IDEs
These fixes where released a while ago, but i forgot to post it here
Update 1.2.2:
Fixed:- endless "Download Factorio LuaApi" on startup
- download of lualib and core prototypes failed
- Fri Jan 31, 2020 12:12 am
- Forum: Modding help
- Topic: What's wrong with my attempt to overwrite the attack sound?
- Replies: 2
- Views: 903
Re: What's wrong with my attempt to overwrite the attack sound?
You are trying to create a new prototype with data:extend. What you want to do, is override it. That is possible, by editing the data.raw table. https://wiki.factorio.com/Data.raw So, in your case: data.raw["utility-sounds"].default.alert_destroyed = { filename = "__CustomAttackSound_...
- Thu Jan 30, 2020 1:16 pm
- Forum: Modding help
- Topic: Detect a click on inventory screen (before craft)
- Replies: 10
- Views: 4119
Re: Detect a click on inventory screen (before craft)
I'm not sure, but the event `on_gui_click` could help.
But when you only want to disable handcrafting, you can type `/permissions` in the chat, to open the permissions tab and there you can remove the checkbox on "Craft" to disable Handcrafting.
But when you only want to disable handcrafting, you can type `/permissions` in the chat, to open the permissions tab and there you can remove the checkbox on "Craft" to disable Handcrafting.
- Wed Jan 29, 2020 1:41 pm
- Forum: Modding help
- Topic: [SOLVED]unexpected symbol near '='
- Replies: 6
- Views: 1967
Re: unexpected symbol near '='
data:extend() expects a table of tables of Prototypes: `data:extend({prot1, prot2}). In Lua you can use `{` instead of `(` to create a table as first parameter, so `data:extend{ }` equals `data:extend({ })`. In your case, you use `data:extend(prot)`, which is not correct. You can use: data:extend( {...
- Mon Jan 20, 2020 2:45 pm
- Forum: Development tools
- Topic: Code Completion for jetbrains IDEs
- Replies: 6
- Views: 6379
Re: Code Completion for jetbrains IDEs
Update 1.2.1:
Fixed:- Added missing log() and table_size() functions
- Defines-Table is now available again (was defined local)
- functions and variables inside base/core Prototype definitions are not shown in auto-completion anymore.
- Thu Jan 16, 2020 3:47 pm
- Forum: Development tools
- Topic: Code Completion for jetbrains IDEs
- Replies: 6
- Views: 6379
Re: Code Completion for jetbrains IDEs
Update 1.2.0: Added: Autocompletion for require statement. (autocompletes the path to lua files) Download the factorio lualib (https://github.com/wube/factorio-data/tree/master/core/lualib) Type infer is followed the require statements correctly to files. This is based on the two points above :) Au...
- Tue Jan 14, 2020 12:16 am
- Forum: Modding help
- Topic: changing a texture of a wall
- Replies: 4
- Views: 1813
Re: changing a texture of a wall
THis should be possible, with overriding the default texture with your own texture in the data stage: data.raw.wall["stone-wall"].pictures.single.layers[0].filename = "your-sd-sprite" data.raw.wall["stone-wall"].pictures.single.layers[0].hr_version.filename = "your...
- Wed Jan 08, 2020 1:59 am
- Forum: Not a bug
- Topic: [0.17.79] util table inside util.lua is global
- Replies: 1
- Views: 780
[0.17.79] util table inside util.lua is global
inside the `util.lua` file, the `util` table is defined global and later on returned to use in the files, where it is required from. For me, that makes no sence, it should be either a local table or not getting returned. Every other file in the lualib has local tables, that getting returned. Or dont...
- Sat Jan 04, 2020 12:44 pm
- Forum: Resolved Problems and Bugs
- Topic: [Rseding] [0.17.79] Script mismatch when migration contains require
- Replies: 3
- Views: 2904
Re: [0.17.79] Script mismatch when migration contains require
https://lua-api.factorio.com/latest/Libraries.html require() Due to the changes to package, the functionality of require() changes. When using absolute paths, the path starts at the mod root, additionally .. is disabled as a path variable. This means that it is not possible to load arbitrary files f...
- Fri Jan 03, 2020 6:11 pm
- Forum: Resolved Problems and Bugs
- Topic: [Rseding] [0.17.79] Script mismatch when migration contains require
- Replies: 3
- Views: 2904
[Rseding] [0.17.79] Script mismatch when migration contains require
As the title says, i noticed, that when adding a mod to a save, a `require` in migration scripts cause a multiplayer script-mismatch, when connecting to the server. Step by Step: download client and server create a new save without any mods add the mod attached to this bugreport start the server and...
- Fri Jan 03, 2020 5:21 pm
- Forum: Modding help
- Topic: Script mismatch when adding mod to existing save
- Replies: 9
- Views: 3215
Re: Script mismatch when adding mod to existing save
yep, you were correct, the migration files are the problem.
As soon as i have a `require` in one migration file, the script mismatch occurs.
That is definitely a bug inside factorio, i will create a bugreport for that. Thanks for the thoughts and the help
As soon as i have a `require` in one migration file, the script mismatch occurs.
That is definitely a bug inside factorio, i will create a bugreport for that. Thanks for the thoughts and the help
- Fri Jan 03, 2020 1:33 pm
- Forum: Modding help
- Topic: Script mismatch when adding mod to existing save
- Replies: 9
- Views: 3215
Re: Script mismatch when adding mod to existing save
Anybody has any idea, whats going on here?
And also that log output feels weird, like, the string concatenation is broken and not all information is printed
And also that log output feels weird, like, the string concatenation is broken and not all information is printed
- Mon Dec 30, 2019 11:46 am
- Forum: Development tools
- Topic: Code Completion for jetbrains IDEs
- Replies: 6
- Views: 6379
Re: Code Completion for jetbrains IDEs
Update 1.1.0: Added: JSON Schema for info.json Autocompletion for Prototypes (other autocompletion mostly deactivated) completion for prototype field (only names) completion for the type literal Compatibility with Jetbrains 2019.3 IDEs Update 1.1.1: Fixed: Global Variables where defined local