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

#221
Quote from: Baguettator on Sun 06/08/2023 08:42:21Is it a limitation of AGS Engine ? Or a limitation of engines in general ? Or something like that could be possible ?

This is the current limitation of the AGS engine. But frankly this is more of a design issue rather than a technical one. In other words, it's not too hard to create a button at runtime, it may be complicated to logically bind this with how the engine treats the objects created in the editor.
This is further complicated by AGS not supporting linking functions to events in script, which means that even if you create a button in script, you won't be able to receive click events from it.

Supporting doing this is theoretically in TODO (for a long time).

Quote from: Baguettator on Sun 06/08/2023 08:42:21My idea is that I'm making a "map editor" for something, so I have to place tokens (tiles, events, starting zones, objectives, characters etc...) to create a map. I can't imagine doing this another way than using GUIControls

For the purpose of having unknown number of objects on screen there are 3 existing options:
1. DrawingSurface. This is a traditional method. You may drawing anything, but you will have to store all the object properties in your custom structs, including their positions.
2. Overlays. They are not limited anymore since 3.6.0. The benefit of these for the map editor is probably that you don't have to script redrawing a map when moving/deleting these, and they may use fast scaling & rotation (may be not exactly important for the map editor).
3. Using a pool of objects. Will limit number of simultaneous objects on screen, so probably not the best solution for the map editor.

With the first two options you have to detect clicks yourself. How this is done depends on your use of them. If this is a "tiled" map editor that might be rather simple, since you can calculate which tile the player clicked on and proceed from that. Overall this is a big technical topic, which I won't like to cover in this forum thread.
#222
Quote from: Ghostlady on Sun 06/08/2023 01:45:30Is there a way to globally turn up the volume whenever a sound is being played?

Please clarify what do you mean by this? Do you mean changing the sound volume in game, or altering it for a particular sound temporarily while it plays and then lowering back down? or something else?

On a side note, as this no longer seem related to upgrading a game, I might suggest opening a new forum thread for the new technical questions.
#223
Quote from: Gal Shemesh on Sat 05/08/2023 19:35:06Yep, that would probably be the best way to doing it. Though, the pure black is considered as transparent... Any way to make my GUI color a solid black instead of using a background image?

Apprently not, because it's AGS.

The closest you may with the BackgroundColor is RGB 0;4;0.
#224
Quote from: Gal Shemesh on Sat 05/08/2023 16:10:07
Quote from: Crimson Wizard on Sat 05/08/2023 15:50:33Are you using FadeOut/FadeIn functions for translation, or a GUI?
Just the built-in transitions, either the default behavior of FadeInAndOut or manually calling for them with the FadeIn() and FadeOut() functions.

The mentioned method of adding zorder is for when you are using GUI as a fadeout.

This thread mentioned several separate methods:
- built-in fadeout run during transition;
- calling FadeIn/Out yourself in script.
- using GUI to fade the screen.

First of all, I believe the mouse cursor will only stay above the fade effect if you are using GUI. It never is drawn above a built-in fade effect, regardless of how it's run (by a script command, or automatically during transition).

Secondly, if you're using gui as a replacement for the mouse cursor, then you also need to adjust it's zorder to be higher than the "fade" gui.

EDIT:
in regards to the Wait cursor:
The Wait cursor is NOT shown during fade, regardless of how Fade is run.
Testing FadeIn/Out commands, I can see that the cursor disappears completely during FadeIn, but not manual FadeOut (idk why).
#225
Quote from: Gal Shemesh on Sat 05/08/2023 15:24:57Thanks for the suggestion. However, not matter what high number I put in the ZOrder, the cursor remains below the transition...

Are you using FadeOut/FadeIn functions for translation, or a GUI?
#226
This thread should be updated, there's a slightly different API prepared for merging to AGS 4:
https://github.com/adventuregamestudio/ags/pull/1759
#227
There's already a forum thread dedicated to the new Joystick API, only it's posted in the Editor dev section for some reason:

https://www.adventuregamestudio.co.uk/forums/editor-development/experimental-joystick-in-ags-ags-3-6-0-35-beta15_joystick/
EDIT: moved to Engine now.

I suggest  to update that instead.
Will close this thread as too old, and has no details.
#228
Quote from: Khris on Fri 04/08/2023 11:04:14Sounds like the built-in room fade is hard-coded into the engine in a way that completely halts the main loop, whereas the script command is simply a blocking function like any other which doesn't pause the main loop.

Not sure it qualifies as a bug, but a lot of legacy stuff is somewhat inconsistent internally and should be "fixed" at some point, I guess.

