Space Engineers

Space Engineers

Zbyt mało ocen
[Tutorial] Find Blocks By Type
   
Przyznaj nagrodę
Ulubione
Ulubione
Usuń z ulubionych
Rozmiar pliku
Zamieszczono
Zaktualizowano
359.510 KB
1 stycznia 2015 o 12:28
1 stycznia 2015 o 17:06
Listy zmian: 3 ( zobacz )

Zasubskrybuj, aby pobrać
[Tutorial] Find Blocks By Type

Opis
A quick script I wrote to help teach others how to find and manipulate blocks of a certain type on a grid.
Komentarzy: 6
XCanG 22 listopada 2015 o 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 listopada 2015 o 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  [autor] 2 stycznia 2015 o 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 stycznia 2015 o 9:41 
Hum, how do i see the script?
Jimmacle  [autor] 1 stycznia 2015 o 17:07 
Updated, I hope the new comments make sense!
Siegmeyer 1 stycznia 2015 o 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.