Page 2 of 2

Re: Cursed Questions

Posted: Tue Jun 16, 2015 2:26 am
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).

Re: Cursed Questions

Posted: Tue Jun 16, 2015 2:42 am
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.

Re: Cursed Questions

Posted: Tue Jun 16, 2015 2:46 am
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.

Re: Cursed Questions

Posted: Tue Jun 16, 2015 2:51 am
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 :)

Re: Cursed Questions

Posted: Tue Jun 16, 2015 3:32 am
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 506 times

Re: Cursed Questions

Posted: Tue Jun 16, 2015 8:18 am
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]

Re: Cursed Questions

Posted: Tue Jun 16, 2015 10:42 am
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 465 times
goes to %appdata%\Factorio\mods\Cursed-Exp_0.4.1\prototypes\entities\
ontick.lua
(29.95 KiB) Downloaded 456 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.

Re: Cursed Questions

Posted: Thu Jun 18, 2015 9:45 am
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

Re: Cursed Questions

Posted: Mon Jun 22, 2015 1:37 pm
by Laikar
Sometimes my mines just start losing exp and turn back to lvl1, is this intended or its a bug?

Re: Cursed Questions

Posted: Mon Jun 22, 2015 2:45 pm
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

Re: Cursed Questions

Posted: Tue Jun 23, 2015 1:26 am
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 :(

Re: Cursed Questions

Posted: Sun Jul 12, 2015 6:39 am
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?

Re: Cursed Questions

Posted: Tue Jul 14, 2015 5:34 am
by crysanja
it produces blood very slowly

Re: Cursed Questions

Posted: Tue Jul 14, 2015 4:17 pm
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.

Re: Cursed Questions

Posted: Tue Jul 14, 2015 4:25 pm
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.

Re: Cursed Questions

Posted: Wed Jul 15, 2015 2:29 pm
by Arucard
Did that pipe mod get made so you can place them on deep water?