Jibble

Author Topic: Extended Alarcost Dialog Choices Issues  (Read 275 times)

VampireWombat

  • Not a chupacabra
    • I can help with animation
    • I can help with backgrounds
    • I can help with characters
    • I can help with play testing
Extended Alarcost Dialog Choices Issues
« on: 15 May 2018, 14:19 »
When I made dialog choices yesterday using the Extended Alarcost template with the size changed to 640 x 360 that it made all the options overlap and clicking on them does nothing.
So I decided to start over with the default size. With the default template and nothing changed, I find that the default dialog displays fine, but none of the options can be selected. I tried clicking, using arrow keys, numbers, and even function keys. Nothing.
I used AGS build 3.4.1.1.12 on an Acer Laptop running Windows 7 if that information is in any way helpful.
I compiled and tested both the template version and the 640x360 version on my laptop and my desktop running Ubuntu and the issues persisted.

Any help or workaround would be great, thanks.
« Last Edit: 15 May 2018, 14:50 by VampireWombat »

Re: Extended Alarcost Dialog Choices Issues
« Reply #1 on: 15 May 2018, 14:40 »
You could please post a link to the template topic or download link?

VampireWombat

  • Not a chupacabra
    • I can help with animation
    • I can help with backgrounds
    • I can help with characters
    • I can help with play testing
Re: Extended Alarcost Dialog Choices Issues
« Reply #2 on: 15 May 2018, 14:47 »
Sorry about that, I probably should have thought of that...
Template thread.

Re: Extended Alarcost Dialog Choices Issues
« Reply #3 on: 15 May 2018, 20:10 »
Oh, I got it.

You need to go to General Settings, Backwards Compatibility and enabled "Use old-style custom dialog options API". This will make options work again.

As for the bad text coordinates, this is because the template script is written incorrectly. It actually uses literal numbers 320 and 200, and similar, in script when calculating dialog option positions. I suggest replacing these with System.ViewportWidth and System.ViewportHeight, as well as values relative to these (like "y = System.ViewportHeight - 40" instead of "y = 160") where necessary.

Look for "dialog_options_get_dimensions" function in GlobalScript - this is where it all starts.


PS. It really saddens me when people who write modules assume the game size in script.
« Last Edit: 15 May 2018, 20:15 by Crimson Wizard »

VampireWombat

  • Not a chupacabra
    • I can help with animation
    • I can help with backgrounds
    • I can help with characters
    • I can help with play testing
Re: Extended Alarcost Dialog Choices Issues
« Reply #4 on: 15 May 2018, 20:32 »
Thank you very much for the help.
Changing the option did fix it.
I will have to go through the GlobalScript when I have time. But the main issue is resolved. Thank you once again.

Re: Extended Alarcost Dialog Choices Issues
« Reply #5 on: 15 May 2018, 20:46 »
Oh, there is actually more there. You may find this line in dialog_options_render() function:
Code: Adventure Game Studio
  1. //ypos += GetTextHeight(info.DialogToRender.GetOptionText(i), eFontNormal, info.Width - 10);
  2. ypos += 10; // assumes text height is 10
  3.  

So, if you use different font, or font is scaled, this goes wrong. Normally one should use GetTextHeight function to know the height of the line of text, but they got it commented out for some reason. I have a certain guess why, you should not use "info.Width - 10" there, but "GetTextWidth(...) + 1" if you want to make sure it does not including text wrapping in calculation.
« Last Edit: 15 May 2018, 20:49 by Crimson Wizard »