This is likely not a legacy inconsistency, but, on contrary, a new issue caused by how audio commands "sync" with the new audio subsystem in 3.6.0.
I can swear I already fixed this before, but maybe I fixed it for some other command rather than FadeOut.

@Gal Shemesh, please tell which version of AGS are you using exactly?
#229
Well, I don't believe this is our task to fix this. The best course is to report false positive to Microsoft.

I found some other applications had the similar issue:
https://github.com/winsiderss/systeminformer/issues/1631

Their devs suggested reporting false positive here:
https://www.microsoft.com/en-us/wdsi/filesubmission
#230
Quote from: Radiant on Sun 30/07/2023 20:53:00Thanks. Turns out this option was already disabled (despite it being an imported project). However, oddly enough, enabling this option seems to fix the problem.

Maybe this Windows Security does not recognize something if the exe is different.

Honestly, I would not recommend enabling this option, since having data attached to exe may cause additional issues. For instance, all big AGS games that have this are starting up for 5-10 seconds on my PC (and winsetup too), I believe that's because antivirus scans whole exe (which may be few GBs because of the data).

I've been wondering if I did a mistake by leaving this switch.
#231
IsMusicPlaying may be a wrong check actually, because it does not let to test if particular music is playing.

If you are using imported audio clips, then there are few other methods, but the most straightforward is to save the current music channel, returned by the aMusicN.Play() command, in a global variable of type AudioChannel, and check that. In this case the code would be:
Code: ags
    if (musicChan == null || musicChan.PlayingClip != aMusic3)
        musicChan = aMusic3.Play();



There's another option, which I will mention just in case, where you write a custom function that scans all the channels and checks if particular clip is playing:
Code: ags
bool TestIfClipPlaying(AudioClip* clip)
{
    for (int i = 0; i < System.AudioChannelCount; i++)
    {
        AudioChannel* ch = System.AudioChannel[i];
        if (ch.IsPlaying && ch.PlayingClip == clip)
            return true;
    }
    return false;
}

If you put this function in a global script, you then may use it in every room like
Code: ags
    if (!TestIfClipPlaying(aMusic3))
        aMusic3.Play();



or even....
Code: ags
// Start the clip unless it's already playing, returns the audio channel which has it playing
AudioChannel *PlayIfNotPlaying(this AudioClip*)
{
    for (int i = 0; i < System.AudioChannelCount; i++)
    {
        AudioChannel* ch = System.AudioChannel[i];
        if (ch.IsPlaying && ch.PlayingClip == this)
            return ch;
    }
    return this.Play();
}

which may be used like
Code: ags
    aMusic3.PlayIfNotPlaying();
#232
Quote from: Ghostlady on Sun 30/07/2023 21:10:32I'll check those out.  One other thing.  In the old version, if there is music playing, I can travel from room to room without it interrupted.  What it is doing now is restarting the music from the beginning each time I enter a room.  Its the same song.  How do I fix that?

Please tell how the music was commanded to play? Is it by script command, or using "play music on room load" setting?

In the last case, the Editor would convert this setting to a command in script, which will start a music anew every time you enter a room.
If that's the case, then you need to add a condition that checks if this music is already playing. With old commands that would be IsMusicPlaying() probably.
#233
Hmm, I know that for old commands like PlaySound, there are two things that control the volume level:
- old function SetSoundVolume
- SetDigitalMasterVolume, which is now also set as System.Volume.

The resulting volume should be a multiple of these two factors (if seen as percentages).
#234
Updated to Alpha 3
(Please use download links in the first post)

Contains updates and fixes from 3.6.1 Beta 6.

Other changes:

Common:
- Removed support for '[' as a linebreak character in text.
  Please use a standard '\n' from now on.

Editor:
- Support loading PNGs with transparent chunks as Room Masks.

Engine:
- Fixed flipped button frames displayed without transparent parts.




You might have noticed that there was not much of new additions to AGS 4 updates besides than merging 3.6.1 updates in. There are currently couple of major changes in works:
- Translation migration from classic AGS TRS format to a more widespread PO format, which should make working with translations safer, and make adding further translation features easier.
- Joystick/Gamepad script API.

I believe these two will be introduced in the next AGS 4 Alpha update.
#235
Not exactly, but AGS has been a case of unending false positives from several antiviruses in the past. Notably Avast does not like AGS very much.

Something that may be tried is - disabling "Attach game data to EXE" in General Settings. I think it's disabled by default in contemporary templates, but may be enabled for older imported projects.
When this is disabled, Editor will produce 2 files: game.exe and game.ags, where game.exe will be the pure engine with nothing attached.
The purpose is that Antiviruses don't like it when a program writes something to exe file, or reads from it. I recall a real case when the AV kept rescanning AGS game which tried to load sounds from appended data, causing game to slowdown.
#236
First of all, I think this may be a case of XY problem, as Khris likes to call it, that is when a user asks how to do something, while the problem may have a better solution.

