This week we have one main goal: build a substantial mod in ScriptCraft that, when you run it, will create an impressive-looking structure! This will include:
- Several different ScriptCraft commands, as described here:
https://github.com/walterhiggins/ScriptCraft/blob/master/docs/api.md
- The basic ScriptCraft plugin structure that we learned about in Topic 1 of ModderDojo: https://cdathenry.wordpress.com/2013/10/05/modderdojo-week-1-getting-started-with-scriptcraft-and-javascript/
- Loops and decisions, as discussed in Topic 3: https://cdathenry.wordpress.com/2013/10/12/modderdojo-week-2-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.
You might find it helpful to work in pairs on designing and coding your mods. 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 the top and bottom of this post are pictures of mods created by Ruaidhri and Luke. We will take a look at how they work.
Practical notes:
- During development and testing, you can end up with lots of incomplete structures that slow down your CraftBukkit server. A simple fix is to delete your world:
- Stop your CraftBukkit server
- Open the CraftBukkit folder on your computer: in it you will see folders called world and possibly world_nether and world_the_end delete them all
- While you are at it, edit server.properties in the CraftBukkit folder to make your new world superflat, write level-type=flat and you could also change other properties such as spawn-monsters=false
- Restart your CraftBukkit folder to create a new, empty world
- Re-run your scripts to recreate structures that you want
- Read the ScriptCraftJS API reference to see what commands you can use for your structures: https://github.com/walterhiggins/ScriptCraft/blob/master/docs/api.md