Space Engineers

Space Engineers

Co-op (Refinery & Assembler) Controller
49 Comments
Stoner  [author] 6 Aug, 2019 @ 10:45am 
@VoHD , ok so it turns out the unreachable code was in fact a correct warning, i forgot to remove a line after debugging last time.. everything should work as expected now.. if you're still experiencing issues, please let me know ;)
VoHD 3 Aug, 2019 @ 7:27pm 
@Stoner maybe, but after launch, programmable block show few errors in it's info screen. I can screenshot it, if you need,
Stoner  [author] 2 Aug, 2019 @ 12:05pm 
@VoHD , mind that a warning is not the same as an error.. so in theory the script ought to work, even if SE's interpreter considers that code unreachable, though i'm pretty sure that's a mistake cause that code does get reached iirc...
VoHD 1 Aug, 2019 @ 11:32pm 
@Stoner has error in script. On compilation.
Program(182,4): Warning Unreachable code detected
2x
Stoner  [author] 15 Feb, 2019 @ 7:13am 
@yokmp , In the future, if the script stops working due to updates, just hit me up since I'm not playing space engineers on a regular basis anymore..
yokmp 15 Feb, 2019 @ 6:52am 
Nice!
The way your Script handles distribution feels better than TIMs oder the other ones which name I can't remember rn.
Stoner  [author] 13 Feb, 2019 @ 6:17pm 
@Ser Artemiel , K nvm, a working version should now be available...
Stoner  [author] 13 Feb, 2019 @ 5:47pm 
@Ser Artemiel , Do you perhaps have any experience with the programming block? Cause I'm running into a weird problem when it comes to transferring ore... any help would be appreciated :p
Ser Artemiel 13 Feb, 2019 @ 2:45pm 
Thank you so very much!
Stoner  [author] 13 Feb, 2019 @ 1:45pm 
@Ser Artemiel , It's been quite a while since I fired up Space Engineers. Will try to update it somewhere in the next week if I find some extra time..
Ser Artemiel 11 Feb, 2019 @ 8:21am 
Hello, first of all - thank you for this script, it was very useful and I loved it. Right now however, it does not work. So I want to ask if it is still supported and you will update it or should I find another script?
Stoner  [author] 7 Feb, 2017 @ 5:13pm 
@yokmp : Actually distributing the production queue equally would have to be done programatically, however i see no need for that since assemblers in co-op mode (referring to the in-game option here) will automatically pull from each other's queue.. As for the order in which ores are refined, i'm not sure that i will implement such a feature since the user can simply put the ores in the main refinery in the wanted order, solving your problem.. You may not know which ingots you need but in that case i'd rather go for a seperate program that outputs info to a LCD telling you the total amount for each type of ingot so that you have a nice overview & know what you need.. MMaster's configurable LCD script has the needed functions for what you need.. Have a look at the guide and check the Inventory command.. Should give you the info you need if you use the right arguments, something like: Inventory * +ore +ingot
Let me know if i can help you out with anything else ;)
yokmp 5 Feb, 2017 @ 1:14am 
Is there a Way to distribute the production queue eqally over all assemblers? Say I queue up like 10 different parts and the script then distributes them over all assemblers so they finish the production at the same time.
I currently switching over from my InvScript to Taledens and his one does this thing with Refineries (but with the difference that they produce the most neded ore/ingot first ... [yes, thats a hint ^^]).
Stoner  [author] 14 Jul, 2016 @ 11:38am 
@yokmp : They're 2 different things.. Adding the "[Co-op]" tag only adds functionalities stated in the description under paragraph "What does the script do".. To sum it up for you, it will turn on/off assemblers that (respectively) have a non-empty production queue or are idle. They will also drain ingots upon shutdown & store them in cargo containers that contain the "[AI-DUMP]" tag.. Hope that answers your question, else feel free to contact me again ;)
yokmp 14 Jul, 2016 @ 3:54am 
Whats the difference between your Coop-Mode for Assemblers and enabling the Ingame Coop-Mode?
Stoner  [author] 17 Jun, 2016 @ 2:05pm 
@Ivar418 : Sounds pretty weird.. Could you send the save-file that you're using? Or could I join you somehow so I can have a look for myself to try to figure out what the problem could be..
Ivar418 17 Jun, 2016 @ 11:40am 
hi.
i am using this script but it says something about the reference not set on the instance of an object. I triple checked everything and the names of Refinerys, assemblers, AI-DUMP where good
Stoner  [author] 6 Apr, 2016 @ 6:37am 
@frosty1098 : Np man, you're welcome.. Spread the word :p
Frosty 6 Apr, 2016 @ 1:35am 
thanks so much for making this script
Stoner  [author] 5 Apr, 2016 @ 4:36pm 
@frosty1098 : Script has been updated. No bug in the distribution after all... Just kind of forgot how my script works xD you can notice odd behaviour when mixing ores that can also be processed by an arc furnace and ores that can't... Though the algorithm should resolve the problem automatically in later executions of the program. Anywayz, thanks for notifying me ;)
Stoner  [author] 3 Apr, 2016 @ 9:34am 
@frosty1098 : Ok I found the problem. The adjustments I made for Berkys are no longer needed & so all the namespaces for IMyInventory & IMyInvertoryItem should be deleted. I will update ASAP but I noticed a bug in the distrubution so I'm trying to fix that too...
Stoner  [author] 3 Apr, 2016 @ 7:07am 
@frosty1098 : When was the last time you tried? I should've fixed those errors so it at least compiles. I'm about to give it another shot to see what happens...
Frosty 2 Apr, 2016 @ 11:12pm 
im having thr same problem a Berkys
when i compile it says line 111
142 152 169 233 have errors
Stoner  [author] 16 Mar, 2016 @ 7:20am 
@Berkys : I managed to fix the errors, problem turned out to be something with the inventories since they got put in the VRage namespace.. It should work now, though I haven't had the time to actually test it yet.. Anywayz, i'm pretty sure it'll work like before now so if i don't hear from you i will assume it does... BTW, Thanks for letting me know ;)
Stoner  [author] 15 Mar, 2016 @ 4:19am 
@Berkys I will check that asap.. It's been a while since i played SE so over time there's probably incompatabilities that arrised.. I'll keep you posted on the fix..
Berkys32 15 Mar, 2016 @ 3:35am 
Checking script gives some errors, and programmable block gives "Assembly not found. Please compile script" error.
I have Assembler MAIN [Co-op], Refinery MAIN [Co-op] and other refineries with [Co-op] too.
Stoner  [author] 28 Nov, 2015 @ 7:45pm 
@JOOOHN CEEENA : Most probably the issue is in your setup.. Have you made sure all names of your refineries/assemblers are correct?
Crazybmanp 22 Nov, 2015 @ 1:11pm 
Does this script still work? I'm getting an object reference error and i'm not sure if it is my setup or the script.
Stoner  [author] 12 Aug, 2015 @ 7:49am 
@Slaughter Lord: If you've written C++ in the past, C# is not that difficult. Make sure you use documentation.chm which can be found in the Tools folder within the installation directory of SE. It'll help you a lot in understanding the API..
Btw, thanks for the luck :p
ConTaGious 12 Aug, 2015 @ 12:39am 
@Stoner: Thanks for the advice. I attempted to learn C# a couple months back but didn't spend much time at it but i think i'll give it another go. And triggering the script manually wouldn't be an issue and i imagine would help a bit with overall performance of the game. Thanks for the offer in writing it yourself, maybe, if i'm not successful or just do a bad job, i'll check back with you in 2-3 weeks and see if you'd be up for it. Good luck with your exams.
Stoner  [author] 11 Aug, 2015 @ 8:59am 
@Slaughter Lord: It's definately possible but due to the size of the code I would just start over.. Trying to adjust the code may become very messy along the way, however the general design would more or less be the same. In particular, I would again use a "distributor" & most probably a button to trigger the script instead of a timer block. Though there are more ways to rome, so before you actually start programming, try to have your idea figured out allready. Worst case scenario, if you can't get it to work, I will give it a try when I'm done (approx 2-3 weeks from now) with my exams ;)
ConTaGious 10 Aug, 2015 @ 8:40pm 
I defiantly will do so. There isn't a specific funtion you're referring to tho is there; to spread the word that is? I wanted to bring up something that you may be able to point me in the right direction:
Now that inventory mass affects overall ship mass, i have been searching for script to distribute ore evenly throughout containers. It seems that your script and some others i think, are basically already doing so just except with refineries/drills etc. Is it possible to replace some words in your script (or "references" i think is the correct term) with ?containers? Being as all ore has the same mass to volume, it seems it wouldn't be anything unusually challenging. Before i start trying to do so, could u tell me if it's possible to replace some code in ur script?

