Recent posts

#11
It's an open question.

I just want to know if there's some progress in the direction of polymorphism (whether be through casting or interfaces or whatnot).
- If yes, then please point me in the right direction (I did a search in the forums but couldn't find anything).
- If not, then don't waste time providing workarounds. It's OK, I know how to do it the hard way. I'm only asking if there's now an easy way ;)

===========

By polymorphism I mean this kind of scenarios (pseudo code) :

Code: ags
managed struct Parent {
    int Id;
};


managed struct Child extends Parent {
    String whatever;
};


Parent DoThingWithAnythingDerivedFromParent(Parent obj) {
    return obj;
}

void game_start() {
    Child child = new Child;
    Child child2 = (Child) DoThingWithAnythingDerivedFromParent(child);
}

#12
Thanks

SOLVED
#14
Editor Development / Re: My personal list of proble...
Last post by Crimson Wizard - Sat 19/07/2025 21:52:54
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.
#15
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;
};
#16
Editor Development / Re: My personal list of proble...
Last post by Crimson Wizard - Sat 19/07/2025 21:11:18
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.
#17
Editor Development / Re: My personal list of proble...
Last post by Monsieur OUXX - 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 :-)


Quote from: Monsieur OUXX on Fri 18/07/2025 18:26:43We may have this as a setting in Editor Preferences though.
Yes. Most people will want more than one backup for sure -- by googling, I can find several instances of people panicking because the backup got instantly overwritten by the new file (the corrupt file).

I think there should be two backup files, and people with large projects would go to the settings to reduce it to only one (not the other way around -- not one as default and people needing to increase to two).
#18
Editor Development / Re: My personal list of proble...
Last post by Crimson Wizard - Sat 19/07/2025 19:27:05
There was this ticket opened a while back in regards to the project saving, maybe related:
https://github.com/adventuregamestudio/ags/issues/1177

Another ticket is related to changing sprite format storage:
https://github.com/adventuregamestudio/ags/issues/1281



Quote from: Monsieur OUXX on Fri 18/07/2025 18:26:43- Then, I re-opened AGS and I helped the game going back to a healthy state by doing "File -> Restore all sprites from source".
- But then the sprites themselves were of course still missing.

What do you mean? please elaborate. That operation is supposed to restore sprites in game so long as the sources are available. Were they available?

Quote from: Monsieur OUXX on Fri 18/07/2025 18:26:43- Or, at least, there should be more than one backup file generated. It's no longer 2005, we could have 10 of them (I'm exaggerating to make a point) and it would still use close to no resources.

Depends! I've seen game projects where sprite files were several GBs large.
We may have this as a setting in Editor Preferences though.
#19
Editor Development / Re: [FEATURE REQUEST] - Edit b...
Last post by Crimson Wizard - Sat 19/07/2025 17:40:50
This is now added in 3.6.2 Patch 2.
#20
Quote from: Baguettator on Sat 19/07/2025 06:34:40Another thing I just thought about : possibility for buttons having their text displayed on several lines (same way as labels) ?

This is already supported in the latest version, you just need to enable WrapText property.
SMF spam blocked by CleanTalk