This week builds on ModderDojo Topic 4, when we learned a bit about the basics of ScriptCraft and saw how it handles loops, decisions and variables compared to Scratch: https://cdathenry.wordpress.com/2015/11/11/modderdojo-topic-4-moving-from-scratch-to-javascript/
This week, our goal is to build a first structure mod in ScriptCraft. Ideally you should work in pairs. This to achieve this goal will involve:
- Several different ScriptCraft commands, as described here: https://github.com/walterhiggins/ScriptCraft/blob/master/docs/YoungPersonsGuideToProgrammingMinecraft.md#building-stuff-in-minecraft
- The basic ScriptCraft plugin structure that we learned about in Topic 1 of ModderDojo: https://cdathenry.wordpress.com/2015/11/11/modderdojo-topic-4-moving-from-scratch-to-javascript/
- Loops and decisions, as discussed in Topic 4: https://cdathenry.wordpress.com/2015/11/11/modderdojo-topic-4-moving-from-scratch-to-javascript/
- Planning and design: as you may remember from when you learned how to program in Scratch, a programmer’s most important tools are paper and pencils, for figuring out what you want to create before you write code for it.
During the session, I will ask people to load their mods onto my computer, demo them to the group, and explain how their code works. To get things started, at we can take a look at some mods from last year and how they work: https://cdathenry.wordpress.com/2013/11/10/modderdojo-athenry-our-scriptcraftjs-minecraft-mods/
Practical notes:
- Read the ScriptCraftJS API reference to see what commands you can use for your structures: https://github.com/walterhiggins/ScriptCraft/blob/master/docs/YoungPersonsGuideToProgrammingMinecraft.md#building-stuff-in-minecraft
- During development and testing, you can end up with lots of incomplete structures that slow down your CanaryMod server. A simple fix is to delete your world:
- Stop your CanaryMod server
- Open the CanaryMod folder on your computer: in it you will see a folder called worlds, and inside it one called default, and inside that default_NORMAL. Delete default_NORMAL and all of its contents.
- While you are at it, edit your world’s properties for when it is re-created: you can do this by opening canarymod – config – worlds – default – default_NORMAL.cfg. To make your new world superflat, write world-type=FLAT and you could also change other properties such as spawn-monsters=false
- Restart CanaryMod to create a new, empty world
- Re-run your scripts to recreate structures that you want
Pingback: ModderDojo Topic 7: Planning and Building a Complex Structure Mod in Minecraft | CoderDojo Athenry