FYI: It'd only be for personal use. Thanks again
Stoner  [author] 10 Aug, 2015 @ 9:02am 
@Slaughter Lord : Thanks man! Appreciate your comment.. You can allways spread the word if you want to see this script become more popular :p
ConTaGious 10 Aug, 2015 @ 7:50am 
You're script rocks man. I've been using it for a while and have looked at quite a few others available and yours defiantly works the best for what i like. I'm actually quite surprised its not more known on the workshop. I really like how well you got it to divide ores inside refineries, great work and thank you!
Stoner  [author] 25 May, 2015 @ 7:58pm 
@Lithorn : No problem man, glad to have helped.. Thanks to you I discovered another couple of bugs, perhaps also the one I mentioned in my previous post. But I'm still going to run some more test now that I know what I'm looking for. Expect an update before the end of the month, as I have exams in the next couple of weeks...
Lithorn 25 May, 2015 @ 5:38pm 
Stoner got with me and worked out the kinks in the script, works like a charm in SMP now, and he even added an anti clogging segment to help with those dang assemblers getting stuck. Thanks bro!
Lithorn 20 May, 2015 @ 6:56pm 
I tried this on a fresh world and couldn't get it to function, I do not know what could be wrong anymore. I have followed your guide to the letter so I am at a loss here.
Stoner  [author] 20 May, 2015 @ 6:31pm 
@Lithorn: Must be a user specific problem cause I just tested out the script with the current version of SE. Mind that you would want to keep the standard producing speeds in order for this script to work correctly. I did find a bug which occurs in a special case during redistribution though, still trying to figure out what the exact cause is. As soon as I have more time, I will look into this bug more properly.
Lithorn 19 May, 2015 @ 2:52pm 
Yeah this isnt distributing across refinerys either.
Lithorn 19 May, 2015 @ 2:44pm 
This semi works for me. Assemblers do their job, but Refinerys and Arc's don't. You don't mention anything about leaving the conveyer system on.

