( refer to the link below to find the correct names for each block type) ( the name of the block can be changed in control panel, so make sure everything is names correctly) (also its case sensitive)Īnd the "as IMy." part defines that it is of that type. "GetBlockWithName" searchs ur control panel for a block that has the same name. "GridTerminalSystem" not really sure lol, but u need it "var" means to make a variable, "door1" was a name i made up, to define the door (this can be any name) The whole trick is learning the parts of the line of code. Heres the list of blocks and what type of input, and output they can give/recieve: Light1.GetActionWithName("OnOff_On").Apply(light1) //turn on light If (door1.Open = true) //if the door is open Var light1 = GridTerminalSystem.GetBlockWithName("Interior Light") as IMyInteriorLight Var door1 = GridTerminalSystem.GetBlockWithName("Door") as IMyDoorBlock
0 Comments
Leave a Reply. |