Cheshire Cat Computing

Software support and information
It is currently Tue Oct 24, 2017 9:36 am

All times are UTC + 12 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sun Sep 13, 2015 10:36 pm 
Offline
Silver User

Joined: Sun Sep 06, 2015 9:13 pm
Posts: 42
Hi,

I have added the mineshaft plan which randomply generates a mine with branches. I'd need a bit of help if possible:
1) I have to detect when to stop extending the horizontal branches. At the moment I do try to do something like this:
Code:
private plan _how_mineshaftsimple_branch
  IFBLOCK 0 2 18 minecraft:air
    END
    NOOP
  IFBLOCK 0 2 18 minecraft:lava
    END
    NOOP
  IFBLOCK 0 2 18 minecraft:bedrock
    END
    NOOP
  IFBLOCK 0 2 18 minecraft:water
    END
    NOOP
  IFBLOCK 0 2 18 minecraft:flowing_water
    END
    NOOP
  CALL _how_mineshaftsimple_mineshaft2 0 4 0 0 
  RANDOM 7
    CALL _how_mineshaftsimple_branch 0 0 4 0   
    CALL _how_mineshaftsimple_branch 0 0 4 0   
    CALL _how_mineshaftsimple_branch 0 0 4 0   
    CALL _how_mineshaftsimple_branch 0 0 4 0
    CALL _how_mineshaftsimple_branch 0 0 4 0   
    CALL _how_mineshaftsimple_branch 0 0 4 0
    CALL _how_mineshaftsimple_branch_end 0 0 9 0   
END

Whereas I'd like to have something like IFAREA which would tell mi if the given area contains a specific block or ideally a set of blocks like water, air, lava, bedrock.

2) I have no idea if the usage of END in the above code has any effect. The goal is to simply stop processing. The culprit at least for me is that the IFBLOCK statement has only two lines one for false and one for true. If I would like to execute several commands in the false (or true) branch how would I accomplish that ?

3) Just out of curiosity. When do you stop generating the tower ? e.g. how do you prevent the tower to rise above the limit of the minecraft world ? I just ask this because I managed several times to dig down to the void with the shaft :-D
Thanks


Top
 Profile Send private message  
 
PostPosted: Mon Sep 14, 2015 4:33 pm 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
1. This is invalid code; the END statement can only be used at the end of a plan definition, not in the middle. There is currently no way to abort a plan halfway through as you want to. The only way to achieve it is by using nested plans.

To see a way to do what you want, take a look at the tunnel sample blueprint; this drills through a hill until it reaches air on the other side.

2. The various branching directives (IFBLOCK, CHANCE, RANDOM, etc) are intended to be used to call sub-plans. This is how you can get multiple statements on a branch.

3. The tower goes on forever... a 2/3 chance of adding another layer each time. In theory, it could go to the top of the world (at which point the processing will automatically stop as the values are invalid) but in practice it never gets there.

I suppose it would make sense to add directives like 'IFYLT' and 'IFYGT' for 'if ycoord < ... ' and 'if y coord > ...'? I'll add this to the wishlist, along with a 'break' directive to exit a plan early.

The 'break' directive is actually awkward to do, as directives do not return an exit status. There might be some big changes required.

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
PostPosted: Mon Sep 14, 2015 5:38 pm 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
I have some code in alpha that allows IFBLOCK to take more than one block name parameter; also a BREAK directive to leave a plan early and an IFY to test current y-coord. This is all VERY alpha, though, and currently MC-1.8 only (I develop for 1.8, then back port to 1.7.10 using an abstraction library).

Let me know if you're interested.

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
PostPosted: Thu Sep 17, 2015 9:35 am 
Offline
Silver User

Joined: Sun Sep 06, 2015 9:13 pm
Posts: 42
Yes, I'd be very interested.


Top
 Profile Send private message  
 
PostPosted: Thu Sep 17, 2015 10:00 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
I'll upload the beta to curseforge over the next day or 2.
http://minecraft.curseforge.com/mc-mods ... ers-helper

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 12 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group