Space Engineers

Space Engineers

Oxygen Sensor (Works in Vanilla SE - No mods needed)
Line 47 Error
Help!! The system is down with and error on line 47. I get an error that states "Line 47 : 'Sandbox.ModAPI.Ingame.IMyGridTerminalSystem' does not contain a definition for 'BlockGroups' and no extention method 'BlockGroups' accepting a first argument of type 'Sandbox.ModAPI.Ingame.IMyGridTerminalSystem' could be found ,are you missing a using directive or an assembly reference?". Here is that section of code.

// Method for finding block groups
List<IMyTerminalBlock> GetBlocksFromGroup(string group) {
var blockGroups = new List<IMyBlockGroup>();
blockGroups = GridTerminalSystem.BlockGroups;
for (int i = 0; i < blockGroups.Count; i++) {
if (blockGroups.Name == group) {
return blockGroups.Blocks;
}
}
throw new Exception("GetBlocksFromGroup: Group \"" + group + "\" not found");
}

Please help if u can tell me what is wrong in my code or if it is something i didn't name right!!
< >
Showing 1-3 of 3 comments
saxel 2 Nov, 2015 @ 5:39pm 
Apparently a change was made at some point to the Grid.Terminal.System thingie.
replace the line
blockGroups = GridTerminalSystem.BlockGroups;
with
GridTerminalSystem.GetBlockGroups(blockGroups);
and that should fix it up.
That One R.O.B. 4 Nov, 2015 @ 12:47pm 
ok ill try it and let you know.
That One R.O.B. 4 Nov, 2015 @ 1:16pm 
that worked! Thank You!
< >
Showing 1-3 of 3 comments
Per page: 1530 50