Cursed Questions

Topics and discussion about specific mods
Tim2162286
Burner Inserter
Burner Inserter
Posts: 17
Joined: Mon Jun 15, 2015 2:34 am
Contact:

Re: Cursed Questions

Post by Tim2162286 »

Issue solved, the code that needs to be modified is line 432 of the ontick.lua script file.

Code: Select all

gen[i].accumulator.energy = (64^3) * 50 --originally (64^3) * 5
this works for the default values on the generator, but if you change the output to be higher it may cap back out (i think this will cap out at about 2.6 MW)

*Edit: Confirmed that setting it to 50 caps the generator out at 2.6 MW, which is above the generators default cap(2MW).
Last edited by Tim2162286 on Tue Jun 16, 2015 2:44 am, edited 1 time in total.
Qcor
Long Handed Inserter
Long Handed Inserter
Posts: 65
Joined: Mon Jun 01, 2015 7:19 pm
Contact:

Re: Cursed Questions

Post by Qcor »

Tim2162286 wrote:Issue solved, the code that needs to be modified is line 432 of the ontick.lua script file.

Code: Select all

gen[i].accumulator.energy = (64^3) * 50 --originally (64^3) * 5
this works for the default values on the generator, but if you change the output to be higher it may cap back out (i think this will cap out at about 2.6 MW)
Yeaaa.. I was laughing hard when I saw it.. 64^3 *5... number good as any other I guess. probably left from some earlier version where he had different formula for generators :)
Should be set to buffer_size * 5 in theory but it won't work. First of all 300tick is usually 5sec but not always, and secondly there is that issue which I described earlier.. which applies also here.
So generally ANY big number here will "MOSTLY" fix the problem but it will give wrong readings on one of the power generation meters.
Tim2162286
Burner Inserter
Burner Inserter
Posts: 17
Joined: Mon Jun 15, 2015 2:34 am
Contact:

Re: Cursed Questions

Post by Tim2162286 »

Qcor wrote: So generally ANY big number here will "MOSTLY" fix the problem but it will give wrong readings on one of the power generation meters.
no, that number only sets the maximum energy the generator will make, however it is limited to the output, so even putting it up to say (64^4) * 5000 wont affect how it reads in the power grid, it just lets you up the output more before you start getting down time while the buffer needs to charge. if you really want to limit it to exactly 2 MW, change the 50 to 38.5.
Qcor wrote: Yeaaa.. I was laughing hard when I saw it.. 64^3 *5... number good as any other I guess. probably left from some earlier version where he had different formula for generators :)
Should be set to buffer_size * 5 in theory but it won't work. First of all 300 tick is usually 5sec but not always, and secondly there is that issue which I described earlier.. which applies also here.
also i believe this number is watts, not kW, so you have an additional factor of 1000 you need to take into account.
Last edited by Tim2162286 on Tue Jun 16, 2015 3:10 am, edited 1 time in total.
Qcor
Long Handed Inserter
Long Handed Inserter
Posts: 65
Joined: Mon Jun 01, 2015 7:19 pm
Contact:

Re: Cursed Questions

Post by Qcor »

I think you didn't read my previous post.. the one with files attached.

Try it.. detach all power generators but cursed one and look at stats.. you will see :)
Tim2162286
Burner Inserter
Burner Inserter
Posts: 17
Joined: Mon Jun 15, 2015 2:34 am
Contact:

Re: Cursed Questions

Post by Tim2162286 »

so, i tried your code and it didn't work at all for some reason, but assuming know other modifications to the generators, replacing the ontick.lua with this version should fix any issues.
it is set to a max of 2 MW, but i added a variable to modify it easier
ontick.lua
replace the onscript.lua file with this one
(29.8 KiB) Downloaded 532 times
Qcor
Long Handed Inserter
Long Handed Inserter
Posts: 65
Joined: Mon Jun 01, 2015 7:19 pm
Contact:

Re: Cursed Questions

Post by Qcor »

hm.. I honestly don't see how it can not work.
Could you be more specific? I just tested it again and it works just fine. Are you sure you overwrote BOTH files?

Also, as a side note, 64^3 *38 might still not be good enough. I suspect it will start fluctuating when near max lvl (64) because of the problem I described earlier. I'll try to test it.. it just bothers me for some reason, not knowing why it does that strange thing.

[edit]
just tested your solution and it looks like the generator is working for ~4sec then idle for ~1sec. Are you sure you didn't modify anything else? hint: like the buffer size for example? :roll:
[/edit]

