game.displaymessage("Open meeting...", 0xFF0000) local mpMeeting = game.addPrsnt({ id =…
- User
game.display_message("Open meeting...", 0xFF0000) local mpMeeting = game.addPrsnt({ id = "mpMeeting", flags = {game.const.mesh_load_window}, mesh = game.const.mesh_load_window, triggers = { [game.const.ti_on_presentation_load] = function () game.presentation_set_duration(999999)
code-- Chat Box Background Creation local chatBackground = game.create_mesh_overlay(game.const.mesh_load_window) local bgPosition = game.pos.new() bgPosition.o.x = 0.05 -- adjusted from original script bgPosition.o.y = 0.15 game.overlay_set_position(chatBackground, bgPosition) local bgSize = game.pos.new() bgSize.o.x = 0.6 bgSize.o.y = 0.6 game.overlay_set_size(chatBackground, bgSize) game.overlay_set_color(chatBackground, 0x000000) -- Black background -- Chat Display local chatDisplay = game.create_text_overlay("@CHAT ------------------------------", game.const.tf_scrollable_style_2) local chatDisplayPosition = game.pos.new() chatDisplayPosition.o.x = 0.25 chatDisplayPosition.o.y = 0.31 game.overlay_set_position(chatDisplay, chatDisplayPosition) game.overlay_set_area_size(chatDisplay, 780, 430) -- Adjust width and height game.overlay_set_color(chatDisplay, 0xFFFFFF) -- White text -- Input Field local inputField = game.create_simple_text_box_overlay() local inputFieldPosition = game.pos.new() inputFieldPosition.o.x = 0.05 -- Adjust based on overall UI layout inputFieldPosition.o.y = 0.12 game.overlay_set_position(inputField, inputFieldPosition) game.overlay_set_size(inputField, {350, 1000}) -- Width and height of the input field -- Send Message Button local sendMessageButton = game.create_game_button_overlay("@This is send button", game.const.tf_center_justify) local sendMessageButtonPosition = game.pos.new() sendMessageButtonPosition.o.x = 0.58 sendMessageButtonPosition.o.y = 0.11 game.overlay_set_position(sendMessageButton, sendMessageButtonPosition) -- Additional setup for test buttons, text overlays, etc., following similar patterns end [game.const.ti_on_presentation_event_state_change] = function () -- Example: Checking if the "send_button" was clicked and handle appropriately. -- This part might require specific functions in Bannerlord to capture and handle UI events, not directly translatable from the Warband script. end [game.const.ti_on_presentation_run] = function () game.set_fixed_point_multiplier(1000) local mousePosition = game.mouse_get_position() local positionText = string.format("@%d,%d", mousePosition.x, mousePosition.y) -- Assuming a way to update an overlay’s text directly, which might need adjustment for Bannerlord API specifics. game.overlay_set_text("g_little_pos_helper", positionText) end } - Assistant
The error you're encountering,
table index is nil, generally happens in Lua when you try to assign a value to a table using a key that doesn't exist or when there's a syntax error related to table manipulation. In the context of game modding, this could mean there's an issue with the definition or manipulation of a table, particularly with the dictionary structure you've provided to function. - User
49: table index is nil
- Assistant