Search found 48 matches

by asdff45
Thu Jun 25, 2020 12:38 am
Forum: Modding help
Topic: scenario scripts and areas
Replies: 3
Views: 93

Re: scenario scripts and areas

As far as i understand it: An scenario is an advanced mod. For scripts, to run, you have to create a control.lua file and in there you can program whatever you want to do. Wikipage about Scenarios: https://wiki.factorio.com/Scenario_system The `control.lua` Events, your interested in: Startup script...
by asdff45
Fri May 29, 2020 12:56 am
Forum: Modding help
Topic: incompatibility setting info.json
Replies: 5
Views: 134

Re: incompatibility setting info.json

You use `! creative-mod >= 1.4.1` to mark the incompatible with creative-mod. This means, every creative-mod that has a higher version than 1.4.1 is incompatible. You have creative-mod 1.4.0 installed, so it is compatible. Completely agree. That is exactly my point: Why is it marked incompatible? S...
by asdff45
Thu May 28, 2020 7:45 pm
Forum: Modding help
Topic: incompatibility setting info.json
Replies: 5
Views: 134

Re: incompatibility setting info.json

You use `! creative-mod >= 1.4.1` to mark the incompatible with creative-mod. This means, every creative-mod that has a higher version than 1.4.1 is incompatible. You have creative-mod 1.4.0 installed, so it is compatible. If you want to be completely incompatible with every creative-mod, just write...
by asdff45
Sun Apr 26, 2020 11:12 pm
Forum: Modding help
Topic: Solved: Regular expression help
Replies: 12
Views: 419

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 => hover-car-0...
by asdff45
Sun Apr 26, 2020 7:39 pm
Forum: Modding help
Topic: Solved: Regular expression help
Replies: 12
Views: 419

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...
by asdff45
Fri Apr 24, 2020 10:16 pm
Forum: Modding help
Topic: Solved: Regular expression help
Replies: 12
Views: 419

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` in both cases. To clarify how it works:...
by asdff45
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: 82

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...
by asdff45
Fri Mar 06, 2020 1:38 am
Forum: Releases
Topic: Version 0.18.10
Replies: 16
Views: 9499

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...
by asdff45
Fri Mar 06, 2020 12:17 am
Forum: Releases
Topic: Version 0.18.10
Replies: 16
Views: 9499

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...
by asdff45
Thu Mar 05, 2020 11:38 pm
Forum: Releases
Topic: Version 0.18.10
Replies: 16
Views: 9499

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 :)
by asdff45
Thu Feb 27, 2020 11:39 pm
Forum: Development-Tools
Topic: Code Completion for jetbrains IDEs
Replies: 5
Views: 1030

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
by asdff45
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: 147

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__/sound/alert-d...
by asdff45
Thu Jan 30, 2020 1:16 pm
Forum: Modding help
Topic: Detect a click on inventory screen (before craft)
Replies: 10
Views: 382

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.
by asdff45
Wed Jan 29, 2020 1:41 pm
Forum: Modding help
Topic: [SOLVED]unexpected symbol near '='
Replies: 6
Views: 241

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( {...
by asdff45
Mon Jan 20, 2020 2:45 pm
Forum: Development-Tools
Topic: Code Completion for jetbrains IDEs
Replies: 5
Views: 1030

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.
by asdff45
Thu Jan 16, 2020 3:47 pm
Forum: Development-Tools
Topic: Code Completion for jetbrains IDEs
Replies: 5
Views: 1030

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...
by asdff45
Tue Jan 14, 2020 12:16 am
Forum: Modding help
Topic: changing a texture of a wall
Replies: 4
Views: 223

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-hr-sprite" data.raw.wall["stone-wa...
by asdff45
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: 168

[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...
by asdff45
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: 692

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...
by asdff45
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: 692

[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...

Go to advanced search