Hadron particle won't pull power from "segment 0"
thePalindrome opened this issue ยท 5 comments
tested in v420, but been in for a bit
The core component requires the segment it is in has a power plug to charge itself (if the core doesn't have power, it simply refuses to fire the particle), but the particle does not pick up power from it, instead requiring it obtain power from "segment 1". This is because only the update() function adds charge from power plugs, and that only fires (apparently) when it moves to a new segment. The solution seems to be to change the initialization of the charge from 0 to an amount granted from the core or from the power plug in "segment 0"
The code for the hadron is a bit of a mess though, so I can't be surprised about weird edge bugs :P
The core segment not being checked was mostly intentional, as when the thing was originally added, access blocks did not work with hoppers and there was no other way of automating it. Also I kinda like being able to put other things into the inner ring of the core segment, but if it makes building the accelerator more intuitive then I can add the optional check of coils in the core segment.
Hmm... The tricky part is that the core segment needs a power plug, or the particle accelerator core won't receive energy (which as far as I've seen is only needed to actually launch the particle). It just feels odd that you must have a plug at the core segment and the first segment!
I think my suggestion for just initializing the particle's charge based off the core segment's power (or maybe even the power in the core itself) rather than setting it to 0 will fix it in this case
Huh that's weird, I remember the particle having an initial charge value based on how much power the collider needs to start, but the actual code says it's always 0. I probably changed that when reworking the thing which seems pretty stupid in retrospect. Since one charge "point" is 10kHE, logically when using 7.5MHE to start it should have an initial charge of 750.
As of X4214, particles have an initial charge of 750 which should correspond to the 7.5MHE used to power the core. Not sure if I should close this yet as strictly speaking the particle doesn't tap into plugs in the core segment and rather uses the core's energy buffer for that initial charge.