MODULE: SpeechBubble v0.8.0

Started by Snarky, Sun 03/12/2017 11:28:04

Previous topic - Next topic

Crimson Wizard

#120
Quote from: Snarky on Fri 21/05/2021 12:23:25
-Weird bugs related to the custom blocking functions (redundant as of upcoming 3.5.x version with Wait() extensions)

I need to clarify, these Wait extensions are no longer in 3.5.x, they were moved to ags4 development, as well as many other recently implemented script functions. I made a decision to only keep perfomance/backend updates in 3.* branch from now on and only add new script API if there's a critical gap in functionality due to recent changes or something (like happened with GUI.Visible and "popup at y" guis).
All the new API is going to ags4 now.

ags4 branch already features a new script compiler written by fernewelten that has many things fixed and new good things like array.Length property. We were also discussing what's required for pointers in pointers, but that was not implemented just yet.

In theory this compiler could be backported to ags3 branch too, as it does not change any data formats and not reliant on anything else in the editor or engine (except for array.Length)... maybe we could see to it when 3.6.0 comes close to completion. Or maybe we should just focus on releasing a preliminary ags4 version sooner.

Snarky

Ah, that's a shame, since the lack of this Wait() API is the cause of a lot of the issues with this module. As it stands, it's not possible to fully replicate the AGS .Say() advance-to-next-line behavior in script (there's no WaitMouse(), and you cannot reliably tell whether a WaitKey()/WaitMouseKey() ended because of a click or because it timed out, much less which particular keyboard key was pressed).

Crimson Wizard

#122
Actually I am no longer sure if that's was a right thing to do. I keep making so many bad planning decisions and this development became an endless mess.
I worried that will end up working on several versions in parallel again (and it happened anyway). Some changes we had were rather risky (like new font outlines could produce new font errors and require further optimization and I did not have time to work on that), but others were relatively minor. I also did not know how much time will it take to complete 3.5.1, and in the end everything takes much more time than expected. And I wanted to move to ags4 development completely and stop working on ags3, but with ags4 it's not clear when the first version will be ready. We still do not have a proper milestone for it and because of that it's impossible to tell when to not begin coding new functionality there. For example, now I think that it might be a good idea to try having first 4.0 version with Unicode support, as that can be a breaking change.

So now I'll probably will have to begin porting certain changes back to 3.5.1 or next minor 3.5 or 3.6 update. Need to review what was in the dropped branch again to see what may be worth pulling over.

Snarky

I didn't mean to talk you out of the decision. I think putting the focus on AGS 4 (and, critically, dropping the requirement for backwards compatibility) is the right strategy. Whether that means no further development (apart for bug fixes and critical issues) on the 3.x branch, or if less radical changes can be ported there without complicating the work too much, you will have to decide.

And I want this module to be compatible with 3.4 and earlier versions, so I would not actually be able to rely on the new API in any case.

Crimson Wizard

#124
Okay, I will probably begin pulling minor changes back into 3.5.*/3.6.0. There was a number of small but useful additions.

Dave Gilbert

Hiya! So I encountered a problem. Hopefully it's easy to workaround.

I've been using the SayBackgroundBubble() command to display non-blocking conversations. It works fine, unless I leave the room while the bubble is still on the screen.

If I do that, I get the error ""ScriptOverlay::Remove: overlay is not there!"

It feels like the game automatically removed the bubble from the screen when I left the room, but the command to remove it is still queued up.

I have tested this by waiting for the conversation to be finished (with no bubbles on the screen) before changing rooms. The game did not crash.

Any light shedding appreciated!

Thanks,

-Dave

eri0o

#126
This error can be prevented changing SpeechBubble.asc, Line 726 from
Code: ags
    if(_bubbleOverlays[id] != null)
      _bubbleOverlays[id].Remove();

to
Code: ags
    if(_bubbleOverlays[id] != null && _bubbleOverlays[id].Valid )
      _bubbleOverlays[id].Remove();

(minimal project: TestOverlaySpeechBubble.zip)

Dave Gilbert

Worked like a CHARM! Thank you.  :=

Snarky

Yeah, that looks right. Thanks eeri0o, and Dave for reporting the bug. (I think I've heard it reported before, but don't remember when/where.) I'll incorporate this fix into the next update.

Crimson Wizard

I think this Overlay.Remove is a good candidate for replacing error with a warning though...

Dave Gilbert

I upgraded to AGS v3.5.1.7, and when I compiled I got the error:

"SpeechBubble_0.8.0.asc(1132): Error (line 1132): '.ViewportWidth' is not a public member of 'System'. Are you sure you spelt it correctly (remember, capital letters are important)?"

Setting script compatibility to 3.5.0 Alpha allows the game to compile properly.

Snarky

The module predates the new Viewport/Camera API that was introduced in AGS 3.5.0, and those API changes break it, as they do many other modules. Not sure why 3.5.0 Alpha is compatible. I'll ensure it is compatible in the next update.


Dave Gilbert


Crimson Wizard

#133
Quote from: Snarky on Tue 15/06/2021 10:04:32Not sure why 3.5.0 Alpha is compatible.

Camera API was added in a later alpha version.

The correct #ifdef for these functions is SCRIPT_API_v3507.

Crimson Wizard

Quote from: Snarky on Fri 21/05/2021 19:59:44
Ah, that's a shame, since the lack of this Wait() API is the cause of a lot of the issues with this module. As it stands, it's not possible to fully replicate the AGS .Say() advance-to-next-line behavior in script (there's no WaitMouse(), and you cannot reliably tell whether a WaitKey()/WaitMouseKey() ended because of a click or because it timed out, much less which particular keyboard key was pressed).

Now these are added to 3.6.0, could be already tried out if necessary:
https://www.adventuregamestudio.co.uk/forums/index.php?topic=58976.msg636637973#msg636637973

Mehrdad

Hi,  Can we use this module for animation or pictures in ballon (No any text)?
My official site: http://www.pershaland.com/

Dave Gilbert

#136
Hi. I recompiled in the latest version of 3.6, and I still get this error:

QuoteSpeechBubble_0.8.0.asc(1149): Error (line 1149): '.ViewportWidth' is not a public member of 'System'. Are you sure you spelt it correctly (remember, capital letters are important)?

But again, when I set "script compatibility" to 3.5.0 Alpha  it compiles fine.

Is there a way to workaround this or should I continue using the script compatibility setting?


EDIT:

OK this was pretty simple to fix. Just do a mass search and replace for the following instances

Replace System.ViewportWidth with Screen.Width
Replace System.ViewportHeight with Screen.Height
Replace GetViewportX() with Game.Camera.X
Replace GetViewportY() with Game.Camera.Y

Once you replace all those, it compiles perfectly with Script Compatibility set to "latest version".

lorenzo

I'm having some trouble with this module and translations.

I've made a translation for my game, but the translated text won't show when using character.SayBubble. Instead, the bubble shows the original, untranslated line.

Basically, if I use the regular Say command, or Display, the translated text is shown correctly. But with SayBubbles, it shows the original text instead.

Is there a way to fix it? I'm using version 0.8.0 of the module.

Snarky

I haven't tested it, but I assume adding message = GetTranslation(message); to the top of SayBubble(), SayAtBubble() and SayBackgroundBubble() would do the trick. (Or if not right at the top, right under if(message==null) return;.)

lorenzo

Just tried it and it seems to work fine! Thank you, Snarky!

SMF spam blocked by CleanTalk