[edit2]
also confirmed that even at 64^3 *38 at lvl 65 is fluctuates again (even with buffer size fixed... which is to be expected as this number is totally pulled from the sky. It should be (in THEORY) = math.floor(0.25 * (generator_rank - 1)^2 + (generator_rank - 1) * 25 + 25) * 1000 * 300` but it practice even that won't be enough due to some strange reason I just can't pinpoint :/

And I just found another bug. As a result the generator at lvl 64 has more max_output than lvl 65. Minor thing, easy fix.Just add " + 1" to if statement in cursed-generator.lua line 31

Code: Select all

if  i == datos.maxgenerator + 1 then
[edit2]
Qcor
Long Handed Inserter
Long Handed Inserter
Posts: 65
Joined: Mon Jun 01, 2015 7:19 pm
Contact:

Re: Cursed Questions

Post by Qcor »

OK.. so, final changes:

In ontick.lua:

1) formula changed from some random number (64^3 *5) to what it should actually be:

Code: Select all

gen[i].accumulator.energy = math.floor(0.1 * (gen[i].rank - 1)^2 + (gen[i].rank - 1) * 25 + 25) * 1000 * 300
[edit3] this is still wrong, works but is wrong. I'm still trying to find how to properly set energy value [/edit3]
where
math.floor(0.1 * (gen.rank - 1)^2 + (gen.rank - 1) * 25 + 25) - is the max output of the generator of lvl i, according to cursed-generator.lua
* 1000 - is just conversion from [W] to [KW] because above is in [W]
* 300 - is here because we refill the generator every 300 ticks, so we need max_output* time it has to last

2) added another if statement to cover generator at max lvl (because it has different formula for max output)

Code: Select all

if gen[i].rank == datos.maxGenerator then
					gen[i].accumulator.energy = math.floor(0.25 * (gen[i].rank - 1)^2 + (gen[i].rank - 1) * 25 + 25) * 1000 * 300
				end
This way we generate exactly the amount we should be generating (in both cases).. not just some random number.


In cursed-generator.lua:

1) after inheriting properties of a basic accumulator we also inherit its max input. In our case should be set to 0kW to prevent some strange behaviors in rare cases.
added

Code: Select all

generator.energy_source.input_flow_limit = "0kW"
2) added " + 1" to if statement to correct the bug. Originally the lvl 64 generator takes this new output formula but lvl 65 should take it, not 64.

Code: Select all

if  i == datos.maxgenerator + 1 then
		output_flow_limit = math.floor(0.25 * (i - 1)^2 + (i - 1) * 25 + 25)
3) changed buffer size of generator to prevent strange fluctuations

Code: Select all

generator.energy_source.buffer_capacity = output_flow_limit * 330 .. "kW"
Why is it 330 and not 300? EXCELLENT question.. god only knows. Should be 300 but then you have some strange behavior which looks like the generator isrunning out of power in the buffer. So basically when you have a buffer of size AA and give it energy amount=AA it goes crazy.. but it buffer size is AA*1.1 it is OK.. :shock: so.. no idea why but it works :P
cursed-generator.lua
(62.62 KiB) Downloaded 486 times
goes to %appdata%\Factorio\mods\Cursed-Exp_0.4.1\prototypes\entities\
ontick.lua
(29.95 KiB) Downloaded 478 times
goes to %appdata%\Factorio\mods\Cursed-Exp_0.4.1\scripts\

P.S. Please bare in mind that this is NOT how it should work. It is just a functional workaround.
User avatar
L0771
Filter Inserter
Filter Inserter
Posts: 516
Joined: Tue Jan 14, 2014 1:51 pm
Contact:

Re: Cursed Questions

Post by L0771 »

haaaa a lot of english! i need a lot of time to read all this, but...
The problem is:
The "production" of generator is limited for output_flow_limit and buffer_capacity is the storage.
Ok, but first, production are watts and the storage are jules (watts/time), basically, you need fill [production * x] every x seconds... technically you must give [output_flow_limit] every second.
64^3 is only a number, you can put 70^5.

I need time to read now :P
Laikar
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Jun 22, 2015 1:33 pm
Contact:

Re: Cursed Questions

Post by Laikar »

Sometimes my mines just start losing exp and turn back to lvl1, is this intended or its a bug?
Qcor
Long Handed Inserter
Long Handed Inserter
Posts: 65
Joined: Mon Jun 01, 2015 7:19 pm
Contact:

Re: Cursed Questions

Post by Qcor »

1) they loose XP when there is no pollution.
2) they absorb pollution

Click on oxygen button while standing near to mine to make sure there is pollution
Qcor
Long Handed Inserter
Long Handed Inserter
Posts: 65
Joined: Mon Jun 01, 2015 7:19 pm
Contact:

Re: Cursed Questions

Post by Qcor »

a question.. why did you nerf fishers so much?

Now they cost 100% more and produce 80% less.
Was that intended? Because tbh that makes generators worthless... now it takes 5 times longer to produce a body :(
CodeRedAlert
Burner Inserter
Burner Inserter
Posts: 8
Joined: Fri Jul 10, 2015 5:57 am
Contact:

Re: Cursed Questions

Post by CodeRedAlert »

I need some info on the Fishery please, I've looked all over the forum mod and can't find out what the Fishery does and how to use it. Any links or tips on what it does?
No respect, no heart for nature
led by greed they tear our soil
ripped, the sky, the damage major
the air is at the boil.
crysanja
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Sun Aug 03, 2014 4:47 pm
Contact:

Re: Cursed Questions

Post by crysanja »

it produces blood very slowly
CodeRedAlert
Burner Inserter
Burner Inserter
Posts: 8
Joined: Fri Jul 10, 2015 5:57 am
Contact:

Re: Cursed Questions

Post by CodeRedAlert »

crysanja wrote:it produces blood very slowly
That still doesn't tell me how to take the blood out, the fishery's have no pipeline for output.
No respect, no heart for nature
led by greed they tear our soil
ripped, the sky, the damage major
the air is at the boil.
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Cursed Questions

Post by orzelek »

CodeRedAlert wrote:
crysanja wrote:it produces blood very slowly
That still doesn't tell me how to take the blood out, the fishery's have no pipeline for output.
They do have a pipe connection - only one one end tho. Enable the overlay with alt and it will show you the arrow.
User avatar
Arucard
Burner Inserter
Burner Inserter
Posts: 15
Joined: Fri May 08, 2015 11:59 am
Contact:

Re: Cursed Questions

Post by Arucard »

Did that pipe mod get made so you can place them on deep water?
Post Reply

Return to “Mods”