Space Engineers

Space Engineers

47 ratings
[Legacy] Fix PB Inputs API (IMyShipController.MoveIndicator)
3
   
Award
Favorite
Favorited
Unfavorite
Type: Mod
Mod category: Script, Other
File Size
Posted
11.971 KB
30 Nov, 2020 @ 5:08pm
1 Change Note ( view )

Subscribe to download
[Legacy] Fix PB Inputs API (IMyShipController.MoveIndicator)

Description
Legacy
The fix this provided was fixed in the game itself in SE v200, making this mod no longer needed for what it was intended for.



This mod fixes Move/Rotate/RollIndicator for Programmable Block API for MP in certain cases.

The problem
In PB's API, the IMyShipController's Move/Rotate/RollIndicator fields work fine in SP on any cockpit you might use.
The issue begins for MP clients as they will not send inputs if they can't control the ship at that moment.

For example, if someone enters a cockpit and flies the ship then you enter another cockpit expecting a PB script to be able to read your inputs, then you will be disappointed as it can not (unless you are the server-player).
Similarily for static grids, it can never move so clients have no reason to send their inputs.

This is not an issue for server-player because they're setting MoveIndicator/etc directly, therefore this mod isn't useful for SP/offline worlds.


This mod's solution
This mod makes clients send their inputs to server and assigns the MoveIndicator/etc which then PB can read, it will only do so for the cockpits/RCs that will not send inputs on their own as to not collide with vanilla's flight inputs.

This mod also ignores ship control while in a turret because that seems to be always synchronized regardless of the cockpit being on a static grid or not being main cockpit.

It also ignores any cockpit that isn't realy a cockpit: cryos, couches, passenger seats, etc.

It does not ignore cockpits that have thrusters/gyros/wheels/etc turned off in terminal, so you can turn those off and use it purely for PB to read its inputs.

It also has some safeguards, when you can no longer control the cockpit for whatever reason it will send a input reset packet. And server side if no input packet is received for 1 second it will reset input to 0 (lag/timeout/disconnect safety).



PS: If you have no idea what I'm talking about then it's safe to skip this mod :P It is a fix for a niche (input reading) in a niche (PB) and only for MP (maybe another level of niche =) ).


XBox ?
Will not work. This mod relies on client-side scripts which are not allowed on the console itself.
Popular Discussions View All (1)
1
16 Feb, 2021 @ 1:48pm
[Bug report] Losing control of the cockpit
Jedius IX Bakka
10 Comments
Marcus 🔰 4 Feb, 2022 @ 10:44am 
Indeed, for me it is no longer required for my sub-grid turrets
Digi  [author] 3 Feb, 2022 @ 5:56pm 
I dunno, you'll have to try the vanilla feature to see if it works as expected, if it does then yeah this'll not be needed anymore :}
Marcus 🔰 3 Feb, 2022 @ 1:18pm 
Hi, so with the new Update, is this mod still useful ?
thx
nul 18 Oct, 2021 @ 9:41am 
Just what I needed for MArmOS in my base!
Rhenium 28 Aug, 2021 @ 6:05am 
for everyone who too can't figure out how to use it with MART.
I placed 2 control seats:
1. control seat for MART - configured as in description of MART and also in control panel the seat have disabled such checkboxes as: control thrusters, control wheels, control gyros, main cockpit (!)
2. control seat for ship movement - it is default control seat, thrusters control and other control settings are checked, but also main cockpit MUST be enabled. otherwise it will say: "Someone else is using this ship!" when somebody will try to use other seat.
now it works like I was dreaming.
Thank you very much Digi!
Goobs 12 Jun, 2021 @ 10:27pm 
More modding wizardry by Digi. Excellent work.
Digi  [author] 21 Apr, 2021 @ 7:08pm 
All mods in SE are determined by server.
So only server needs to add it to world for everyone joining to use it automatically, regardless if they're subscribed to it or not.
DrwTrippy 21 Apr, 2021 @ 5:52pm 
does this need to be installed server and client side?
Teamson 2 Mar, 2021 @ 7:40pm 
Do i understand this correctly: the original MART script does not work on servers, if you are not the one, controling the ship? (I´ve build a small vessel with a gunner cockpit, so the 2. guy who is not flying should be able to use the MART Camera...)
UnlawfulParrot 20 Jan, 2021 @ 4:46am 
I love you for this