Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Crimson Wizard

#1761
I found that this is caused by removal of character name length restriction, but looking at exact set of changes in code I was not yet able to pinpoint the exact mistake.
#1762
Quote from: Dave Gilbert on Thu 21/12/2023 20:12:22I made a small test game using the bubble module and the current update, and of course the bubble works perfectly!  :-D  So there must be something specific about my game that isn't playing nice with the update. I will see if I can narrow it down.

I could reproduce this using the "Old Skies" sources from October. Now I am going step by step back to see which changes in the engine cause this.
#1763
charBubbles contains a pointer to SpeechBubble. If it's null, then it was not created for some reason.

This is too complicated to have any ideas, as this involves a script module and a game script that use that. Can I have any test game where this may be reproduced?

EDIT: Okay, I will try with the game sources I had.
#1764
This is a C/C++ style of treating script headers, however, I suppose, this may be reworked for AGS by checking whether there's an unclosed comment or other region (like #ifdef block), and forcefully close it at the header's end with a warning.
#1765
Quote from: Kastchey on Thu 21/12/2023 16:05:22So, in case it helps anyone else... The reason was that I had left an open /* in a custom script right above Custom Dialog GUI.
And while this did not visually comment anything out in the next script, I'm sure it quietly contracted the disease, making the engine treat the init() function as commented out.

If you're speaking about script headers, then the reason is that when compiling a script all the headers meant for this script are merged together into a single text, thus treated as one.
#1766
Updated to Beta 15
(Please use download links in the first post)

Common features:
- Removed length limits for: Game name, savegame folder, Character's script name and regular name (description), Inventory item's name (description), Mouse cursor's script name, Audioclip's script name.

Editor:
- For non-Windows build targets Editor will fix config containing Direct3D graphics driver option and set OpenGL instead.
- Fixed sprites may get wrong transparency settings after "Crop sprite edges" operation.
- Fixed deleting collapsed "region" in script would sometimes lead to portion of the script undeleted but staying invisible.
- (Possibly) Fixed a "Index out of range" exception in Script editor, related to the "script location" drop-down list, which could occur at random circumstances while working with the script, and any Color Theme is enabled.

Engine:
- Print some info about memory usage when reporting a "Out of memory" error.
- Fixed Display and Say commands treating the second met "&" sign as a voice-over token too (they must only check the first one in string).
- Fixed `@GAMENAME@` label was not updated if Game.Name got changed in script.
- Fixed a crash when switching to a cursor mode which has no sprite assigned (regression in previous Beta).

Engine Plugin API:
- Expanded IAGSStream interface, which was added in previous Beta.

iOS:
- Updated port for 3.6.*.

Windows:
 - Fixed a rare bug when the Windows engine could fail loading the game for no good reason. This error is related to a bug in Windows SDK 8.1.
#1767
Display command is "super blocking", which means that no script is run when it's on the screen, not even "repeatedly_execute_always", and so it cannot be skipped by a command from the script. So will be unusable in your case.

For your case the solution is to not use Display at all, but use other means: GUI with label, or Overlay.CreateTextual, combined with Wait function.
If you are using GUI with a label, then you just need to assign new text to a label on its step.
If you are using Overlay, then you would need to save created overlay in a variable, and call Remove to delete old overlay before creating a new one with a longer text.

EDIT: I might also mention a TypedText module, that does this effect in many kind of ways:
https://www.adventuregamestudio.co.uk/forums/modules-plugins-tools/module-typedtext-0-7-0/
#1768
This is wrong:
Code: ags
overlay.CreateTextual(50, 80, 120, Game.SpeechFont, 15, "Blah blah blah.");

CreateTextual is a static function, which means that it has to be called "from type", rather than from a variable, and its result assigned to a variable:
Code: ags
overlay = Overlay.CreateTextual(50, 80, 120, Game.SpeechFont, 15, "Blah blah blah.");

This is assuming that lowercase "overlay" is your variable.
#1769
Quote from: imagazzell on Tue 19/12/2023 01:02:44How else can I keep the overlay displayed when leaving the function in which it was generated?

As noted in the manual, for example here:
https://adventuregamestudio.github.io/ags-manual/Overlay.html#overlaycreategraphical

Quoteif the Overlay variable goes out of scope, the overlay will be removed. Hence, if you want the overlay to last on-screen outside of the script function where it was created, the Overlay* variable declaration needs to be at the top of the script and outside any script functions.

To put it simpler, make a global variable and store Overlay* pointer there.
The Overlay is removed either when all variables that reference it go out of scope, assigned null, or when you explicitly call Overlay.Remove.

This issue is the same with every other dynamically created object in AGS: String, Overlay, DynamicSprite, DrawingSurface, File (and anything I forgot).
#1770
There's a curious finding we did just yesterday, thanks to a user who reported a weird script error.

It turned out that there's an error in particular version of Windows SDK (something that engine is using), which may cause compiled game fail to load in unknown circumstances. To put it simply: this happens when some unknown factors match.
Engine cannot detect this, so usually you would just get an unrelated game error, something about not being able to load something, or game being corrupt etc.
Thankfully, this seems to be very rare.

I found some hack to work around this, so there will be another patch to 3.6.0 in a short while.

I believe that this may be affecting any version starting with AGS 3.5.0.

There may be a workaround for game authors too, which usually is to change something in game data layout. For example, a user, who reported this problem, solved it by moving small piece of the script into another module.

#1771
To be honest, I do not think this audio support will be added in 3.6.1 version. Previously I had a thought that it may be, but time have passed, and now I'd rather like to finalize 3.6.1 as soon as possible, and move on. This addition that lets plugin play sounds through the engine is formally working, but there is a number of issues, both in design and technical, which have to be resolved to make it stable and convenient in a long run. So, this will be likely added to AGS 4, or another minor update after 3.6.1, if there will be one at all.
#1772
Quote from: Custerly on Mon 18/12/2023 06:11:38@Crimson Wizard thanks for the tip re the extra pixel on line spacing in labels. Does this mean that since my font height is 36 pixels per line, it actually takes up 37 pixels per line when printed to a label?

This means that it prints lines of text in "font height + 1" steps. This is different from how GetTextHeight calculates it, as it does not have this +1.
If there's only one line then you won't notice anything.

Latest AGS has GetFontHeight and GetFontLineSpacing functions that may be easier to use if you only need to know these values.

EDIT: I cannot answer other questions now, I will find more spare time later today.
#1773
I might post here, there's undocumented behavior when label wraps text, which might affect required height.
Following is a list of known cases:
https://github.com/adventuregamestudio/ags-manual/issues/103
#1774
Quote from: imagazzell on Sun 17/12/2023 06:53:13I don't think I want to use SayBackground, because I want the character's speaking animation and speech clip to play like normal. I suppose, with no other option, I could fake it with SayBackground, a non-blocking animation of the character's talking view, and audio clips of the lines of dialogue, but that seems a bit clunky and sacrifices lip-syncing.

Making a custom (blocking or non-blocking) speech is a rather common case in AGS games today, and it's done more or less how you described:
- Display speech using a text overlay or gui (note that SayBackground is practically a equivalent to Overlay.CreateTextual);
- Play voice using Game.PlayVoiceClip (available since AGS 3.5.0);
https://adventuregamestudio.github.io/ags-manual/Game.html#gameplayvoiceclip
- Lipsyncing is a bigger issue. I've heard there's a module for custom lipsyncing, but I do not know a lot of details about it, so that's something to investigate: https://www.adventuregamestudio.co.uk/forums/modules-plugins-tools/module-totallipsync-v0-5/

To make the above easier to use, these actions are coded into a extender function, so to be able to call like "cCharacter.MyBackgroundSay(...)".
https://adventuregamestudio.github.io/ags-manual/ExtenderFunctions.html

All the above makes sense if you plan to have this behavior throughout the game. If you only need this few times in game, then perhaps it's better to design the event differently, to make things easier for you.
#1775
From my understanding this is simply a collection of texts and images drawn on screen and moved up?

Someone should write a new module where credits are moved using Tween (at least in time represented by milliseconds, with floating point math etc).
#1776
The second problem is because the syntax of a function call is wrong.

Code: ags
dgOpt1_OnClick(GUIControl *control, MouseButton button)

This is a function declaration, it mentions the argument types and argument names.

When you call a function, you need to pass actual values there, for example:

Code: ags
dgOpt1_OnClick(dgOpt1, eMouseLeft);


I'm not sure if this will work at all in your case, because neither gui buttons nor regular "on_key_press" function works during dialog options. Maybe this is not standard dialog options, but some kind of a custom dialog system?
#1777
Quote from: heltenjon on Mon 11/12/2023 20:05:46Hmmm...could he solve it by making the key a character instead? A cKey could enter a room when iKey is dropped?

This sounds like a Kyrandia-style system. I recall there have been a Kyrandia template around, which let drop items anywhere (and do some other things), but i never used it myself, so cannot tell how convenient that would be:
https://www.adventuregamestudio.co.uk/forums/modules-plugins-tools/template-kyrandia-bass-hybrid/

For scripting this yourself, Characters is a traditional way to represent global objects (objects that could be in any room). Since AGS 3.6.0 dynamically created Room Overlays may be used for this purpose, except they would require more scripting, and manually scripted interaction.
#1778
Quote from: Khris on Mon 11/12/2023 18:33:55Note that I don't use "else if" here because these commands are all different so the parser will never match multiple commands at the same time.

I'd like to point out that it may still be suitable to use "if/else if" sequence here, because in the above code the script will keep testing for other variants unnecessarily after one of them succeeded.
#1779
Quote from: Dave Gilbert on Mon 11/12/2023 14:23:01So for the first one, "SUM" is calculated by taking all the delays of each frame in the animation and adding them up?

That is correct.

Quote from: Dave Gilbert on Mon 11/12/2023 14:23:01And for "(animation speed * N)", which animation speed does this refer to? The speed you set for the character? Or the "delay" you set when you type in the Character.Animate command?

I had some strange memory twist, and forgot that character's property only refers to specific animations (walking, speaking).
So, the animation delay is a delay arg you pass into Animate.
EDIT: sorry I need to double check this, I will be back :)
EDIT2: alright, I confirmed, and Character's AnimationSpeed is basically "Walking Animation Speed" only. In the past it was also affecting Idle animation, but no more since 3.6.0.
#1780
I suppose that may be possible.

Animation is played frame by frame, advancing a frame when the delay runs out. Frame delay is a sum (addition) of character's animation speed property (which is, counter-intuitively, a "delay"), and individual frame's delay.
The frame's delay is measured in "game updates" (aka "game frames", aka "game loops", aka "game ticks").
The real duration of a "game frame" is 1/GameSpeed seconds.

So, suppose you have N frames in animation.
The duration of full animation in game frames would be a
Code: ags
    DUR_gf = SUM(each frame delay) + (animation speed * N)
And the duration in real time would be
Code: ags
    DUR_s = DUR_gf / GameSpeed
SMF spam blocked by CleanTalk