I have to put ore into the refinery for it to flip on, maybe turning off converyer and using a sort/push block to force ore in will help trigger it to function. Also I have an arc furnace but the script won't enable it, im assuming same issue as refinery.
Lithorn 19 May, 2015 @ 2:25pm 
Since we now have upgrades, does this affect the script any? Should we make sure each refinery has the same upgrades?
Stoner  [author] 8 May, 2015 @ 7:07am 
@Sakata
It's surely possible, however there's an issue when it comes to determining which container you want to move it to. Either it'll have to be a container with a predefined name (for example: "AssemblersEmptier" or something like that) so that i can find the block by name. The other way would be to split all the remaining ingots over all storage containers, which you might not like since that will mess up your sorted containers.
At last, I would like to ask you to test out your assemblers by producing a certain amount of stuff in parallel (i.e. co-op mode) & check the assemblers afterwards. IIRC only the main assembler should have ingots remaining in its inventory after production. However if that's not the case or you're still too lazy to manually transfer the remaining ingots - which I totally understand since that is why I program in the first place :p - I will try to adjust it as soon as possible.
Sakata 8 May, 2015 @ 1:11am 
hey could you have it so that if the assemblers are idle, move all ingots back to a storage container?
Stoner  [author] 12 Apr, 2015 @ 8:39am 
@Wafflez4U Nope, that doesn't matter.. only the names matter... Note that you can even have a sorter block in between that "blocks" some ores to a refinery.. When transferring items via programming block, the sorters are basically regular conveyors.. Hope i answered your question :)
Xenon 12 Apr, 2015 @ 5:55am 
does it matter how all the machinery is connected?
Aerzaal 9 Apr, 2015 @ 2:07pm 
The computer core of my ship steadily bloats. This and like... 5 other programs I don't know how you could go without.
Sn0w_Lynx 3 Apr, 2015 @ 9:04pm 
very usefull script!
ConTaGious 3 Apr, 2015 @ 9:04pm 
I actually looked up my question and figured it out. Wish i woulda known about that sooner. Thanks for sharing this script you made.
ConTaGious 3 Apr, 2015 @ 8:35pm 
This sounds pretty awesome. I am new to Space Engineers and haven't really wanted to start modding the game yet, at least not before i learn everything vanilla. I was about to start figuring out the programming block and coding with in general, then i saw this.

Why do the assemblers need to be in "CO-OP Mode"? Is that just setting them to "Share w/ Faction" / "Share w/ All"? Just wondering what exactly that means&does. Thank you