Jibble

Author Topic: MODULE: SpeechBubble v0.8.0  (Read 26961 times)

Re: MODULE: SpeechBubble v0.8.0
« Reply #120 on: 21 May 2021, 19:39 »
-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.
« Last Edit: 21 May 2021, 19:44 by Crimson Wizard »

Snarky

  • Global Moderator
  • Global Moderator
  • Mittens Lord
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
Re: MODULE: SpeechBubble v0.8.0
« Reply #121 on: 21 May 2021, 19:59 »
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).

Re: MODULE: SpeechBubble v0.8.0
« Reply #122 on: 21 May 2021, 20:17 »
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.
« Last Edit: 21 May 2021, 20:46 by Crimson Wizard »

Snarky

  • Global Moderator
  • Global Moderator
  • Mittens Lord
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
Re: MODULE: SpeechBubble v0.8.0
« Reply #123 on: 21 May 2021, 20:59 »
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.

Re: MODULE: SpeechBubble v0.8.0
« Reply #124 on: 21 May 2021, 21:22 »
Okay, I will probably begin pulling minor changes back into 3.5.*/3.6.0. There was a number of small but useful additions.
« Last Edit: 21 May 2021, 21:24 by Crimson Wizard »

Dave Gilbert

  • Mittens Vassal
  • AGS Baker
  • Eye see you.
    • Lifetime Achievement Award Winner
    • Dave Gilbert worked on one or more games that won an AGS Award!
    •  
    • Dave Gilbert worked on one or more games that was nominated for an AGS Award!
Re: MODULE: SpeechBubble v0.8.0
« Reply #125 on: 02 Jun 2021, 00:41 »
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

Re: MODULE: SpeechBubble v0.8.0
« Reply #126 on: 02 Jun 2021, 01:18 »
This error can be prevented changing SpeechBubble.asc, Line 726 from
Code: Adventure Game Studio
  1.     if(_bubbleOverlays[id] != null)
  2.       _bubbleOverlays[id].Remove();
to
Code: Adventure Game Studio
  1.     if(_bubbleOverlays[id] != null && _bubbleOverlays[id].Valid )
  2.       _bubbleOverlays[id].Remove();
(minimal project: TestOverlaySpeechBubble.zip)
« Last Edit: 02 Jun 2021, 01:58 by eri0o »

Dave Gilbert

  • Mittens Vassal
  • AGS Baker
  • Eye see you.
    • Lifetime Achievement Award Winner
    • Dave Gilbert worked on one or more games that won an AGS Award!
    •  
    • Dave Gilbert worked on one or more games that was nominated for an AGS Award!
Re: MODULE: SpeechBubble v0.8.0
« Reply #127 on: 02 Jun 2021, 02:02 »
Worked like a CHARM! Thank you.  :=

Snarky

  • Global Moderator
  • Global Moderator
  • Mittens Lord
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
Re: MODULE: SpeechBubble v0.8.0
« Reply #128 on: 02 Jun 2021, 09:29 »
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.

Re: MODULE: SpeechBubble v0.8.0
« Reply #129 on: 02 Jun 2021, 12:44 »
I think this Overlay.Remove is a good candidate for replacing error with a warning though...

Dave Gilbert

  • Mittens Vassal
  • AGS Baker
  • Eye see you.
    • Lifetime Achievement Award Winner
    • Dave Gilbert worked on one or more games that won an AGS Award!
    •  
    • Dave Gilbert worked on one or more games that was nominated for an AGS Award!
Re: MODULE: SpeechBubble v0.8.0
« Reply #130 on: 14 Jun 2021, 23:15 »
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

  • Global Moderator
  • Global Moderator
  • Mittens Lord
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
Re: MODULE: SpeechBubble v0.8.0
« Reply #131 on: 15 Jun 2021, 10:04 »
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

  • Mittens Vassal
  • AGS Baker
  • Eye see you.
    • Lifetime Achievement Award Winner
    • Dave Gilbert worked on one or more games that won an AGS Award!
    •  
    • Dave Gilbert worked on one or more games that was nominated for an AGS Award!
Re: MODULE: SpeechBubble v0.8.0
« Reply #132 on: 15 Jun 2021, 14:11 »
Cool! Thanks.

Re: MODULE: SpeechBubble v0.8.0
« Reply #133 on: 15 Jun 2021, 21:30 »
Not 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.
« Last Edit: 16 Jun 2021, 23:48 by Crimson Wizard »

Re: MODULE: SpeechBubble v0.8.0
« Reply #134 on: 15 Jul 2021, 01:13 »
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

Re: MODULE: SpeechBubble v0.8.0
« Reply #135 on: 11 Oct 2021, 16:55 »
Hi,  Can we use this module for animation or pictures in ballon (No any text)?
My official site: http://www.pershaland.ir/

Dave Gilbert

  • Mittens Vassal
  • AGS Baker
  • Eye see you.
    • Lifetime Achievement Award Winner
    • Dave Gilbert worked on one or more games that won an AGS Award!
    •  
    • Dave Gilbert worked on one or more games that was nominated for an AGS Award!
Re: MODULE: SpeechBubble v0.8.0
« Reply #136 on: 11 Oct 2021, 20:21 »
Hi. I recompiled in the latest version of 3.6, and I still get this error:

Quote
SpeechBubble_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".
« Last Edit: 11 Oct 2021, 20:40 by Dave Gilbert »