Total Miner Forums

Total Miner => Creative Features => Topic started by: Rock on February 28, 2018, 07:04:17 PM

Title: Help Needed: a script that can detect a specified block
Post by: Rock on February 28, 2018, 07:04:17 PM
I made a mod request topic about this (a mod that would sort of do what this script I am requesting would do) and someone did respond to that topic with a link for learning CS which is nice and if it comes down to it, I'll turn to that link.  Before I do that I wanted to see if there was an easier way first.  I wanted to know if I could make a script in-game that detects for every "NPC spawn block" in my world and for each NPC spawn block is detects it'll place a particle emitter underneath the NPC spawn block which will make a large particle that beams into the sky so I can find my NPC spawn blocks.

Anyone know how to do this?
Title: Re: Help Needed: a script that can detect a specified block
Post by: Craig on February 28, 2018, 09:37:21 PM
I'm not sure how practical it would be with scripts.

An entire map is 1024x1024x512 blocks = 536 million blocks.
Testing each block in a loop, including script latency is going to take probably 2 millisecs per block = 1 billion ms = 1 million secs = 280 hours.

There are some optimizations you could do such as testing several blocks per loop, and only testing a smaller vertical band on the map (say sea level +-50 blocks) but it's still going to take hours.
Title: Re: Help Needed: a script that can detect a specified block
Post by: Fuertey on February 28, 2018, 10:18:21 PM
You could do it manually in regions of 500,000 and use replace npcblock with say, cherry metal to help you locate where they are/were then replace them with npc blocks and write down the co-ordinates so you know in future. You'd still need to do this 1,072 times.

That's if they could be at all levels though.

If all your npc blocks are at surface level or -/+ 3 blocks then this would be reduced to 4 or 28 times respectively.
Title: Re: Help Needed: a script that can detect a specified block
Post by: Rock on March 01, 2018, 04:37:04 PM
I'm not sure how practical it would be with scripts.

An entire map is 1024x1024x512 blocks = 536 million blocks.
Testing each block in a loop, including script latency is going to take probably 2 millisecs per block = 1 billion ms = 1 million secs = 280 hours.

There are some optimizations you could do such as testing several blocks per loop, and only testing a smaller vertical band on the map (say sea level +-50 blocks) but it's still going to take hours.
Gotcha.

You could do it manually in regions of 500,000 and use replace npcblock with say, cherry metal to help you locate where they are/were then replace them with npc blocks and write down the co-ordinates so you know in future. You'd still need to do this 1,072 times.

That's if they could be at all levels though.

If all your npc blocks are at surface level or -/+ 3 blocks then this would be reduced to 4 or 28 times respectively.
Thank you!  I'll try this. Hopefully it works even though my npc blocks are underground (I'll have to replace npc spawns with air or invisible blocks)