Space Engineers

Space Engineers

Solar Panel Alignment Script [BROKEN]
358 kommentarer
mezzodrinker  [ophavsmand] 9. okt. 2017 kl. 11:34 
@Nicoleise Now that I am once again on my Windows installation, first of all, thanks for your effort of finding a way to run my script! It would be even greater if you could open an issue [github.com] with your improvements or create a pull request [github.com] on the GitHub site. That way, I'd have the code at hand and update the script accordingly :)

However, please do note that I am not trying to force you into doing that. Also, if you do decide to contribute to the code, please be aware that all code you contribute will be published under the project's license, which is currently a BSD 3-clause [github.com].
Nicoleise 25. sep. 2017 kl. 5:39 
There's a pretty agressive character limit on comments, so I'll elaborate in a second comment, that the portion of the script that we can comment out has the following purpose (in my understanding):

If you enter an incorrect component name, usually compilers will give you real useful stuff like "An instance is not set" or "Something went wrong". To increase user friendliness, the author of this script has made sure his script searches through the available groups. If the correct is found, all is well. If not, it outputs a more useful message like "The script cannot find your group name."

Points for useablity, but when the game then goes and breaks it, I feel the better option for the time being, is to simply comment out those lines of code, so that the script actually works - because it does a good job, once it's allowed to. :)
Nicoleise 25. sep. 2017 kl. 5:36 
We downloaded this yesterday and implemented it on our planet base. Here's the fix:

The problem is with the way the script searches for groups of components. But we don't actually need that functionality. So set the property that the solar panels is a group to false, and point to the rotors individually rather than as a group name (like "Rotor 1","Rotor 2").

Then click Check Script and it'll give you four lines with errors. In those lines, the script searches for groups with the name you entered, to give you useful information about why the script fails. Simply comment out these two entire blocks of code (every line) including the full {} containers they are in, and presto - script runs and works.

The only functional loss of not using a group for solar panels, is that the power output will be listed for one panel. To mend this, just multiply your variable by the number of panels.
mezzodrinker  [ophavsmand] 31. maj 2017 kl. 9:51 
@YrriNoTherapy It's a combination of Keen's updates and my perfectionism. They work hand in hand to bring me maximum enjoyment while writing scripts.
The_Yrri 28. maj 2017 kl. 9:53 
@mezzodrinker - is that something with new Keen updates that keep breaking it apart? No rush or attempts to push here, just a dedicated fan wants to know the future of the project.
mezzodrinker  [ophavsmand] 20. maj 2017 kl. 3:47 
Time to plunge myself into despair. I'm reworking the whole script... again. *sighs*
mezzodrinker  [ophavsmand] 9. maj 2017 kl. 7:21 
@YrriNoTherapy I am planning to pick it up again once I get the time to read into Space Engineer's nice programming API again. I'm lovin' it.
The_Yrri 7. maj 2017 kl. 18:03 
I wonder will this be updated or should it be considered abandoned. Love this one somehow.
Nikolas March 26. mar. 2017 kl. 3:13 
might work with the older compatibility version
Cronos.exe 1. dec. 2016 kl. 12:41 
This script currently broken
Ja dAttaque 27. nov. 2016 kl. 3:49 
Program (279,38) Error "|MyGroupBlock" does not contain a definition for Blocks... and more.
gromoche 24. nov. 2016 kl. 11:06 
I m trying to fix it. I found this :
https://steamcommunity.com/sharedfiles/filedetails/?id=709010443
I think i m on a good way.
keep you posted
mezzodrinker  [ophavsmand] 24. nov. 2016 kl. 11:03 
I have lots of stuff to do at the moment (including, but not limited to completely rebuilding a website, migrating data from another website and a full-time apprenticeship), so an update for this script may have to wait until January 2017. I do hope you can understand and will stay patient.

