miniMAXIme: Character scaler and selector

by Pi-C

The player stands like a giant near the vehicles. Now you can adjust the size of your character -- and you can change your appearance at any time if you've other mods that provide extra characters!

Tweaks
a day ago
0.16 - 2.0
28.2K

b [Fixed] crash

2 years ago

Error while running event minime::on_gui_click (ID 1)
Index out of range.
stack traceback:
[C]: in function 'newindex'
__minime
/scripts/gui_stuff/gui_char_selector.lua:1211: in function 'on_gui_selection_state_changed'
minime/scripts/gui.lua:350: in function 'on_gui_selection_state_changed'
minime/scripts/gui_stuff/gui_char_selector.lua:436: in function 'update_page_selector_buttons'
minime/scripts/gui_stuff/gui_char_selector.lua:1146: in function 'on_gui_click'
minime/scripts/gui.lua:316: in function 'event_handler'
minime/scripts/events.lua:188: in function <minime/scripts/events.lua:185>

2 years ago

v1.1.18

2 years ago

Please try to change this block in scripts/gui_stuff/gui_char_selector.lua (starting at line 1204):

-- A button was used to turn the page, so we can calculate the new one.
else
  local elements = main_frame[bottom_flow_name][character_pages_flow_name][character_page_selector_flow_name]
  old_page = elements[dropdown_list_name].selected_index

  new_page = (element.name == buttons.previous and old_page - 1) or
      (element.name == buttons.next and old_page + 1)
  elements[dropdown_list_name].selected_index = new_page
  minime.writeDebug("Updated page via buttons!")

to this:

-- A button was used to turn the page, so we can calculate the new one.
else
  local elements = main_frame[bottom_flow_name][character_pages_flow_name][character_page_selector_flow_name]
  old_page = elements[dropdown_list_name].selected_index

  local first = 1
  local chars = table_size(p_data.available_characters) - p_data.hidden_characters
  local last = math.ceil(chars/minime_gui.characters_per_page)

  new_page = (element.name == buttons.previous and old_page - 1) or
      (element.name == buttons.next and old_page + 1)
  if new_page < first then
new_page = first
  elseif new_page > last then
new_page = last
  end
  elements[dropdown_list_name].selected_index = new_page
  minime.writeDebug("Updated page via buttons!")

If that doesn't work, please send me a saved game where the crash will occur.

2 years ago

By the way, I wonder how the crash could happen at all. What exactly did you do? Did you perhaps remove a character from the mod without changing the mod version number? I think that would bypass on_configuration_changed, where the list of available characters is updated.

2 years ago
(updated 2 years ago)

By the way, I wonder how the crash could happen at all. What exactly did you do? Did you perhaps remove a character from the mod without changing the mod version number? I think that would bypass on_configuration_changed, where the list of available characters is updated.

I don't know, it's the error log reported by my server

2 years ago

Should be fixed in 1.1.19 -- can you confirm this?

2 years ago

seem ok

New response