So I'd propose to investigate what the problem is. Is current music volume is fine overall, maybe it should be lower from the start?

From what I heard, when doing sound design for the game, experienced game developers align all of their music and sounds to some "baseline", ensuring that all of them play nicely together.

The in-game solution is to provide volume sliders per sound type (music, sound) and let player adjust them. You may set the starting values for these sliders to some default values.

Setting a volume of one type in AGS is done using Game.SetAudioTypeVolume command.



If you really want to lower the music only during the sound, then it's possible to use Game.SetAudioTypeVolume to lower music temporarily too. Probably for convenience you should make a extender custom function that both plays a sound and lowers music volume:

Code: ags
AudioChannel *PlaySound(this AudioClip*)
{
    Game.SetAudioTypeVolume(eAudioTypeMusic, 50, eVolExistingAndFuture);
    return this.Play();
}

Such function may then be called similarly to how you call standard Play:
Code: ags
aSoundClip.PlaySound();


But since you also need to rise the volume back once the sound finishes, then you'll have to:
1) save that it has been lowered in some global variable; this may be done in that custom function I suggested above:
Code: ags
AudioChannel *PlaySound(this AudioClip*)
{
    Game.SetAudioTypeVolume(eAudioTypeMusic, 50, eVolExistingAndFuture);
    MusicWasLowered = true; // assuming you created this global variable
    return this.Play();
}


2) keep testing whether any sound is playing in function repeatedly_execute_always. The latter may be done by scanning all channels and checking their playback type:
Code: ags
function repeatedly_execute_always()
{
    if (MusicWasLowered) // assuming you created this global variable
    {
        bool found_one;
        for (int i = 0; i < System.AudioChannelCount; i++)
        {
            AudioChannel* ch = System.AudioChannels[i];
            if (ch.PlayingClip != null && ch.PlayingClip.Type == eAudioTypeSound) // or whatever it's called in your game
            {
                found_one = true;
                break;
            }
        }

        if (!found_one)
        {
            Game.SetAudioTypeVolume(eAudioTypeMusic, 100, eVolExistingAndFuture);
            MusicWasLowered = false;
        }
    }
}
#237
Quote from: Snarky on Sun 30/07/2023 11:05:00Also no, though @Grundislav has made a version that supports background conversation, so perhaps you can ask hem. But I'm not sure that AGS allows SayBackground calls while Say is running in the first place?

I don't remember details about SayBackground, but I believe that you should be able to create textual overlays during blocking commands from rep-exec-always, because the game update and redraw is still run during blocking actions.

Note I said "from rep-exec-always", as that's the only callback that runs during blocking commands; this is also something to keep in mind.

Overall, I've never researched how SpeechBubble works, but I imagine that in ideal world it should support running multiple non-blocking bubbles, and optionally running one at a time as blocking.
#238
Quote from: Ghostlady on Sun 30/07/2023 03:14:15How do I get to my music and sound files within AGS?  It looks like the PlaySound command is not valid with this version.  It is playing a sound file but it seems quite low and hard to hear.

Contemporary AGS supports running all the old commands, if they are enabled in Backwards Compatibility section of General Settings. The backwards support is also one of the official features of this engine, so if something does not work right, that might be considered an engine mistake, and planned for fixing.


But besides that, what is your goal? is it to keep as much of the old script as possible, or to convert your game to the new scripting style?

The new audio system is explained in the manual, these two topics may be useful:
https://adventuregamestudio.github.io/ags-manual/MusicAndSound.html
https://adventuregamestudio.github.io/ags-manual/AudioInScript.html
#239
Quote from: SirLean on Sat 29/07/2023 16:43:27Should I aim to animate the flying bird animation as an object? or should I already set it as a character?

Would that make any size difference in the game file?

You are overthinking this.
Characters and objects on their own are just 15-20 numeric properties; they are a microscopic value in the total size of the game.
What matters is: graphics and sounds, the resolution of rooms.
#240
Quote from: SirLean on Sat 29/07/2023 15:04:242) when importing a sprite, I always, since I started making this game unchecked the "Remap palette (8-bit image only" option. Should I keep it checked to make the game weigh less? or activating it will lower the sprite quality too much?

This option is strictly for 8-bit graphics, it has nothing to do with sprite compression.
What it does is replaces the sprite's colors with the colors from game palette.

It's ignored for non-8-bit sprites.
SMF spam blocked by CleanTalk