Terrain Generation from Lua, among other things. - Printable Version +- Cuberite Forum (https://forum.cuberite.org) +-- Forum: Plugins (https://forum.cuberite.org/forum-1.html) +--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html) +--- Thread: Terrain Generation from Lua, among other things. (/thread-1703.html) |
Terrain Generation from Lua, among other things. - wolfmitchell - 01-01-2015 I'm thinking of writing my own plots plugin. In my plugin, I want to write my own terrain generator that basically makes a grid like layout for the plots, with something like a 10x10 thing in the center, isles between the plots that are 5 blocks wide, and plots that are 2x2 chunks (32x32). Is this possible to do from lua? If not, what would I need to do to get it to do this? My second question is how would I detect if a player is right clicking a sign? Is it the OnPlayerRightClickingEntity hook? (not sure if i make my own function w/ that name of if I use cPluginManager:AddHook to get it, this is my first plugin) Lastly, how would I keep things like creepers or endermen from destroying the terrain (kind of like the mob griefing gamerule in vanilla/spigot/etc)? RE: Terrain Generation from Lua, among other things. - ThuGie - 01-01-2015 If i recall there is already such a plugin, and used by the gallery server. RE: Terrain Generation from Lua, among other things. - wolfmitchell - 01-02-2015 Does the plugin include generating the terrain of a new world into a plots-like thing? RE: Terrain Generation from Lua, among other things. - ThuGie - 01-02-2015 Read about it here https://forum.cuberite.org/showthread.php?tid=1306 RE: Terrain Generation from Lua, among other things. - wolfmitchell - 01-02-2015 That doesn't look like it does any of the terrain generation things I mentioned D: RE: Terrain Generation from Lua, among other things. - ThuGie - 01-02-2015 I was so sure it also generated the terrain. RE: Terrain Generation from Lua, among other things. - wolfmitchell - 01-02-2015 Looks like there is a world gen in it, but nothing on how to actually use it to generate a new world D: RE: Terrain Generation from Lua, among other things. - xoft - 01-02-2015 The Gallery plugin doesn't do much generating on its own. For each Gallery it takes an input Schematic file and just uses that for both the plot and the walkway; it also defines the half-width of the walkway. This is all it needs to do (and it should be what you should be doing in your plugin - have a Schematic (possibly separate ones for the plot, for the walkways in between and the crossings) and paste that into chunks being generated, and also upon claiming a plot (just to be sure). A sign is a block like any other, so the OnPlayerUsingBlock() should suffice. I'm not 100% sure about this one, though, you may find that you need to use the OnPlayerRightClick, which is called for each and every right-click. Explosions cannot currently separate the terrain damage from the entity damage, so you can either disable the entire explosion (the Gallery plugin does that as well, OnExploding hook) or let it have its full effect. |