Author Topic:  Clear Random  (Read 697 times)

0 Members and 1 Guest are viewing this topic.

Warped Infamy

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
    • Awards
  • Xbox: Warped Infamy
Clear Random
« on: April 11, 2014, 11:38:40 PM »
My biggest plan for Script Blocks was to make an area that would regenerate ores so that players could mine them and then sell that and make money for an rpg map that I have in mind. The only way that I thought to accomplish this was by using the "Clear Random" command and then replace the air blocks with ores and repeat this until I am satisfied with the amount of ores and what not. Sadly, script blocks cannot "Clear Random" which broke my heart. If anyone has an idea of how to get around this and maybe use some different commands to get to the same end result, then please help. And if this is already posted somewhere, I apologize for posting this topic and please direct me to the original so I can find my solution. Thanks for taking the time to read this and please reply people. I need help.

Powerlord

  • Jr. Member
  • **
  • Posts: 20
  • fafa
    • View Profile
    • Awards
Re: Clear Random
« Reply #1 on: April 12, 2014, 12:03:19 AM »
Are you trying to fill the area back up with random blocks according to the terrain along with ore, or literary make all of them ore/essential blocks to sell?
« Last Edit: April 12, 2014, 12:06:24 AM by Powerlord »
agagag

Craig

  • Developer
  • Extreme Member
  • ******
  • Posts: 6650
  • Dig Deep
  • Awards Developer 5 years on site 4 years on site 3 years on site 2 years on site Was in the top 10 of the forum stats page as of 4/12/15 Members who have unlocked the robotic avatar 1 year on site Day 1 w/25+ posts (4/12/13)
    • View Profile
    • Twitter
    • Awards
  • Steam: tota1miner
Re: Clear Random
« Reply #2 on: April 12, 2014, 12:11:57 AM »
You can do Clear Random.

ClearRegion [x,y,z] [x,y,z] [percent]

Enter 100 for percent to clear all blocks in that region. Enter 20 for percent to clear 20% of blocks in that region.

Sorry, the percent parameter was not documented, I've fixed that for the patch.

Warped Infamy

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
    • Awards
  • Xbox: Warped Infamy
Re: Clear Random
« Reply #3 on: April 12, 2014, 12:29:09 AM »
You can do Clear Random.

ClearRegion [x,y,z] [x,y,z] [percent]

Enter 100 for percent to clear all blocks in that region. Enter 20 for percent to clear 20% of blocks in that region.

Sorry, the percent parameter was not documented, I've fixed that for the patch.

No problem and thanks Craig. By the way,  you are doing a fantastic job with this game.
Are you trying to fill the area back up with random blocks according to the terrain along with ore, or literary make all of them ore/essential blocks to sell?
No I was just planning on have a zone that people would be able to mine in and every so often I'd have that region updated to regen the ores. If this answers your question. That is a pretty cool idea though.

Powerlord

  • Jr. Member
  • **
  • Posts: 20
  • fafa
    • View Profile
    • Awards
Re: Clear Random
« Reply #4 on: April 12, 2014, 01:06:45 AM »
No I was just planning on have a zone that people would be able to mine in and every so often I'd have that region updated to regen the ores. If this answers your question. That is a pretty cool idea though.
I would be able to help you, but it seems like not only ReplaceRegion is bugged but FillRegion is too. Tested it so many times but didn't work.
But here's the code for when the next patch comes out, hopefully fixing this issue:
Code: [Select]
Notify [Regenerating ores] [global] \\Completely optional, this just notifies the server that it's launching the script
FillRegion [x,y,z] [x,y,z] [block] [MaybePercentage?]
alternatively, you could do ReplaceRegion when it's fixed to replace the entire area rather than fill the rest of the blocks up, wouldn't make a difference if you're trying to just fill the area with 1 block, though.

I haven't tested this but you could also make an area filled with the ores you want and have a script copy & paste it into the defined area you want your players mining at, but it's be much easier to just wait for a patch.
« Last Edit: April 12, 2014, 01:11:22 AM by Powerlord »
agagag

Warped Infamy

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
    • Awards
  • Xbox: Warped Infamy
Re: Clear Random
« Reply #5 on: April 12, 2014, 01:33:16 AM »
I would be able to help you, but it seems like not only ReplaceRegion is bugged but FillRegion is too. Tested it so many times but didn't work.
But here's the code for when the next patch comes out, hopefully fixing this issue:
Code: [Select]
Notify [Regenerating ores] [global] \\Completely optional, this just notifies the server that it's launching the script
FillRegion [x,y,z] [x,y,z] [block] [MaybePercentage?]
alternatively, you could do ReplaceRegion when it's fixed to replace the entire area rather than fill the rest of the blocks up, wouldn't make a difference if you're trying to just fill the area with 1 block, though.

I haven't tested this but you could also make an area filled with the ores you want and have a script copy & paste it into the defined area you want your players mining at, but it's be much easier to just wait for a patch.
I have a pretty good system for it right now. I've been working on it for around about an hour and I'm pretty satisfied. You're welcome to send me a friend request on Xbox and help me and maybe see if we can improve it. I'm always open to help.
« Last Edit: April 12, 2014, 02:20:06 AM by Warped Infamy »