Jump to content

Recommended Posts

So I follower a Set piece tutorial and it was real great until one point. My question is:

 

If the Set piece data is not supposed to be in modmain.lua but in a specific folder of your mod, then what do you write in the modmain?!

 

And can someone explain how this works and where to write it (I know what it does, just don't know how it works and where it's from):

 

local Layouts = GLOBAL.require("map/layouts").Layouts
local StaticLayout = GLOBAL.require("map/static_layout")
 
Layouts["ResearchLab"] = StaticLayout.Get("map/static_layouts/rl")
 
AddRoomPreInit("Forest", function(room)
    if not room.contents.countstaticlayouts then
        room.contents.countstaticlayouts = {}
    end
    room.contents.countstaticlayouts["ResearchLab"] = 1
end)

You put that function in your modmain.  The files that you store in your map folder are the files containing the actual code, but you define you levels and such in your modmain.

That's how I do it, anyway.

Edited by JackSlender

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...