Sunday, November 22, 2015

Minecraft: The Castle that commands and command blocks built

My middle son was playing Minecraft and wanted a command block. He didn't really know what they were or what they did but he wanted one. I did a little research and found you have to use a command to get a command block.

/give YOUR_PLAYER_NAME_HERE command_block COUNT_DEFAULTS_TO_ONE

This gives the player listed the number of command blocks specified. If no number was specified it defaults to one.

If you wanted 47 diamonds you would do something like:

/give YOUR_PLAYER_NAME_HERE diamond 47

Once you have mastered that you can move on to the next phase.

Targeting the nearest player. Instead of targeting a specific player you can target the nearest with @p

/give @p command_block

That gives the nearest player a command block. Pretty handy.

If you place a command_block and put a button on it you execute the command with the press of the button.

I have made a command_button giver:



And the command:
*Note Previous Output user name removed.

So this is moderately interesting. You could use a dispenser for this but you would have to keep filling it up. This is a close enough to infinite item spawner.

You can also fill an area with an item. If you fill it with air you can clear a flat space to build a base. This is useful if you want a flat area to build on, but like the surrounding terrain, versus the super flat world.

Fill works thusly:

/fill X Y Z X Y Z ITEM_TO_FILL

Why did I put X Y Z twice? It is a range. This range can be a single block if the numbers are the same or a column, or row, or a cube.

To build my castle I cleared a bit of terrain. To find the X Y Z press "F3" on your keyboard. It shows the position of you in XYZ, and the block in Block.



To hide the debug window press "F3" again. Through a bit of trial and error you will soon be an expert in three dimensional coordinates.

This page has a pretty comprehensive list of items:

http://www.minecraftinfo.com/IDList.htm

An important item to remember is "air" that lets you clear a space. I cleared a big cube to start. Then I added walls. The only bit that wasn't added was the crenellations.


Using this fill command you can make gates open and close as well as drawbridges.

You can connect the blocks together for multiple effects using redstone wire. If you want a delay use a redstone repeater. 

Here is my close gate and remove the draw bridge.






You can even make a convertible castle:




Okay that was fun but what about making some monsters?

/summon CREATURE_NAME X Y Z







Wednesday, November 18, 2015

Using an ultrasonic sensor with a Rasberry Pi

I was helping a friend build a robot the other day and he was having difficulty with the ultra sonic sensor. I offered to test it on my Pi which a "B" model. I followed this guide:

http://www.bytecreation.com/blog/2013/10/13/raspberry-pi-ultrasonic-sensor-hc-sr04
and hooked it up using the single 1k resistor. I used a total of 5 DuPont connector wires and put the resistor between two.

I had to alter the timeout of the code to a full 1 second to get valid results. Also I had to adjust the GPIO pins used to the ones that I actually used to hook up.

It worked out nicely:





Monday, September 28, 2015

Random Tables Update IV

I was able to connect the Azure site to Google Domains and left it running for a week or two and it worked fine. I have since shut it down the Azure application and removed the Storage files from the cloud. The repos are available on GitHub per my previous post. Development has stopped for the common library and the Web Portal until bugs are reported. I may update the data packs at a later date, but have begun to work on other projects until demand increases.

Wednesday, September 9, 2015

Random Tables Update III

I have split the repo into three parts:

RandomTablesCommon - portable library imported as a submodule into the other repos.

https://github.com/crb02005/RandomTablesCommon


RandomTablesUniversal - Windows 10 Universal app. It imports RandomTablesCommon as a submodule.

https://github.com/crb02005/RandomTablesUniversal


RandomTables - Web Application. It imports RandomTablesCommon as a submodule.

https://github.com/crb02005/RandomTables


Since I split the modules I went ahead and got a domain name. I'll announce it once I have the site up. I am working on making the Web App work on the Azure platform. This means I had to add yet another string provider. I haven't committed my changes which add Azure features. I am still developing that piece.

Azure has blob storage, and many other cool features. Here is an article I've been reading about the topic:

Here is a NuGet package:

I had a chat with some friends of mine Monday and I might have some content contributors after I get the Web port on the web. After I get things stabilized I might shift focus to community building. Adding creative common content will make this product really useful.

Now time for a small bit about BOM.

Byte Order Mark (BOM) is optionally included on UTF-8 files.

This goes unnoticed until your JSON parser stops working. With my latest development for Random Tables I started yet another implementation of a string provider. The Azure Blob string provider uses a memory stream to read the file.

The Windows 10, and System.IO.readAllText seem to chomp the BOM and it worked flawlessly. Reading from the memory stream it is a bit more manual. BOM's are easy to forget until they "Byte" you.

http://www.w3.org/International/questions/qa-byte-order-mark.en.php

Friday, September 4, 2015

Carl Burks' Random Tables Progress

I've made a bit more progress on my application.

I am working on adding a feature to support multiple data directories in the web version. This will keep things organized a little better and will make it easier to drop in content packs. I also registered a domain for this application and have researched hosting. After I finish adding the feature I plan to fork the code base and create a repo for each major part:

Portable Library
Windows 10 Port
Web Port

Further I will add a repo for the Creative Commons Share-Alike Attribution Non-commercial data pack.

Next feature will be to add logic for custom attribution display messages for the Web Port and corresponding parsing instructions to the Portable Library.

After these are developed I will hopefully setup the web facing application.

I will then split my time for this project between adding features, adding tables to the CC repo, adding content to the publisher packs which have given permission.

As a side note, Bing seems to hate blogger.com searching for my name, "Carl Burks", doesn't show any blogger.com links and shows a bunch of spammy unrelated content. I'm trying an experiment by adding my name to post title to see if that improves things.

Tuesday, September 1, 2015

Random Table Portable Library, Windows 10 Application, and Web Port in C#

Yesterday, I checked in a project I've spent a few weeks playing with:

https://github.com/crb02005/RandomTables
This is a utility for rolling random tables with support for connecting dependent tables. If you don't see the purpose you might not have played a pen and paper role playing game. Let's say you were running a space type game and you wanted to see what space craft were near by you might have a table that looks like this:

Tables - Space Craft Encounters (1d6)
1-2   No Encounter
3       Shuttlecraft
4       Some kind of cargo freighter
5       Assault Craft
6       Roll on Unusual Space Craft Encounters


You would roll a standard six sided die and get a result. This is fairly straight forward roll a one or two and nothing happens. Roll a three and get a shuttlecraft. Roll a four and get a cargo freighter. Roll a five get an assault craft. Roll a six, you would need to look at another table and roll on that. Depending on your game system this can be a somewhat tedious process. It is also difficult to organize multiple publishers of books tables and connect them.

My software solves many of these problems. Currently only sample JSON files are included, but I am working on creating useful game system independent data-packs for my utility. I have also contacted several publishers and requested permission to create data packs.

I've contacted AEG, Steve Jackson Games, Fantasy Flights, Troll Lords and Green Ronin. So far I've heard back from AEG and Steve Jackson Games. Both companies were polite and helpful.

AEG indicated if I was not making any money then they were fine with creation.

Steve Jackson Games online policy indicates that they will only allow tables already published.

I plan on adding tables from both provided I have time. I will need to thoroughly research publicly available tables for SJG and that will take some time.

How can I get this program you might be asking yourself. Currently I have a common library that is used by the Windows 10 Application and the Web application. I've currently got some test coverage. Until bugs are reported I plan on spending time adding content in the form of JSON files. I have a few minor features I'm planning on adding, but the core application I believe covers most cases. The application is written in C#. Given time and interest I might make a port to another language. After some additional testing I might look for hosting and deploy the web app.

Sunday, June 14, 2015

Octodad: Dadilest Catch

I bought this game on Steam as an early father's day present to myself. Steam was running their summer sale and I had looked at the title of this game, but I hadn't watched the trailer once I did I knew I had to have it. It is an amazingly unique hilariously game which is also family friendly. I have added this to the list of games I've beaten. It was totally worth the price.