AGS 3.6.0 - Beta 15

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

Previous topic - Next topic

eri0o

The library we are using is for 3D positional audio, I linked in the issue a discussion that explains it a bit more.

Dualnames



The sprite in question is this. Sprite 3819 is used as a normal graphic in a button. In general it seems to be weird because there are other UIs that appear on top of this UI [the top UIs get rendered [they are mostly transparent, but the UI that contains this button, doesn't really get rendered or is partially rendered].

I can take a video if it helps.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Crimson Wizard

#82
Quote from: Dualnames on Wed 27/04/2022 13:09:10
I can take a video if it helps.

It would actually help if I could get this sprite (or any other sprite that causes this problem) and exact gui setup it's used on; this would let me investigate the situation closely.

EDIT: ok, since I can see the import settings, then perhaps i could make a sprite myself. But I'd really need to know GUI setup.

Dualnames

#83
That'd be more complex to explain and would take more of your time [meaning we'd be lost in translation], I can rar the game files, if that helps? It's a big project in size.

EDIT: I could try thinning out the project, as well, so it's easier to send out, let me do that.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

eri0o

Can't you right click on the project explorer and simply export the GUI?

(And then load an empty project and import it and then place the resulting project here...)

Crimson Wizard

Quote from: Dualnames on Wed 27/04/2022 15:53:55
That'd be more complex to explain and would take more of your time [meaning we'd be lost in translation], I can rar the game files, if that helps? It's a big project in size.

EDIT: I could try thinning out the project, as well, so it's easier to send out, let me do that.

So, this is happening because button moves, and the latest engine has a mistake when it does not update the control's texture position, so it stays hidden behind the screen.

Crimson Wizard


Dualnames

That works on the testing build, checking the main build also works yay!
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Dave Gilbert

#88
Hello! Loving the latest beta so far, although I've uncovered a pretty major bug. :(

I use several struct arrays where I store various data. One example: a struct containing characters and their view numbers for various costume changes. I propagate these structs at the beginning of the game by calling a function at game_start. ("setupCharacterInfo();"  in this example).

Filling up the structs with data works fine when the game first starts up, but if I load a saved game, the data just disappears. Calling the setup functions a second time under "eEventRestoreGame" fixes it, but I feel like this shouldn't be happening in the first place.

If you need any more information, please let me know!

-Dave



Crimson Wizard

Quote from: Dave Gilbert on Thu 28/04/2022 18:20:27
Filling up the structs with data works fine when the game first starts up, but if I load a saved game, the data just disappears. Calling the setup functions a second time under "eEventRestoreGame" fixes it, but I feel like this shouldn't be happening in the first place.

Was that save made after you configured these structs in your script or earlier?

Dave Gilbert

I configure the structs on game_start, so definitely after.

Crimson Wizard

So, we found that Strings in script are not saved properly.

Here's the fixed build:
https://cirrus-ci.com/task/5389912781357056

Dave Gilbert

Thanks! That fixed the problem.

Crimson Wizard

#93
Updated to Beta 5
(use download links in the first post)

A bit unexpected, but this is suddenly a larger feature update, complementing improvements to Overlays in this version.
Additionally this update contains a way to set volume for the frame-linked sounds during animation (see below).
Normally this is not a good thing to add so much stuff while the version is already far in Beta, but some of these changes were in plans for 3.6.0 for a while now, and they appeared to be not too difficult to make. At the same time, I believe that's the last of the feature additions for 3.6.0 engine.

Editor:
- Fixed extracting room template files (other than the blank template).
- Fixed editor displaying unhandled exception if the room script which user is trying to open was missing. Instead it will now open a blank script.

Compiler:
- Support using float literals when defining default values for function arguments.

Script API:
- Extended all Animate() commands by adding "volume" parameter, that defines relative volume of the frame-linked sounds for the duration of this animation.
- Added Character.AnimationVolume, defining relative volume of the frame-linked sounds.
- Added Overlay.CreateRoomGraphical and CreateRoomTextual. Use these two functions to create "room overlays": that is - overlays that display a sprite inside the room, sorted among other room objects, characters and walk-behinds.
- Added readonly Overlay.InRoom property that tells if this is a room or screen overlay.
- Extended Overlay.CreateGraphical() with a new "clone" parameter that tells whether to assign a sprite index, or make a sprite's copy owned exclusively by this overlay. The former will save program memory but make overlay update if the sprite is edited later. The latter is meant primarily for backwards compatibility. Overlay.CreateRoomGraphical has the same param. Default is false (don't clone).
- Added Overlay.Graphic property that lets you change overlay's sprite after it's created.

Engine:
- Perfomance improvement to overlays: engine will not make a sprite copy when they are created whenever possible (non-dynamic sprites), or when told not to by the script command that creates a custom overlay.
- When reporting script errors, engine will print callstack for all the active script "threads": for example, if there's Wait() function called and error happened in repeatedly_execute_always, then it will print both actual error's location, and Wait() call's location.
- Added "load_latest_save" and "show_fps" options to config (in "[misc]" category).
- Fixed overlay may fail to be created sometimes, if previously another overlay had been forcefully removed when changing rooms (this is an ancient bug which existed for many years).
- Fixes GUI controls not getting redrawn in correct locations if they were moved at runtime.
- Fixed script's String type could be stored in game saves with a wrong length.
- Fixed Game.InputBox() duplicating key input if new key handling mode is active.



