Function to change level parameters in zone.lua
Posted: Mon Jun 10, 2013 12:38 pm
One can use the 'levels' field in zone.lua to have the levels of a zone use different sizes, layouts, generators...
This is quite useful, but what if one wanted to create a very deep zone where each level changed followed a pattern/function?
For example, making a dungeon smaller or larger with each level or alternating level layouts/map generators,
Doing this manually for a large amount of levels is possible, but frustrating.
So I'm asking for 'width' and 'height'(and other fields where it makes sense) to allow functions, and also for a way to change the generators/other properties of specific level using a function. In both cases of course level would be a required argument...
For example, say I wanted every even level of my zone to have no NPCs, then I could use...
(this is of course pseudocode, it shouldn't actually alter the zone but only the parameters for the level to be generated)
This is quite useful, but what if one wanted to create a very deep zone where each level changed followed a pattern/function?
For example, making a dungeon smaller or larger with each level or alternating level layouts/map generators,
Doing this manually for a large amount of levels is possible, but frustrating.
So I'm asking for 'width' and 'height'(and other fields where it makes sense) to allow functions, and also for a way to change the generators/other properties of specific level using a function. In both cases of course level would be a required argument...
For example, say I wanted every even level of my zone to have no NPCs, then I could use...
Code: Select all
adjust_level = function(zone, level) if level % 2 == 0 then zone.generator.actor.nb_npc = {0,0} end
...