AGS 3.6.0 - Beta 15

Started by Crimson Wizard, Sun 20/03/2022 20:23:39

Previous topic - Next topic

Crimson Wizard


Pax Animo

#241
I see there are changes to Key mod flags and I've read the gihub document.
I'm confused and now have an issue where any key is pressed now brings up a save game interface.

EDIT: The save interface simply pops back up after closing it and pressing another key.
[imgzoom]https://imgur.com/0a3AwOtl.png[/imgzoom]

This is what i'd be expecting to happen which worked prior to the update.

Code: ags
function on_key_press(eKeyCode keycode, int mod) 
{ 
  if (player.Animating == false && bAbilityBar1.Visible) {
  //
    if (keycode == eKey1 && gTargetPortrait.Visible) {
    //
     .....
    }
  }
}
Misunderstood

Crimson Wizard

#242
@PaxAnimo, do you have a call to SaveGameDialog anywhere in the script? If yes, please post it here. Or you don't and it just appears for no reason?

Also please tell if you have the "Use old-style keyboard handling" in the general Settings set to true or false? (it's in Backwards Compatibility)

EDIT: Oh, I actually see, it appears on any key...

Pax Animo

I do not have any call to SaveGameDialog, appears for no reason.

I have "Use old-style keyboard handling" set to false. (I've now set it to true and this seems to be working correctly)

It was happening on almost any key, apart from, return/ctrl/shit/arrows and F key's, possibly a few others.
Misunderstood

Crimson Wizard

#244
I will have to remake the update and upload again later when I fix this.

Restored old links for now.

eri0o

#245
Erh, just a guess, in game_run, if agskey is 0 we could skip everything in check_keyboard_controls.

Because if usetup.key_save_game is not set, it will be 0, and then agskey will match in some cases?

Crimson Wizard

#246
Quote from: eri0o on Tue 19/07/2022 16:43:37
Erh, just a guess, in game_run, if agskey is 0 we could skip everything in check_keyboard_controls.

The "no key" case is already skipped. But I'm using "CompatKey" for special controls, and it happens to be 0 in some cases when the normal key value is not 0.

Pax Animo

Another issue I've encountered in the beta 11,

When switching rooms in the editor the main background is not loading and has to be reset each load via the background pull down menu.
Misunderstood

Crimson Wizard

#248
[deleted]

Pax Animo

#249
Nice and quick previous fixes.

Came across something a bit odd in the view editor, the loops are now centre rather than left alignment as before,

Misunderstood

Crimson Wizard

Alright, I will have to fix more

Crimson Wizard

Fixed above bugs and reuploaded Beta 11 again, but this is probably the last quick fix, because I'm abusing releases. If there are more bugs found, I'll be fixing them later.

Updated to Beta 11
(use download links in the first post)

Editor:
- Added zoom control on Character pane. On View panel the animation preview is now scaling along with the loops.
- Fixed editor silently enabling all available Build Targets when upgrading a pre-3.4.0 project. This could be very inconvenient as there are several of them supported now.
- Fixed scripts were preloaded using incorrect encoding when opening a ANSI/ASCII project.
- Fixed editor was not preventing from entering Character's and AudioClip's ScriptName too long for the engine to handle.
- Fixed View animation preview stopping at frame 100 (if loop contains over 100 frames).
- Fixed script autocomplete sometimes was not updated right after opening a script.
- Fixed extender methods not showing up in the function combolist in the script editor.

Script API:
- Key mod flags are now included packed in the Wait* functions return value.
Please refer to update article in the manual: https://github.com/adventuregamestudio/ags-manual/wiki/Globalfunctions_Wait#global-functions-wait

Engine:
- Fixed Wait* functions returning incorrect mouse button values when skipped by the mouse click.

Pax Animo

Hey, just an idea.

I'm planning on developing my current project whilst keeping up to date with new engine builds so if you ever need a pre release beta tester, if I may be of help, give me a shout.
Misunderstood

Dave Gilbert

Quote- Dialog scripts now too can open help topics for keywords or script functions under cursor on F1.

Took awhile to get around to testing this. Pressing F1 in the dialog script works just fine when it involves built-in AGS commands (it opens up the manual's definition of the function as expected), but for custom functions it just opens up the manual and nothing else. When I am in other scripts (room scripts, modules, and the like), I can right click on a command and select "go to definition" to send me to the declaration of the function. Is it possible to enable this for dialog scripts?

Crimson Wizard

Quote from: Dave Gilbert on Fri 22/07/2022 15:30:15When I am in other scripts (room scripts, modules, and the like), I can right click on a command and select "go to definition" to send me to the declaration of the function. Is it possible to enable this for dialog scripts?

I may look into this later today.

Crimson Wizard

#255
Quote from: Dave Gilbert on Fri 22/07/2022 15:30:15When I am in other scripts (room scripts, modules, and the like), I can right click on a command and select "go to definition" to send me to the declaration of the function. Is it possible to enable this for dialog scripts?

So, I looked into this, and apparently the full and proper support of autocomplete, keyword highlighting and "go to definition" in dialogs would require to rewrite like a half of the script editor.

Right now the dialog editor is made like a very stripped copy-paste version of the script editor, with some essential things not implemented. I found it is more or less possible to share most menu and context menu commands, and have a basic support for "Go to definition", but that "basic support" won't work for all symbols. Namely, it won't work for any local variables and their members (the reasons will be difficult to explain here), and maybe something else.

For example, if you have a struct "MyStruct" declared somewhere, with members "int a" and "int b", and in dialog script you type:
Code: ags

    MyStruct ms;
    ms.a = 10;

then "Go to definition" will work on "MyStruct", but won't work neither on "ms", nor "a".

Local variables are also not working with autocomplete at all in dialog. For example, typing "player." will open autocomplete list for Character's members, but having "Character *ch;" and typing "ch." won't open any autocomplete.

Long story short, if I add these commands now, they will be working with a number of exceptions.

To do this properly, we'd have to create a new parent class of editor, which has all the autocomplete, and searching for definitions supported correctly, and then derive both Dialog pane and Script pane from it. As 3.6.0 is closing the completion, making big changes like that is not desired.


EDIT: I've made an experimental version that shares most of the Edit menu and context menu commands between regular script and dialog editors, if anyone likes to try:
https://cirrus-ci.com/task/6417042428395520

vga256

#256
I am not sure if this is a bug, or is historically how AGS works, so I apologize if this turns out to be a scripting error or a case of incorrect expectations.

I'm using the latest beta, and I noticed that when I run:

Code: ags

Object *roomObject = Object.GetAtRoomXY(testDropPosition.x, testDropPosition.y);
if (roomObject != null)
    Display("Found object!");


if the roomObject's "Clickable" property is set to false, no object is found at that location. If the roomObject's Clickable property is set to true, an object is found as expected.

This behaviour does not appear to be mentioned anywhere in the documentation, so I'm wondering if I've either mis-scripted something, this is historically how AGS has worked, or if I've hit a bug with the beta. Happy to share the project source if that helps to replicate.

Crimson Wizard

Quote from: vga256 on Fri 29/07/2022 21:20:22
if the roomObject's "Clickable" property is set to false, no object is found at that location. If the roomObject's Clickable property is set to true, an object is found as expected.

Yes it's a default AGS behavior, it's exactly the same with any other type of object. Also afaik it does not show @OVERHOTSPOT@ for nonclickable objects.

The solution have been to remember old value, set Clickable, check, and then revert Clickable to old value.

Maybe we may change this in the future versions, like, providing a "test_clickable" parameter to this function, or something.

vga256

Thanks for the clarification.

Crimson Wizard

Updated to Beta 12
(use download links in the first post)

Again, unplanned, this update amends both script API and engine plugin API. The script API changes are small, more like "filling the gaps", where it was trivial.
The plugin api changes are related to font plugin and drawing support.

Editor:
- Fixed "Goto Definition" not working for Enums and Defines (macros).

Script API:
- Added AudioChannel.SeekMs(), complementing PositionMs (as the Seek() function interprets position differently depending on the audio format).
- PlayVideo() now supports an option to play both game's and video's audio track simultaneously.
An updated information on PlayVideo may be found here: https://github.com/adventuregamestudio/ags-manual/wiki/Multimedia#playvideo
(this will be compiled to a manual eventually)

Engine:
- Added SpriteFont plugin to the list of builtins, for ports that use ones. SpriteFont plugin is updated to support custom "Clifftop Games" font variants.
- Added "--background" command line option which forces the game to continue running when in background (aka multitasking mode).
- Fixed AudioChannel.Position/PositionMs could show doubled values for short repeating clips.
- Fixed AudioChannel.Seek and Position are not working correctly for WAV clips (still not working for MOD and MIDI clips).

Engine Plugin API:
- Added IAGSEngine::GetGameInfo() function which returns information about the game, such as its title and GUID.
- Added new render callback AGSE_POSTROOMDRAW, for handling drawing inside the room above all room objects.
- Added IAGSFontRenderer2 interface, expanding the original font renderer interface, improving font plugins support.
- Added ReplaceFontRenderer2() and NotifyFontUpdated() functions.

The new IAGSFontRenderer2 looks like this:
Code: cpp

class IAGSFontRenderer2 : IAGSFontRenderer {
  virtual int GetVersion();
  virtual const char *GetRendererName();
  virtual const char *GetFontName(int fontNumber);
  virtual int GetFontHeight(int fontNumber);
  virtual int GetLineSpacing(int fontNumber);
}

and was primarily added to let font plugins to return font's height and linespacing without utilitizing GetTextHeight.

SMF spam blocked by CleanTalk