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

#1
Quote from: Baguettator on Yesterday at 06:29:27"Why is this an issue to make one in script, and which "fps loss" are you speaking of?"
=> It's not an issue, I can make it by script, just I wanted to ask if it was going to be done in AGS :)

Having a gui following cursor, or located e.g. at the bottom of the screen, is trivial, this is same as making one for hotspots.
Having a text selected by gui control under the cursor is also simple. There are 2 fast ways I can think about:
1. Have 2-dimensional array of strings, and use Gui ID + GuiControl's ID as array indexes. This may be done in AGS 3 too (2-d array can be emulated).
2. Use GuiControl's Custom Property to tell its description (custom properties are added to Gui Controls in AGS 4).
Both solutions should be fast  and simple. 2nd solution seems more convenient, especially now when custom properties are displayed right in the list of object's properties.

Quote from: Baguettator on Yesterday at 06:29:27New issue I encountered : if I use Display function during a Room Transition, the mouse disappears (is not visible but usable). Room Transition is set to CrossFade wen it happens.

Do you mean that it disappears for the duration of transition, or also not become visible after transition?
Where exactly "during transition" do you use Display in which script event? Please give exact details when reporting issues.
#2
This is intended behavior, corresponding to a standard behavior of all the C-like languages (and maybe many others), where a local variable inside a block overrides a variable of same name outside of a block.

Similarly, it should be possible to have local variables, overriding global variables of the same name.
#3
Quote from: Baguettator on Fri 01/08/2025 20:50:17- I can't explain why, but in some cases, I encounter a weird thing : when several buttons (2 or three in my case) are one on another, the mouse click doesn't seem to apply to the upper one (the one with the higher ZOrder). I'm using the last AGS 4.0 build, and it was not doing this in 3.6 that I used before. It is something similar that I reported before, with OnCLick functions switching between HotSpots/Buttons with no reason, but this last thing I don't encounter anymore.

We cannot do much unless there are steps to reproduce. If you could try and narrow down this case to a minimal setup, or figure out under which conditions this happens, then we may diagnose this issue.
If not, then perhaps you could send me your game and tell how do I observe the issue there?

