Space Engineers

Space Engineers

Otillräckligt med betyg
[Tutorial] Find Blocks By Type
   
Utmärkelse
Favorit
Favoritmarkerad
Avfavoritmarkerad
Filstorlek
Lades upp
Uppdaterades
359.510 KB
1 jan, 2015 @ 12:28
1 jan, 2015 @ 17:06
3 ändringsnotiser ( visa )

Abonnera för att ladda ner
[Tutorial] Find Blocks By Type

Beskrivning
A quick script I wrote to help teach others how to find and manipulate blocks of a certain type on a grid.
6 kommentarer
XCanG 22 nov, 2015 @ 8:13 
My example, that didn't work:
public void Main()
{
string timerName = "Timer Block";
IMyTimerBlock TimerBlock;
List<IMyTimerBlock> TimerBlocks;
TimerBlock = GridTerminalSystem.GetBlockWithName(timerName) as IMyTimerBlock;
TimerBlock.GetActionWithName("Start").Apply(TimerBlock);

// var timerBlocks = new List<IMyTerminalBlock>();
// GridTerminalSystem.SearchBlocksOfName(timerName, timerBlocks);
// for (int i = 0; i < timerBlocks.Count; i++) {
// timerBlocks[i].GetActionWithName("Start").Apply(timerBlocks[i]);
// } }
XCanG 22 nov, 2015 @ 8:10 
Hi! How to find block by name? I have Projector blueprint, this blueprint have timer block, I need to start this timer when I run script. Probably is: on my ship I have another timers and timer, that spawn every new spawn add number (e.x. Timer Block 23, Timer Block 24 ...). Can you help me to find this timer with script?
Jimmacle  [skapare] 2 jan, 2015 @ 10:52 
The second screenshot shows the script, however I have updated the comments since I took that screenshot to be more noob-friendly.
Dant 2 jan, 2015 @ 9:41 
Hum, how do i see the script?
Jimmacle  [skapare] 1 jan, 2015 @ 17:07 
Updated, I hope the new comments make sense!
Siegmeyer 1 jan, 2015 @ 16:29 
Very useful. I was really strugging with that. You might consider adding more in depth comments, especially for the list making and using part.