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
11 days ago
0.16 - 2.0
26.4K

b [Fixed?] Preview disappeared

1 year, 10 months ago

In one of my new archives, add this mod and that's it

1 year, 10 months ago

Thanks for the report! Did you add miniMAXIme to a game where it wasn't before, or did you add a new character to a game that already had miniMAXIme + other characters installed?

I've already seen this (no previews) before, but that was while I was fixing other mods, so I didn't pay much attention to it. Something seems seems to go wrong on loading the game (either in on_load or in on_configuration_changed). However, you can force a reset by open the "Available characters" GUI, deselecting one or more characters (you must apply the change!), then selecting it again (don't forget to apply this change as well). I'll look into this and try to fix that as soon as possible. :-)

1 year, 10 months ago

Add miniMAXIme to a game where it wasn't before

1 year, 10 months ago

Thanks, I'll try to fix that.

[deleted message]
1 year, 9 months ago
(updated 1 year, 9 months ago)

Add miniMAXIme to a game where it wasn't before

OK, I've figured it out: If the mod is added to an existing game, script.on_init() will be run for it. There we create first the surfaces for the preview characters and then one preview character per player on each surface.

After script.on_init() is finished, the migrations are run. The last version fixed that there was not enough space between the preview characters of the individual players if the scaling factor was >=300%. I solved this with migrations/01_01_19.lua, where I simply deleted all preview surfaces (including the preview characters) because they would be restored at the correct position when script.on_configuration_changed would be triggered. However, I didn't consider that game.delete_surface() doesn't delete the surface immediately, but on a tick in the future. So when the migration script has finished and script.on_configuration_changed is run, preview surfaces and characters still exist. But once the game resumes, they will be removed and there's nothing left for the cameras to show.

The fix is not to try to delete the preview surfaces, but just the entities on these surfaces. Replacing lines 7-18 of migrations/01_01_19.lua with the following will fix the problem:

for s, surface in pairs(game.surfaces) do
  if surface.name:match("minime%-preview%-.+") or
      surface.name:match(minime.preview_surface_name_prefix) then

    for e, entity in pairs(surface.find_entities()) do
      if entity.valid then
        entity.destroy()
      end
    end
  end
end
1 year, 9 months ago

Please try version 1.1.20! :-)

New response