Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Silent Bob on Fri 27/07/2018 22:00:57

Title: AGS Crashes after unused font delete
Post by: Silent Bob on Fri 27/07/2018 22:00:57
Hello,

I don't know if it's a bug, or smth else, but I'm facing a situation where after I delete some unused fonts from my project - it crashes :confused:. After restart each project's text field (for example placed on some GUIs) lose its connection with a font defined for them to use. Even if it wasn't a font that was actually deleted. The program acts like it couldn't re-index fonts, and therefore the problems occur. Anyway - this is a really strange situation. Even if I set again the fonts for textfields, i'm not 100% sure that the project won't crash again and lose font connections again (it happened). So in the end i decided to go back to one of my backups, and just renamed unused fonts, without deleting them, and it seems it's ok. As i mentioned - it's really annoying. Anyone of You guys faced a similar situation? Here's one of the described errors messages:

(https://s15.postimg.cc/4fyho7smj/error.png)


Title: Re: AGS Crashes after unused font delete
Post by: Crimson Wizard on Fri 27/07/2018 22:06:36
Quote from: Heisenberg on Fri 27/07/2018 22:00:57After restart each project's text field (for example placed on some GUIs) lose its connection with a font defined for them to use. Even if it wasn't a font that was actually deleted. The program acts like it couldn't re-index fonts, and therefore the problems occur

This is the case, in AGS GUI remember fonts by index, and when you delete anything in the middle, it will reorder following ones. If some GUI were referencing the last font, then it will keep pointing to font number beyond fonts list. So you need to manually fix all GUIs after this.

Also, make sure you do not use literal numbers when setting fonts in script, only script names, like eFontNormal, eFont10, etc.

As for the error itself, the error message is from running the game. Does it also occur in the editor, or game only?
Title: Re: AGS Crashes after unused font delete
Post by: Silent Bob on Fri 27/07/2018 22:09:05
As for now it only occurs while the game is running...
Title: Re: AGS Crashes after unused font delete
Post by: Crimson Wizard on Fri 27/07/2018 22:12:28
Right, I could reproduce exactly same error by assigning last font in the list to GUI, and then deleting that font and running the game.

I believe I might have fixed this bug in the 3.4.2 (WIP) version, but not in current release yet. But that's not 100% certain, need to double check this.

EDIT: Notice "gtags (11,5)" text in the error message, that probably means the bad font is on GUI #11, control #5.