Page 1 of 1

Modding classic bug

Posted: Thu Mar 03, 2022 12:50 am
by VallenH
Whoever once tried to replace/remove a default race probably came across an annoying error...
Index out of Bounds
The steps to reproduce are:
  • Remove/Replace a race (and possibly its references/dependencies)
  • add custom race image with naming max_race_image_index+1 (and possibly a transparent _a variant)
  • add obligatory troop_XXX images so that there's one group of them for every race (by appending to proper folder like above)
  • restructure all race files (add/rearrange races)
When you remove a race that used (for example) image 8 and you added a new one that uses race image 22, you leave a gap at 8 that no-one uses and it causes an error!
This was not properly documented and took a lot of testing to figure out the loading system behind it...

I'm leaving it here so that I can find it the next year again! :D
The docs only said about padding the ship images and flags etc, but nothing about race images forced use.

Re: Modding classic bug

Posted: Mon Jun 23, 2025 7:22 pm
by Hattori Hanzo
not a modder, but I'm always interested in "modding-hints" - thanks for posting 👍