Quote from: Baguettator on Fri 01/08/2025 20:50:17- Is it planned to have a natively built-in system of "description" for GUIControls ? Like, the mouse goes over the control, and a text (usually the description of what it's going to do) appear near the mouse. Just like in windows. It could be very practical, and if built-in, it could be without fps loss.

No, this was never asked before, and never planned. This does not seem like a good thing to have built-in either, rather something for a script module.
Why is this an issue to make one in script, and which "fps loss" are you speaking of?

Quote from: Baguettator on Fri 01/08/2025 20:50:17- I tried the "show usage" function by right clicking in a sprite in the sprite tab, I knew it was used for a button in a GUI but it said that it wasn't used by anything. Is there something broken in AGS 4.0 regarding that ?

I cannot reproduce this. Tried with default Sierra template, and "show usage" for sprite lists buttons that use that sprite. Please clarify the situation: which buttons is this sprite used on, and which exactly button properties is it assigned to?
#4
You can upgrade your game from version 3.3 (and even earlier) to the latest AGS 3.6.2.
Usually it may require to toggle few switches in General Settings -> Backwards Compatibility, if you got some errors in script.
The manual has some info about that:
https://adventuregamestudio.github.io/ags-manual/GeneralSettings.html#backwards-compatibility

For example, you may need to set "Script compatibility level" to whatever version you've been using prior to upgrading.

On another hand, if you like to start a new project with the old 9-verb template, you may get the template by downloading older version of AGS and copying template file out of Editor program files. Or download it directly from a github repository here:
https://github.com/dkrey/ags_9verb-template/releases
But I suspect that you may also need to use Backwards Compatibility options in this case.
#5
Do you mean that you need a 9-verb template files themselves, or that you want to upgrade an existing game to 3.6 but met some problems?
#6
Besides performance, you need to be aware that scaling 2D games down works quite badly, so anyone who cannot run in 2240x1440 will see a lossy, distorted image. It's much safer to do 720p or 1080p and then let engine scale it up to your bigger display, but then it will also run well for most people.

EDIT:
In theory it may be possible to readjust game camera based on display resolution, and have it display less portion of a scene at once. I've never tried, but I believe it may be done. Whether it will be convenient or not for the player, I cannot tell.
#7
Just for the reference, all the template sources are available in our repository here:
https://github.com/adventuregamestudio/ags-template-source

You may download any files, or all the source awhole.
#8
I still don't know what were you trying to do, but if you like to use GUIs in dialog, here's another method.

Dialogs may have their options turned on and off, and there's also a rule that if only 1 option is enabled at a time, then it's run automatically as soon as Dialog starts.

In summary the method therefore is this:
1. Disable all dialog's options.
2. Bring your GUI on and let player do something with it.
3. Depending on player's actions, enable a single dialog option, and start a dialog.
4. After dialog stops, disable that option and continue.
#9
No, you cannot have any GUIs active during a dialog.

If you like to have buttons for dialog options, look into the Custom dialog options rendering:
https://adventuregamestudio.github.io/ags-manual/CustomDialogOptions.html
Or use existing module:
https://www.adventuregamestudio.co.uk/forums/modules-plugins-tools/module-customdialoggui-1-9/

If you want certain game GUIs to work along with the dialog, then you'll have to either script your own custom dialog system, or script particular scene without a use of a standard dialog. I cannot give any other advice here without knowing details about what you are trying to do. Please tell more about your case and goal.
#10
Quote from: Snarky on Tue 22/07/2025 17:30:10I think I can imagine use-cases where this would be useful, but is it such a generally useful feature that it makes sense to build it into the engine rather than rely on some fairly simple scripting with the Tween module?

That is why in my earlier post I added a "if we'd like to implement "tweening" into the engine".
#11
Quote from: eri0o on Tue 22/07/2025 12:39:04
Quote"tweening" into the engine (at least to functions like Animate).

This looks interesting but I don't understand how tweening works in a frame by frame animation. Is this for the frame offsets?

No, my meaning was frame timing. If the whole animation duration is represented as 1.0, the tween controls the current progress between 0.0 and 1.0, and engine would choose a frame based on that value.
#12
Quote from: greg on Tue 22/07/2025 13:58:16I'm observing a seam between contiguous walkbehinds.  (I noticed this with patch 1, and I'm seeing it with patch 2 as well.)

You mention patch 1 and patch 2, did it happen before, or started only with 3.6.2 patch 1?
Does this appear with particular graphic driver / graphic filter combination, or all of them?
Which is the game scaling ratio which you run with (native game res vs window size)?

I've seen a similar issue in much older games, and that was caused by uneven texture scaling which caused subpixels. The only way to fix that seemingly was to either adjust walk-behinds by couple of pixels or replace walk-behind with an object and let it overlap another a little (although I cannot tell if that might work in your case).
#13
I believe we may have both, both methods seem useful.

https://github.com/adventuregamestudio/ags/issues/2792
#14
So View editor needs either a "Reverse frames" or a "Paste in reverse" command, or both of them in the context menu.

Also, while checking the View editor I noticed that there's no regular "Copy/Paste" command acting over selected frames, only "Copy loop/Paste loop". Probably that's because there was no way to select multiple frames before (this ability was only added in the latest versions).


Quote from: eri0o on Tue 22/07/2025 02:08:12About the runtime CW mentioned, I guess it would use a third parameter like eForwardsThenBackwards or something.

I had this proposal about expanding animation parameters:
https://www.adventuregamestudio.co.uk/forums/engine-development/proposal-expand-animation-range-repeat-parameters/
#15
Are you speaking of reversing loops in the editor, or at runtime?

If runtime, there's a Direction parameter in Animate function, does it work for this case?
https://adventuregamestudio.github.io/ags-manual/Character.html#characteranimate
https://adventuregamestudio.github.io/ags-manual/Object.html#objectanimate

EDIT: or are you speaking about COPY / PASTing selected frames in reverse order?
#16
Quote from: Gal Shemesh on Sun 20/07/2025 16:44:11So many things that I used to make workaround codes for were fixed.