NOTES: On Overlays

So, from this update 3.6.0 allows to dynamically create overlays not only "on screen", among GUIs, but also inside rooms - among the characters and objects. Overlays still remain a simplistic kind of object that does not have any automated behavior, so it won't interact with anything inside the room, but it still may be sorted among other objects there by manually setting Overlay.ZOrder. So, for example, if you'd like room overlay to change its "baseline" along with its vertical position, you will have to do something like this in rep-exec:
Code: ags
over.ZOrder = over.Y + over.Height;

In overall, I believe that room overlays open new possibilities in making temporary visual effects in the game, and also may help to script custom game elements from ground up (as they have no additional functionality on them).

On overlay's sprite cloning. This may not be well known, but for "historical reasons" (tm) overlays were doing a copy of the sprite when created. This was fine while overlays were limited to 20 in previous versions, but now when they are unlimited this could become an annoyance. So now, firstly, engine may decide when it is safe to not do a sprite copy (normally - when using regular non-dynamic sprites), and secondly Overlay.CreateGraphical now has an additional parameter which tells whether to make a copy of the sprite or not (not by default). This parameter may be used for backwards compatibility with some old scripts, where dynamic sprites are used to create an overlay and then discarded.

After the above change, it now makes sense to have Overlay.Graphic property, similar to Object.Graphic etc. This changes the overlay's sprite without having to recreate overlay.
Note that there's no Animate function for them, but you may script one yourself, using timers, and changing Overlay.Graphic.

NOTES: On Animation volume

Previously there was no way to choose the playback volume of sounds linked to the animation frames. The only related property was Character.ScaleVolume.
Now there are two ways to do this. First of all, there's Character.AnimationVolume. It sets the default relative volume of any frame sounds. For example, here's a primitive example of how you can make the footsteps volume depend on the character's X position in room:
Code: ags
player.AnimationVolume = player.x * 100 / Room.Width;

Secondly, each Animate() function (for Button, Character and Object) now has a "volume" parameter. Passing -1 (default) will ignore this, but when a 0-100 value is passed, that value overrides the frame sound volume.

EDIT: hmm, i just realized that maybe Animate() should not override Character.AnimationVolume, but also be relative to it... According to the idea that character is "sound emitter" with it's volume and Animate() is playing an individual sequence, then the volume of the sequence should not be louder than the volume of the emitter?

Crimson Wizard

Started writing "Upgrade to 3.6.0" topic in the manual, in case someone needs an explanation on most noteable changes:
https://github.com/adventuregamestudio/ags-manual/wiki/UpgradeTo36
(work in progress)

Dave Gilbert

Hello! Noticing a problem with the searching feature.

Normally, when I do a search for a word or phrase in my script, I press "control-F", select "look in current project", and then press enter. I can click on the results and them I am taken to the point in the script where word/phrase resides.

However, it now only works properly when searching in a standard script. For dialog scripts (meaning dialog that is written in the dialog editor), it just opens up the dialog script without highlighting the search result. Here are examples:




Crimson Wizard

Quote from: Dave Gilbert on Sun 15/05/2022 00:34:34
Hello! Noticing a problem with the searching feature.

Normally, when I do a search for a word or phrase in my script, I press "control-F", select "look in current project", and then press enter. I can click on the results and them I am taken to the point in the script where word/phrase resides.

However, it now only works properly when searching in a standard script. For dialog scripts (meaning dialog that is written in the dialog editor), it just opens up the dialog script without highlighting the search result. Here are examples:


I tried this, and for me it finds the dialog line, but does not highlight it, just puts cursor there. Could you double check if that happens to you, or it does not even move to the line itself?

Dave Gilbert

Yes, you are correct. The cursor is put on the proper line, but when the script opens it is displayed at the beginning on the page. I have to press a key to jump down to where the cursor is.

FanOfHumor

#98
I've been encountering an error" Undefined token overplay".Overplay is a function and is imported in overplay.ash but when I call it sometimes it works and sometimes it doesn't.I don't think theres anything wrong with how I placed the script although I could be wrong.I also encountered this same error for another function a few days ago.After a while it seemed to just fix itself with no changes done to it.
heres the .scm scripts
https://www.filemail.com/d/khuayqkknjpyaol

Crimson Wizard

#99
Quote from: Pajama Sam on Thu 26/05/2022 19:15:15
I've been encountering an error" Undefined token overplay".Overplay is a function and is imported in overplay.ash but when I call it sometimes it works and sometimes it doesn't.I don't think theres anything wrong with how I placed the script although I could be wrong.I also encountered this same error for another function a few days ago.After a while it seemed to just fix itself with no changes done to it.
heres the .scm scripts
https://www.filemail.com/d/khuayqkknjpyaol

If this error happens during compilation, "Undefined token" means the script does not see the function. The usual case is that your module with function "overplay" is located below the module that tries to use it ("fishtank") in the list of modules. In AGS script modules can only see functions declared above them.

SMF spam blocked by CleanTalk