Space Engineers

Space Engineers

Gravity Aligner
1,033 Comments
p3st|cIdE  [author] 2 hours ago 
It's in there but it's commented out; too many people didn't like it using cockpit LCDs, and I never got around to making it configurable. Check pg 3 of the comments where @CHEECH and I discuss it. it's in Chart.ShowFor(IMyShipController ctrl)
JohnyG Sep 26 @ 3:32am 
Hi. Im trying to put the LCD display out to a cockpit seat lcd. I read through the desc, couldnt find anything. Is it a feature?
p3st|cIdE  [author] Sep 24 @ 9:32am 
right on. fork away. lmk if you have specific questions.
Destormizer Sep 23 @ 2:33pm 
@p3st|cIdE It definitely is :D, I'm a budding programmer and I appreciated the structural finesse. It's just a shame that I get lost with the formulas and would need to study everything when I have time... I'll keep your code aside for future inspiration!
p3st|cIdE  [author] Sep 23 @ 9:11am 
@Destormer that code architecture is what I came up with to allow me to keep each part in its own C# code file, verify them in Visual Studio, then drop them all in together to make the final composited script for the in-game PB, and re-use code between scripts. It worked out fairly ok, all things considered. Seems like over-engineering at times. :steamfacepalm:
p3st|cIdE  [author] Sep 23 @ 9:08am 
@Apologies, @Walter tyvm
@Destormer I considered a script that matched,maintained at given position/orientation, it wouldn't be that hard to adapt my framework to do such a thing, I just have no time for it. Try my Full Control script, it might be closer to what you desire.
[BRE] Walter "Blanc" Sep 22 @ 1:19am 
Ping is around 100, i actually made it more stable with only using one gyro on the ship, its very usefull now and makes my large grid miner not tilt over! Great work on the script :)
Destormizer Sep 20 @ 4:48am 
Hi, I think your script is one of the best out there, and it’s structured like it was written by a true professional! I was trying to implement a couple of things, but unfortunately, I don’t have the necessary skills. In theory, I need a simple function that aligns the ship to a specific Yaw/Pitch/Roll that I provide (for example, I approach another ship and align with it, obviously after getting the correct Yaw/Pitch/Roll of that ship). If you ever have time to work on this implementation, I’d also love to ask if you could make the ship move to a specific x,y,z point, as the autopilot’s navigation isn’t very precise at all! It would be amazing if you could manage even just one of these functions :). Either way, thanks so much for the script!
Apologies Sep 16 @ 3:29pm 
Ah thank you, I'm trying to nail down why my player made missiles are turning to the ground and this at least rules out your script, an amazing script, ty!
p3st|cIdE  [author] Sep 16 @ 1:40pm 
@Apologies that's what the Aligner terminal group is for
Apologies Sep 15 @ 8:44pm 
Is there a way to ignore certain gyros?
p3st|cIdE  [author] Sep 15 @ 4:18pm 
oh, that's probably just lag related then. Yeah, that makes sense. your inputs have lag, and the response when the ship stops turning also gets lagged before your client sees it. The actual driving is happening on the server, where the script is running. What's the ping, out of curiousity?
[BRE] Walter "Blanc" Sep 15 @ 5:19am 
Yeah i think its server related, in single player it is smooth as butter, on the server it became like this
p3st|cIdE  [author] Sep 14 @ 9:33am 
@Walter maybe try looking at the 'steer' or 'turn' charts, could help give clues
my guess is it's the angular dampening response overreacting,
could be factor of gyrostoppability, hopefully that's all it is. Otherwise might need tuned in AngularDampen function but it seems I may not have a tuning variable exposed for it there.
could be lag due to updateperiod, can try increase up to 60
could be steeringsensitivity related
I don't think the alignangularresponse* PID are hooked up to this part
[BRE] Walter "Blanc" Sep 14 @ 8:27am 
Whenever i turn my ship with the horizon it tends to turn a bit back, what would be the fix for that
p3st|cIdE  [author] Aug 5 @ 4:02pm 
it's typically ok on servers, historically. Even at max tick rate it would rarely (never) trigger any slow script PB explosion. (unless animating way too many LCDs)
lowering the tick rate (defaults to 30 iirc, can go lower, like 15x/second) might help, on a server.
I've used this on several servers, personally, and it was always fairly reliable, or about as reliable as Keen VRAGE networking is in general, which isn't great, but GA seemed to handle it well enough. I don't recall any truly bizarre problems like that. Ships in general can get physics "frozen" strangely online, requiring some extra oomph on the gyros to wiggle loose of a frozen state, especially if connectors are involved.
Different Aug 5 @ 9:03am 
do you think being in server might also be interfering with the script? because even thought I created a group (with gyros, cockpit and programmable block) it seemed like the script was behaving in weird ways. Sometimes it would lock at the perfect angle and not allow tilting, other times it would lock at an angle of 20°, I noticed this when tilting the ship counterclockwise and didn't happen when tilting clockwise..
p3st|cIdE  [author] Aug 2 @ 2:07pm 
it could happen if the main ship (the one running the script) doesn't use a terminal group to select which blocks, in that case the automatic scan should exclude other grids but it might find them somehow accidentally; it's been a long time.
Use a terminal Group. If you play with other ships using the script, use a different Group name for each vessel; if they all use "Aligner" default, they'll hit this same problem.
Different Aug 2 @ 12:08pm 
Hey is it possible that this script picks up ships in the same grid and messes with their gyros, making them flip around uncontrollably?
p3st|cIdE  [author] Jul 15 @ 4:09pm 
nice ship! I built something like that once.
Yeah just bind a hotbar slot for Run PB with "pitchofs=90" (or is it -90?) and one for "pitchofs=0' to switch between mining and travel modes. That's what that's for!
Sakorito Jul 14 @ 9:47pm 
well. I'm realizing a vertical drop ship is the normal. I was looking more into a ship I could build similar to this but a bit bigger. and have it where once I find the ore I want I can level facing down into a planet and then reverse thrust back out
p3st|cIdE  [author] Jul 14 @ 5:18pm 
@Sakorito like this?
this script can adjust the pitch tilt angle almost arbitrarily using "pitchoffsetdegrees=X", or you can use a remote control instead if your ship is strangely designed somehow.
Sakorito Jul 14 @ 10:51am 
hi, I'd like to see about using this to align to planet gravity downwards. Basically Using this to always mine "down" is there something here to let me do it like that? or do I need a seperate cockpit to align to? (Idk if a second cockpit ruins the script)
CHEECH May 6 @ 9:04pm 
That did it thank you
p3st|cIdE  [author] May 6 @ 8:54pm 
Just above that in CHART section class Chart.. where it says
public static void ShowFor(IMyShipController ctrl)
see where it says if (false && ....
change that to true
pick a surface number (if 1 doesn't work)
CHEECH May 6 @ 8:44pm 
{
foreach (var s in Screens) Chart.ShowFor(s);
foreach (var l in Lights) Chart.ShowFor(l);
Chart.ShowFor(Scanner.Me);
Chart.ShowFor(Vessel.Controller); // disabled, no easy way to configure yet
}

Thats what I got. Im using the control seat with 5 screens. It works on my older ship with the old code but not the new one.
p3st|cIdE  [author] May 6 @ 8:34pm 
which cockpit are you trying with? some of them don't have enough screens.
I might have disabled the support in Chart.ShowFor also... check there
CHEECH May 6 @ 8:28pm 
I uncommented the line like you said but it still don't take over a screen.
p3st|cIdE  [author] May 6 @ 5:04pm 
uncomment the line of code that says Chart.ShowFor(Vessel.Controller); // disabled, no easy way to configure yet
That's funny, as soon as I disable it, folks want to re-enable it. I must spend some time on thinking up some way to configure it.
CHEECH May 6 @ 4:58pm 
How can I enable the cockpit screen?

no longer claiming a Cockpit screen (you're welcome) .. can be re-enabled in code.
p3st|cIdE  [author] Apr 29 @ 8:30pm 
@PimpMyDog looking at it now; are you sure? From what I can tell, it never filtered the UpdateType argument in Main... so it should just work. If Keen's end of it works, anyway, which is always iffy.
PimpMyDog Apr 27 @ 5:31pm 
Thanks! Yeah the new update seems quite interesting.
p3st|cIdE  [author] Apr 27 @ 5:24pm 
Sure, I could do that. I never thought anyone would use that updateType...
Probably will play a bit on this upcoming update, can work on it then.
PimpMyDog Apr 27 @ 5:13pm 
I have the improved code, let me know if you want
PimpMyDog Apr 27 @ 4:56pm 
Would it be too much to ask if you could make it listen to script updateType commands also? Currently you can only send commands through terminal or button but not from another script.
p3st|cIdE  [author] Apr 26 @ 3:45pm 
I suggest increasing AlignAngularResponseP in PB CustomData (then run "load")
tuning GyroStoppability might help. If it's smallgrid you can maybe increase the RPM limit. There are many settings to fiddle with.
OMEGA Apr 26 @ 3:06pm 
one last question what can i do to make the pitch correction stronger
p3st|cIdE  [author] Apr 26 @ 2:41pm 
@OMEGA this script only uses the gyros in the Aligner group, so whatever blocks you include/exclude.
OMEGA Apr 26 @ 2:31pm 
can i make this exclude certain gyros
WarArk [VL] Apr 20 @ 2:18pm 
Thx
WardenWolf Apr 5 @ 2:02am 
Version that won't take over cockpit LCDs: https://steamcommunity.com/sharedfiles/filedetails/?id=3445558187
p3st|cIdE  [author] Apr 4 @ 4:12pm 
I don't mind if you do whatever you want with it. I'm pretty sure I made it a public domain license.
WardenWolf Apr 3 @ 10:59pm 
Would you mind if I share my version with the LCD system disabled in the mean time?
p3st|cIdE  [author] Mar 26 @ 7:11pm 
I have a change ready to go, for the next time I actually play this game, that basically just disables the cockpit screen by default, I'm just too lazy to actually install on new machine or go back to old machine that has it installed, and test and upload it. Soon they'll do another update that might be enough to get me to put another couple hundred hours into this game, and I'll get it done.
Lazy, yes. Very. You don't even know.
WardenWolf Mar 26 @ 4:57pm 
Hey, if you'll accept my friend request, you'll see my fixed version if you want to just swap it out. I'll be honest: it's probably better off without the LCD feature, at least in its current form. The Offline texture looks really bad; it looks like you were too lazy to set that screen up. And it overwrites the colors so it doesn't match your aesthetics.
p3st|cIdE  [author] Mar 17 @ 6:49am 
good idea. this was all done when they first added multi-screens to the game; I kept expecting them to elaborate on ways to configure things (like give us a way to choose these from in-game GUI like the "script" applet things like clock) but what happened instead is Keen made in-game scripts "experimental" and basically abandoned them. I never thought of a clever way to configure these further.
WardenWolf Mar 16 @ 8:39pm 
How tough would it be to update the script so this is an option you choose in CustomData? Just a simple on / off. Since we've identified the one line of code that's key to the whole LCD system, I'd think it'd be easy to write a bit of code to let you simply not execute that one line of code if the line in CustomData is False.
p3st|cIdE  [author] Mar 16 @ 2:26pm 
ah, probably. I do recall getting thrown by this (my own code!) before.
WardenWolf Mar 16 @ 1:30am 
The line you want to remove is:

if (chart != null && ctrlb != null && ctrlb.SurfaceCount >= 2) chart.Show(ctrlb.GetSurface(1));
WardenWolf Mar 16 @ 1:21am 
I figured it out! Line 1322. Comment it out and it disables it. The line you mentioned doesn't work, but commenting out or removing line 1322 works perfectly.