Kzisor Posted February 13, 2015 Share Posted February 13, 2015 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. Link to comment https://forums.kleientertainment.com/forums/topic/50927-wondering-how-to-create-a-random-setpiece/ Share on other sites More sharing options...
Kzisor Posted February 13, 2015 Author Share Posted February 13, 2015 (edited) 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 February 14, 2015 by Kzisor Link to comment https://forums.kleientertainment.com/forums/topic/50927-wondering-how-to-create-a-random-setpiece/#findComment-612850 Share on other sites More sharing options...
Mushu Posted April 15, 2015 Share Posted April 15, 2015 Hello, Is it only one random set piece or more?I know you've put a s after the piece Link to comment https://forums.kleientertainment.com/forums/topic/50927-wondering-how-to-create-a-random-setpiece/#findComment-629758 Share on other sites More sharing options...
Kzisor Posted April 15, 2015 Author Share Posted April 15, 2015 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. Link to comment https://forums.kleientertainment.com/forums/topic/50927-wondering-how-to-create-a-random-setpiece/#findComment-629930 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now