MAPi Hangout Menu

MAPi Hangout Menu v1.0

Wish it was easier to add custom hangout maps for us non modders.
Wanted to add mcd and fbcg hangput maps and some more but it was was above my skills...
 
can you please make so when i die and respawn with full health? Pretty annoying to get insta killed when griefers are around...
 
The mod is fantastic but the template on how to add maps can be a bit confusing
At most minimal this is all you need to add map, make a "z-mapi.lua" and add the following
Code:
-- MAPi support

local MAPI_LEVEL = LEVEL_MY_HANGOUT
local MAPI_NAME = "My Hangout"
local MAPI_DESCRIPTION = "Description for my map."
local MAPI_AUTHOR = "Myself"
local MAPI_PREVIEW_TEX = get_texture_info("my_hangout_preview")

local function mapi_load()
    local hangout_level = MAPi.hangout_map_add(
        MAPI_LEVEL,
        MAPI_NAME,
        MAPI_DESCRIPTION,
        MAPI_AUTHOR,
        MAPI_PREVIEW_TEX
    )
end

hook_event(HOOK_ON_MODS_LOADED, function() if MAPi then mapi_load() end end)
and LEVEL_MY_HANGOUT comes from your "main.lua" where you registered your level, of course you call it something else
Code:
LEVEL_MY_HANGOUT = level_register('level_my_hangout_entry', COURSE_NONE, 'My Hangout', 'my_hangout', 28000, 0x08, 0x08, 0x08)
the .tex file for the preview can be created by making a "your_map_name_preview.png" file in "textures" folder. make sure its 256x128 size. preferably 24-bit PNG but it probably doesnt matter.
veery simple

That is the minimal version, refer to the API doc in the github and the template for the more advanced features like custom skyboxes, sounds, text color, etc, if you want.
But the above is enough when all you need to do is just add the map with a picture.
 

Users who are viewing this thread