If you're a programmer and would like to contribute, feel free to visit the repository on GitHub and dig into the code.
gromoche 24. nov. 2016 kl. 10:26 
Hi,
Same issue :
Error : 'IMyBlockGroup' does not contain a definition for 'Blocks' and no extension methode 'Bolcks' accepting a first argument of type 'IMyBlockGroup' could be found
jouster500 10. nov. 2016 kl. 17:29 
@zeriambh Check to see if the scope, ie, where the variable is being defined, is accesible to the function thats calling for it
zeriambh 10. nov. 2016 kl. 14:19 
When I am following the directions on GitHub and get to the check code part I get a compile error that is saying the MyBlocks values aren't defined
Queue 29. okt. 2016 kl. 4:40 
umm it doesnt work. like. at all
mezzodrinker  [ophavsmand] 29. sep. 2016 kl. 10:30 
@jouster500 No, all Space Engineers scripts and mods are written in C#.
jouster500 29. sep. 2016 kl. 10:24 
Its written in java right?
mezzodrinker  [ophavsmand] 29. sep. 2016 kl. 10:18 
@BadHumour There have been efforts made by other people to update the script (see for example https://github.com/mezzodrinker/spas/pull/22 ) and make it compatible with Keen's recent updates. I honestly haven't been working on it at all recently. That is mostly because of Keen's tendency to slap me right into the face with their updates and my internship. We'll see where this is going. I'm planning to update the script eventually, though.
Bad Humour 28. sep. 2016 kl. 6:55 
Does this script still work with the updated ingame scripting?
OmegaConstruct 23. aug. 2016 kl. 12:11 
It seemed like other people were complaining about the script not working properly, not aligning perfectly, not the fact that it wasn't compiling. The last time that compilation errors were mentioned was a month ago and you said it was something to with the dev/stable split, so I thought this might be a new issue and wanted to make you aware. Sorry for wasting your time. Good luck with your internship.
mezzodrinker  [ophavsmand] 23. aug. 2016 kl. 10:52 
@OmegaConstruct Yes. It's been broken by a recent update. Which was said at least three times now. You don't even have to read through one page of comments to find that out. The more you bug me about it, the less time I have to work on the script. My time is already short because I am doing a full-time internship for the time being.
OmegaConstruct 22. aug. 2016 kl. 23:01 
Was this script by any chance borked by a recent update? Perhaps I am setting it up wrong, but I keep getting this message: http://steamcommunity.com/sharedfiles/filedetails/?id=750094430
Vas 16. aug. 2016 kl. 12:02 
Maybe you should make a script that makes Rotors function without exploding into randomness. :P Keen can't program Rotors that don't do this. Take a look at the reddit I posted. Even my pistons are fucking up.
mezzodrinker  [ophavsmand] 16. aug. 2016 kl. 11:13 
@Vas Thanks Keen for fucking up stuff that my script uses twice!
Vas 15. aug. 2016 kl. 18:13 
Well as I found out, I can't use rotors so this script won't help. :/
https://www.reddit.com/r/spaceengineers/comments/4xwtfl/rotors_are_entirely_unusable/
mezzodrinker  [ophavsmand] 15. aug. 2016 kl. 14:16 
@Vas Up until now, that has always been possible: How to: Using the script with solar panel mods [github.com]
Vas 15. aug. 2016 kl. 7:12 
Ah. Alright. Will you be able to make it not use "max output from default game" though? As some mods, such as my own, change solar panels to have a different output of energy. Some lower, some higher. I have tons of solar panels that produce lower and higher amounts. Even "solar paint" which is a flat block against the side of a ship.
mezzodrinker  [ophavsmand] 15. aug. 2016 kl. 2:38 
No, you don't need 2 programmable blocks and timers each, one should suffice. The problem is that the sun detection logic is (apparently) flawed. I'm working on it.
Vas 14. aug. 2016 kl. 10:47 
I'm assuming you need 2 programmable block and 2 timers minimum because all this does is make the rotor spin forever. I had the second rotor also named correctly but it didn't detect the second one. I ended up manually doing that one and it did the same thing again, so I must classify this as nonfunctional. :/
ShieldKnight857 11. aug. 2016 kl. 17:01 
Thanks for doing that. It is so cool but it's kind of a bummer it's not working right now.
mezzodrinker  [ophavsmand] 11. aug. 2016 kl. 15:04 
@OMoo And here I was thinking it would actually work for someone. I'm already working on rewriting the script.
ShieldKnight857 11. aug. 2016 kl. 12:23 
It doesn't work very well. It seems to not know exactly where the sun is.
mezzodrinker  [ophavsmand] 11. aug. 2016 kl. 10:34 
@TheWarMaster97 Yeah, I already know about that. It's certainly not caused by your changes.
mezzodrinker  [ophavsmand] 11. aug. 2016 kl. 10:33 
@OMoo It works for you?
TheWarMaster97 10. aug. 2016 kl. 12:09 
@mezzodrinker I changed only the necessary lines to solve the issue, i tested it now and it seems also to have some issue functionality wise, but i think this is not related to my changes, specifically sometimes it aligns properly and some times it turns away from the sun.
ShieldKnight857 10. aug. 2016 kl. 12:06 
Awesome! Perfect for when the sun is constantly moving. Especially on planets. Very cool script, thanks a lot! :)
mezzodrinker  [ophavsmand] 10. aug. 2016 kl. 10:14 
@TheWarMaster97 If it compiles, that should be good. If you didn't change anything functionality-wise, that is.
TheWarMaster97 10. aug. 2016 kl. 2:24 
@mezzodrinker I solved the issue with your code mentioned by ZeroZeven, i havn't tested it because i have no time, but at least the code compiles. I uploaded the code to pastebin: http://pastebin.com/y3VpjkFj Sorry if my english isn't clear.
mezzodrinker  [ophavsmand] 25. juli 2016 kl. 0:18 
@ZeroZeven I'm aware of that. It's because Keen made the awesome decision to split SpaceEngineers into two different branches with different APIs for the programmable blocks. Once I figure out the problem that has been pointed to below, I will probably split this script in two as well because apparently, I do not yet waste enough time on this.
Zero Zeven 24. juli 2016 kl. 16:04 
So yeah, i read the previous comments, but i just wanted to confirm that this script is completely 100% broken for me. It doesnt compile, and says something about blockgroup errors on lines 279+
mezzodrinker  [ophavsmand] 9. juli 2016 kl. 15:01 
@Kirkkid I know. I don't know what's wrong. I'm working on it. Thanks for reading the previous few comments.
Kirkkid 9. juli 2016 kl. 13:25 
I have this script running on my single player survival world. Everything seems to be working properly, but my solar panels are more likely to turn away from the sun vs towards it. Then they start panicking, turning even further away from the sun (X axis 90 degrees off, Y axis panels pointed towards the ground) and then it hibernates until I manually get them lined up again. Rinse repeat. Can't leave it alone for more than 10-15 minutes. Any advice? I am playing with 45 minute day cycle...could that be the problem?
jouster500 4. juli 2016 kl. 10:40 
By default when you build a solar panel, it is given a number to indicate the number of panels built to the ship or station. Knowing this, you can have the script look for increments of this value
mezzodrinker  [ophavsmand] 4. juli 2016 kl. 9:37 
@jouster500 I don't understand what you mean by "solar panels of numbered value instead of user defined", sorry.
jouster500 3. juli 2016 kl. 18:06 
So right now im reading through your entire code to get an understanding of how it works (i am aiming to make improvements/add ons to it) and understanding the SE coding style.

For starters i wanted to know if its possible to change naming scheme around so by default it looks for solar panels of numbered value instead of user defined. Just to speed up time and not have people dig through your code to configure it correctly.
Darian Stephens 25. juni 2016 kl. 14:43 
I have noticed it, and that's why the script had been sitting on a programmable block, turned off for months.
I've decided to say goodbye to this script for the time being, since the 'Stop Rotor on High Solar Power Output' one can at least avoid doing the exact opposite of what it's meant to.
mezzodrinker  [ophavsmand] 25. juni 2016 kl. 11:58 
@DarianStephens Yeah, I noticed and am working on it. No idea why that is, though. If you had read the comments, you'd have noticed that yourself.
Darian Stephens 25. juni 2016 kl. 8:27 
This thing now sucks at finding the right angle to produce maximun power, instead opting for the option that produces the smallest amount of power possible.
I almost think that, for single-rotor setups, rotating the result by 90 degrees would be best.