Modding classic bug

Please post here for questions and discussion about scenario, art and sound modding and the game editor for Distant Worlds.

Moderators: Icemania, elliotg

Post Reply
User avatar
VallenH
Posts: 1
Joined: Thu Mar 03, 2022 12:31 am

Modding classic bug

Post 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.
Never Fall, Never Bow.
User avatar
Hattori Hanzo
Posts: 757
Joined: Mon Mar 21, 2011 12:40 pm
Location: Okinawa
Contact:

Re: Modding classic bug

Post by Hattori Hanzo »

not a modder, but I'm always interested in "modding-hints" - thanks for posting 👍
Post Reply

Return to “Design and Modding”