Jump to content

Recommended Posts

Okay so this is pretty straight forward. I have the following code:

local Layouts = GLOBAL.require("map/layouts").Layoutslocal StaticLayout = GLOBAL.require("map/static_layout")Layouts["beebox"] = StaticLayout.Get("map/static_layouts/beebox") AddLevelPreInit("SURVIVAL_TOGETHER", function(level)    if not level.random_set_pieces then        level.random_set_pieces = {}    end    level.numrandom_set_pieces = 30    table.insert(level.random_set_pieces, "beebox")end) 

 

I want to know if this is the correct way to create random set pieces in the world. Note: This is in modworldgenmain.lua.

Update:

The above code is the correct way of setting up random set pieces. After some time trying to figure out the issue, I was able to replicated a result.

 

For testing purposes use the following code:

AddLevelPreInitAny(function(level)    if level.random_set_pieces then        level.random_set_pieces = nil        level.random_set_pieces = {}    end    level.numrandom_set_pieces = 1    table.insert(level.random_set_pieces, "beebox")end) 

Edited by Kzisor

Hello,

 

Is it only one random set piece or more?

I know you've put a s after the piece

This is outdated code, please see the guide on how to create set pieces. You may find a link under my stickied topic on the top of this sub-forum.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...