Search found 21 matches

by Rafiz
Sat Jan 01, 2022 7:21 pm
Forum: Ideas and Suggestions
Topic: Add capital/tool/something like that to recipe.
Replies: 7
Views: 446

Add capital/tool/something like that to recipe.

TL;DR Game could provide API for items that are needed to craft something, but don't get used in process. What ? I thought kovarex process and some modded recipes could benefit from that suggestion being implemented. Right now - 40 U-235 needs to be ingredient in Kovarex provess and it returns 41 U...
by Rafiz
Thu Dec 30, 2021 1:03 pm
Forum: Modding help
Topic: [Fixed] Adding data: to game
Replies: 4
Views: 320

Re: Adding technology to game

Typo! data:extend( { recile_lube, should be recipe_lube. That's strange that nothing crashed. I guess data:extend just accepts nil and ends adding elements from table once it gots to nil. I would rather expect it to ... if not crash everything, then at least continue checking next elements. Data:ext...
by Rafiz
Thu Dec 30, 2021 10:19 am
Forum: Modding help
Topic: [Fixed] Adding data: to game
Replies: 4
Views: 320

[Fixed] Adding data: to game

There's part of code in my mod : https://pastebin.com/8j7sGeA4 (whole file : https://pastebin.com/Sw9V7nzk) In this part of code I define technology and add it to game. But it is nowhere to be found, I just ... don't have it in game. Here's log from game : https://pastebin.com/cWfQiLjR my mod loads ...
by Rafiz
Wed Dec 15, 2021 11:01 am
Forum: Modding help
Topic: LuaEntityPrototype doesn't contain key air_resistance.
Replies: 4
Views: 325

Re: LuaEntityPrototype doesn't contain key air_resistance.

Actually, version must (indeed) be the problem! I'm using 1.1.33 My big mistake, for looking at newest stable API. I actually must change mod requirement to be >=1.1.34 I got fooled that this mod was working previously (on 1.1.33), but control.lua must have been omitted somehow in my previous mod ed...
by Rafiz
Wed Dec 15, 2021 6:29 am
Forum: Modding help
Topic: LuaEntityPrototype doesn't contain key air_resistance.
Replies: 4
Views: 325

LuaEntityPrototype doesn't contain key air_resistance.

But it should, right? In docs of LuaEntityPrototype it says LuaEntityPrototype has key air_resistance, that is either double value or nil. my (kind of messy) mod control file. mod from mod portal isn't in newest(this) form https://pastebin.com/5HcnzQzz (as side note, line 47 prints that we are deali...
by Rafiz
Thu Aug 05, 2021 1:03 pm
Forum: Ideas and Requests For Mods
Topic: Simpler, less taxing fluids
Replies: 2
Views: 529

Re: Simpler, less taxing fluids

That's quite interesting in my opinion... Pipes and stuff could be empty, all fluids entering those turn into virtual fluids... Imo it sounds not impossible. I wonder if factorio API gives access to (fluid system contents) and (flush fluid system contents) this + manually adding fluids where needed ...
by Rafiz
Thu Aug 05, 2021 12:31 pm
Forum: Modding discussion
Topic: Supporting the creation of mods that are incompatible with the base mod
Replies: 2
Views: 5840

Re: Supporting the creation of mods that are incompatible with the base mod

I'm very happy about that :) I was one day wondering why can't you turn base mod off, like in some other games, but this will be "some" way to do so.
by Rafiz
Wed Aug 04, 2021 8:49 pm
Forum: Modding help
Topic: Can I check pending events? Can I make on_tick function run last and not first?
Replies: 5
Views: 637

Re: Can I check pending events? Can I make on_tick function run last and not first?

Thanks for detailed response. As for controlling train speed precisely, it's really minor problem for me, *actual* speed is always wrong by very small amount, but acceleration and friction forces are way more convincing and that's what I only care about. If I replaced fuel power modifiers with zero'...
by Rafiz
Wed Aug 04, 2021 5:44 pm
Forum: Modding help
Topic: Can I check pending events? Can I make on_tick function run last and not first?
Replies: 5
Views: 637

Re: Can I check pending events? Can I make on_tick function run last and not first?

But when I try to use on_train_changed_state, somehow _on_tick gets fired first anyway. Maybe it's bug? Because specific event should always happen before timed events. //edit : changed screenshot, previous wasnt showing enough code. https://imgur.com/a/br4dVFk here's proof -> I mean proof that on_t...
by Rafiz
Wed Aug 04, 2021 5:21 pm
Forum: Modding help
Topic: Can I check pending events? Can I make on_tick function run last and not first?
Replies: 5
Views: 637

Can I check pending events? Can I make on_tick function run last and not first?

I have two functions : script.on_event({defines.events.on_train_changed_state},__train_changed_state) script.on_event({defines.events.on_tick},__on_tick) I must know if train changed state before on tick, because if it changed state, I stop train, but function __on_tick is always firing before __tra...
by Rafiz
Sun Aug 01, 2021 12:24 pm
Forum: Modding help
Topic: How to know if locomotive is trying to accelerate in manual control?
Replies: 2
Views: 288

Re: How to know if locomotive is trying to accelerate in manual control?

Edit : I found this one : https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.riding_state it's even better. Oh, it works very well! so I can now know if automatic triain tries to accelerate with (train.state == defines.train_state.on_the_path) and I can know if player train tries to accelera...
by Rafiz
Sun Aug 01, 2021 11:34 am
Forum: Modding help
Topic: How to know if locomotive is trying to accelerate in manual control?
Replies: 2
Views: 288

How to know if locomotive is trying to accelerate in manual control?

I mean, there is "unreliable" method to check if train was moving and if it is moving now. But the problem is with for example 40 wagons this method won't work. It will think train is not trying to accelerate, because game will change train speed from 0 to 0. How do I reliably know if trai...
by Rafiz
Sun Aug 01, 2021 10:27 am
Forum: Modding help
Topic: How to access Vehicle acceleration power?
Replies: 2
Views: 340

Re: How to access Vehicle acceleration power?

max_energy usage will work exactly same as my [code]local LuaEntity = surface.get_trains()[...x...].locomotives["..."][1]; LuaEntity.max_energy_usage [/code]. I already tried it, and it didn't worked really. It returned 10'000 for every locomotive type. Doesn't matter what it's power was,...
by Rafiz
Sun Aug 01, 2021 2:50 am
Forum: Modding help
Topic: How to access Vehicle acceleration power?
Replies: 2
Views: 340

How to access Vehicle acceleration power?

I cannot get this anywhere. Lua entity, lua entity prototype, burner, burner prototype, nothing gives me ability to get information about what's vehicle acceleration power. I'm already looking for it for 4 hours, is it even possible? I'm losing my mind on how hard is to find such information, so I d...
by Rafiz
Mon Feb 22, 2021 5:38 am
Forum: Multiplayer
Topic: Earth Economy Multiplayer Map HELP
Replies: 8
Views: 2477

Re: Earth Economy Multiplayer Map HELP

For machine hosting I cannot advice you in few words, as it's quite complicated, but you could find some simple to use ready factorio servers (I don't know if it exist, but maybe it does) and if that doens't exist you can buy(or find free?) some remote virtual machine and use SSH client to access co...
by Rafiz
Sun Feb 07, 2021 10:47 pm
Forum: Modding help
Topic: When you assign player force upon creation, it works only form second player on
Replies: 3
Views: 512

Re: When you assign player force upon creation, it works only form second player on

I think what I will do is I will leave first player in 'player' force and start creating forces only from second player. It should have no downsides, and I should've anyway preserve "forces" as there are only 64 available, but still I think it might be considered bug / unwanted behavior.
by Rafiz
Sun Feb 07, 2021 10:29 pm
Forum: Modding help
Topic: When you assign player force upon creation, it works only form second player on
Replies: 3
Views: 512

Re: When you assign player force upon creation, it works only form second player on

Here is whole script : https://pastebin.com/22Uj4xYz * I wrote set_gloal / not set_global, but thakns to copy-pasting everything I can, this doesn't affect anything, function reference is same everywhere.. Output during game start is 1 player 2 rafiz force 3 rafiz force 4 rafiz force , when I added ...
by Rafiz
Sun Feb 07, 2021 10:26 pm
Forum: Modding help
Topic: When you assign player force upon creation, it works only form second player on
Replies: 3
Views: 512

When you assign player force upon creation, it works only form second player on

In short - upon creating new multiplayer game (non-headless) this script : function on_player_created(event) local player = game.players[event.player_index] local newForce = createPlayerForce(player) game.print('1' .. player.force.name) game.print('2' .. newForce.name) player.force = newForce game.p...
by Rafiz
Sun Feb 07, 2021 4:35 am
Forum: Modding help
Topic: Enemies stronger further from spawn ( how to undo that )
Replies: 1
Views: 307

Re: Enemies stronger further from spawn ( how to undo that )

Ok - I did my own lua to fix it.

https://pastebin.com/kuN0M9rF

I might even turn it into mod that will scale down enemies on far palces..
by Rafiz
Sat Feb 06, 2021 11:07 pm
Forum: Modding help
Topic: Enemies stronger further from spawn ( how to undo that )
Replies: 1
Views: 307

Enemies stronger further from spawn ( how to undo that )

I have problem : my idea for scenario allows players to choose their spawn location, whole map is rather big and if you choose spawn far from center of map it is extremally hard to stay alive. What would be best solution to "flatify" map spawning ratios - so that instead of "than furt...

Go to advanced search