Space Engineers

Space Engineers

48 értékelés
[Legacy] Fix PB Inputs API (IMyShipController.MoveIndicator)
3
   
Díjazás
Kedvenc
Kedvenc
Törlés
Type: Mod
Mod category: Script, Other
Fájlméret:
Közzétéve:
11.971 KB
2020. nov. 30., 17:08
1 változásjegyzék ( megnézés )

Feliratkozás a letöltéshez
[Legacy] Fix PB Inputs API (IMyShipController.MoveIndicator)

Leírás
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.
Népszerű témák Összes megnézése (1)
1
2021. febr. 16., 13:48
[Bug report] Losing control of the cockpit
Jedius IX Bakka
10 megjegyzés
Marcus 2022. febr. 4., 10:44 
Indeed, for me it is no longer required for my sub-grid turrets
Digi  [készítő] 2022. febr. 3., 17:56 
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 2022. febr. 3., 13:18 
Hi, so with the new Update, is this mod still useful ?
thx
nul 2021. okt. 18., 9:41 
Just what I needed for MArmOS in my base!
Rhenium 2021. aug. 28., 6:05 
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 2021. jún. 12., 22:27 
More modding wizardry by Digi. Excellent work.
Digi  [készítő] 2021. ápr. 21., 19:08 
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 2021. ápr. 21., 17:52 
does this need to be installed server and client side?
Teamson 2021. márc. 2., 19:40 
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 2021. jan. 20., 4:46 
I love you for this