MyVisualScriptLogicProvider.IsConveyorConnected() needs updating for conveyor EC
This is used by both visual-scripting-tool and modAPI, and the issue is it gets the 2 given blocks and casts them to IMyConveyorEndpointBlock, which won't work for blocks like the Farm Plot that don't implement that and instead use an entity component to get the conveyor network support.
Inventory's CanTransferTo() does check the block and gets the entity component too so one can look there for the right way to get the endpoints.
Hmm that also means it doesn't work if targeting a 2-port tube (IMyConveyorSegmentBlock), but I don't see the MyGridConveyorSystem accepting that so it's probably too much hassle to support it.
Also please expose MyGridConveyorSystem.ComputeCanTransfer() somewhere that doesn't require inventories, it could be added to MyVisualScriptLogicProvider for VST too, or not =)
EDIT: I've made a quick mod script to test/confirm this too, attached below.
Make the path %appdata%/SpaceEngineers/Mods/YourMod/Data/Scripts/YourMod/ and place the attached .cs file there after unzipping it (why does it not allow .cs files :( ).
Then place 2 farm plots and connect them with conveyors, they'll never be seen as connected because themselves are not seen as conveyor-supporting blocks.
Replies have been locked on this page!