Often I don't know if something is broken unless users report that. When users don't report and resort to workarounds, the bugs tend to stay for months, if not years. The majority of engine bugs fixed in this patch were reported by a person who was not making own games, but playing existing older games.
#17
There's a "user cheat sheet" for the new scripting features in AGS 4:
https://github.com/adventuregamestudio/ags/wiki/New-compiler%27s-end-user-cheat-sheet



The type casting is possible for managed types, in both ways.

1. Upcasting, child -> parent, was always possible, and is resolved at compile time.
2. Downcasting, parent -> child, is supported in AGS 4 using C#-like "X as Y" syntax, and is resolved at runtime:
Code: ags
Button* btn = control as Button;
MyChild* child = parent_ptr as MyChild;
This works with any managed struct, whether built-in, declared by user or from plugins (but plugins must register the types correctly for this to work, because it's based on checking typenames at runtime).
Downcasting does not throw any errors in case of failure, but returns "null" if pointer cannot be cast to the requested type. This is also useful if you iterate through an array of parent pointers, which may point to multiple child types, and check which actual child type each object is.



Method overriding is currently NOT possible, because there's no proper support for virtual function table. So you still cannot have separate implementations for the same function in parent and child structs.
This may be worked around somehow. For example, one could store a "my type id" in a parent class, or test which type the "this" pointer is, make a downcast, and delegate to particular child's function. That's just one idea, perhaps there may be other solutions.
#18
The 4.0 Alpha 23 is released now, with 2 important fixes:
- Fixed memory leak in room compilation, so hopefully "out of memory" errors should not occur (unless you load too much stuff at once).
- Fixed error popup closing automatically if there's a "watch variables" panel.
#19
Updated to Alpha 23
(Please use download links in the first post)

This update contains all the additions and fixes from 3.6.2 Patch 2 (except ones related to backwards compatibility).

Own changes:

Editor:
 - Fixed memory leak occuring when compiling room scripts, which may eventually lead to "out of memory" errors.

Compiler:
- Compiler checks arguments of text formatting functions where possible, and reports mismatching args during compilation.
- Fixed a wrong error was reported if a "null" is passed as a `const string` function parameter.

Script API:
 - Added GameInfo struct that contains meta-information about the game, such as developer's name, developer's URL, version, and so forth.
- Added VideoPlayer.FrameWidth and FrameHeight properties.
- Added VideoPlayStyle enum, PlayVideo() now uses VideoPlayStyle as "flags" argument.

Engine:
- Improved video playback's synchronization between video and audio streams.
- Fixed engine was closing the game too early while connected Editor is displaying a script error popup, if there was "Watch Variables" pane active at the same time.

Manual
The manual now contains WIP version of AGS 4 feature documentation. It will be improved and expanded further in the next updates.



EDIT:
The new GameInfo struct was added in script, this lets read the game and developer information that you can optionally enter in General Settings:
Code: ags
builtin struct GameInfo {
  /// Gets the game's title
  static readonly attribute String Title;
  /// Gets the game's description
  static readonly attribute String Description;
  /// Gets the game's developer's name
  static readonly attribute String DeveloperName;
  /// Gets the game's developer's URL string
  static readonly attribute String DeveloperURL;
  /// Gets the game's genre description
  static readonly attribute String Genre;
  /// Gets the game's release date as a DateTime instance
  static readonly attribute DateTime* ReleaseDate;
  /// Gets the game's release version, represented as "X.Y.Z.W" string
  static readonly attribute String Version;
};
#20
Quote from: Monsieur OUXX on Sat 19/07/2025 20:59:46
Quote from: Crimson Wizard on Sat 19/07/2025 19:27:05That operation is supposed to restore sprites in game so long as the sources are available. Were they available?
No, they were not -- that's what I meant. The project is about 10 years old, most of the sources are long gone and exist only inside the project's Sprites. The "of course" was not meant to be sarcastic :-)

If you like, then you can create new sources and bind your sprites to them.
Go to Sprite Manager, right click to bring a context menu, and choose "Create source files for sprites with missing...". That command does the "export sprites" operation combined with reassigning sprite's source path.
SMF spam blocked by CleanTalk