Space Engineers

Space Engineers

Nanobot Build and Repair System Queuing / Display / Scripting
Dummy08  [kehittäjä] 10.11.2017 klo 9.39
Code Examples
Add a new discussion to share code snippets.
< >
Näytetään 1-4 / 4 kommentista
Dummy08  [kehittäjä] 10.11.2017 klo 9.41 
How to control the block that shoul be grinded (in case the build in block group is not fine enough)

Put the new function into the class BuildAndRepairAutoQueuing and call it where the existing
CheckAssemblerQueues() function is called.

private void ScriptControlledGrinding() { foreach (var groupData in _GroupData) { groupData.RepairSystems.ScriptControlled = true; var listGrindable = groupData.RepairSystems.PossibleGrindTargets(); //If nothing to grind or current grinding object no longer in list (allready ginded) if (groupData.RepairSystems.CurrentPickedGrindTarget == null || listGrindable.IndexOf(groupData.RepairSystems.CurrentPickedGrindTarget) < 0) { foreach (var entry in listGrindable) { var antenna = entry.FatBlock as IMyRadioAntenna; if (antenna != null) { groupData.RepairSystems.CurrentPickedGrindTarget = entry; break; } var reactor = entry.FatBlock as IMyReactor; if (reactor != null) { groupData.RepairSystems.CurrentPickedGrindTarget = entry; break; } var guns = entry.FatBlock as IMyUserControllableGun; if (guns != null) { groupData.RepairSystems.CurrentPickedGrindTarget = entry; break; } } } } }
Viimeisin muokkaaja on Dummy08; 10.11.2017 klo 9.57
Thank you so much. I feel like a complete rude, because I didn't realize that the system had a native enable/disable support in the ui. This helps however as I can set the script to toggle between sets of lists. Makes it easier to change between capture and scrap modes.
Is there any way to see the status on any LCD display? Can't find how to do it, even if I make a display with the naming in the script. Do I have to enter more code?
What would the code look like if it were checking for modded blocks to only grind those?
< >
Näytetään 1-4 / 4 kommentista
Sivua kohden: 1530 50