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

#2001
Well, it appears that globalChannelSFX pointer is never going to be assigned to anything. At least not when view frame sounds are played.

Unless you assign it somewhere else in your code?
#2002
Don't test for Game.IsAudioPlaying, test for the channel variable to be not null, that would be logically correct, as some sound type playing is not logically equivalent to your pointer having an assigned value.

After this the question would be, how comes a sound is playing but channel is not assigned. To find that out we'd need to know how do you start the sounds, and how do you assign these pointer variables.
#2003
First of all, afaik Tweens are blocking by default, meaning they will act one by one and not simultaneously.
The first tween you call is Position, but in AGS cameras are currently clamped to the room bounds, meaning you cannot move the camera unless you make it smaller than the room first. This explains why position does not work.
You need to pass non-blocking as a parameter to them to make them act together.
Probably you also need to do "Game.Camera.AutoTracking = false;" to disable camera following the player first.



Besides that, if you intend to zoom in "centered" over certain position, then I don't think you will be able to reliably achieve this using Tweens, unless you calculate parameters very carefully, including timing.

The thing is that when you do a "centered" zoom, your position must stay strictly in sync with the size, but these two tweens in your code act separately unrelated to each other.

I guess this might be a good feature suggestion to edmundito for the next Tween release.

The idea is to calculate a camera position so that the zoom is done "towards" a certain point. You may call this point a "anchor point".
In the simplest case, for each moment of transition:
   camera.X = anchor_x - camera.Width / 2
   camera.Y = anchor_y - camera.Height / 2
but this will cause jumps in a larger rooms, so another algorithm is necessary... Unfortunately I don't remember this by heart, and don't have more spare time at the moment, but maybe somebody else will write this here.
Idk if this may be helpful, but we have this code in the Editor, for calculating new position when zooming into the room:
https://github.com/adventuregamestudio/ags/blob/master/Editor/AGS.Editor/Panes/Room/RoomSettingsEditor.cs#L1127-L1150
#2004
From my memories of investigating the Editor's code, the root of this problem is that the whole subtree is getting recreated each time something changes in it. This is quite inefficient, and of course this causes the folders loose their collapsed/expanded state.

I do not know why this is done so, or since when, but it's possible that this behavior was introduced along with the folder support, which was done by contributors around the time the Editor went opensource (AGS v3.2.2).

The dumb approach would be to fix the consequence of the problem, for instance: remember which folders are expanded and restore them after the change. But the ideal approach would be to fix the root of the problem: find out why this subtree recreation is ever necessary, and change the code so that it's not performed.


EDIT: Opened a ticket:
https://github.com/adventuregamestudio/ags/issues/2105
#2005
Quote from: Gal Shemesh on Wed 23/08/2023 18:29:29I'd love to report this as a problem and much appreciate if this could be fixed. I'd also add to this a suggestion for an option to update the sound files from source, like we can do in the Sprites editor, so it won't be required to delete and re-import the audio assets.

I must note that this is already added in 3.6.1 Beta.

But, it was supposed to not require to delete and re-import an audio. Editor is supposed to update the audio automatically when detecting a change to the source file, but that did not work at all times for some reason.

This was discussed here:
https://www.adventuregamestudio.co.uk/forums/editor-development/feature-suggestion-replace-audio-clips-from-source-files/
#2006
If the folder behavior is countering the work, then this may be brought up as a problem, added to our bug tracker, and then someone who finds spare time will fix this eventually. Few similar problems have been fixed in the past.

Quote from: Gal Shemesh on Wed 23/08/2023 17:31:22I'm just thinking aloud here. I really don't know what it involves to change such things in the editor. So I just bring this up, and would like to know how you guys work or prefer to work with your audio files - do you still use the old fashioned way of numbering your audio files in external folders on your computer and set AGS to play them, or do you use the new audio system and import your audio assets into AGS?

These may be two options available now in practice (at least if working strictly in the Editor), but they are not the only possible options from the design perspective, and having external files don't prevent having a new audio system. Because the new audio system is not strictly in having to import audio by hand in the project tree, but in 1) giving meta data to audio items; 2) having OO-style script commands for audio, where audio items are referred to using script names rather than numbers.
There are several steps in managing of game assets, and they may be reviewed and redesigned separately.
To give a hypothetical example, we could have audio files of arbitrary names placed in a particular Audio folder, and have them automatically hooked up into the game, given script names based on their filenames.
#2007
Quote from: Gal Shemesh on Wed 23/08/2023 14:31:42So, is there a simple script way to setting this up? (and if there's an option to make the outline font a little transparent that would be even better!)

No.

Although, in theory, you might script displaying 2 lines of same text with 2 fonts one above another.
#2008
I was not certain what does "backward" means in this context; so it means backwards other way?
Expected behavior is that buttons, textboxes and listboxes are only given RTL support in 3.6.1. But labels were supposed to work correctly in 3.6.0.
Therefore, I still do not understand what you are saying about labels.
#2009
Quote from: Gal Shemesh on Tue 22/08/2023 14:53:28Only came to checking this now in the current game of a friend which I finished migrating to 3.6.0. The text boxes are also showing the Hebrew text backwards. I just checked saving in Hebrew and realized that writing in the text box is backward... I guess it's the same as with the labels.

I'm sorry, I don't know what this means. Is it working as expected or not as expected? How is this related to the above quote?
#2010
Quote from: Gal Shemesh on Tue 22/08/2023 14:17:55On the internal timer topic of the SayBackground overlay - how does it work? I mean, I tried using it in another place in the game to make a character speak in the background, writing his cues line by line and expected that there will be an automatic timer that removes each message after a period of time, but all I got was only the last message in the sequence showing up...

Because SayBackground is not a blocking action, the script continues further and all SayBackgrounds execute before screen can be redrawn once. Since only one speech may be displayed for same character at the same time, each next command was overriding the previous one.
If you need a sequence of non-blocking actions, that work in parallel to the rest of the game, the solution is to remember current "state" and test for this state in repeatedly-execute function(s).
In case of SayBackground, it returns an Overlay pointer, which you may store in a variable and test for Overlay.Valid to know when it's removed, so that you could continue with the next SayBackground.
The alternative is to use your own timer.
#2011
Quote from: PEd1 on Tue 22/08/2023 14:16:20if (CoininMachine == true) {
// player says the coin has been dislodged
// player gets drink added to their inventory
}
else if (CoininMachine == false) {
// player says nothing happened
}

Please note that this code may be simplified for two reasons: 1) checking boolean variable may be done directly without comparing with true/false; and 2) if you have only 2 possible variants, then there's no need for the second "if":
Code: ags
if (CoininMachine) {
// player says the coin has been dislodged
// player gets drink added to their inventory
}
else {
// player says nothing happened
}
#2012
Character.SayBackground creates a textual overlay in a position based on character's position.
The direct equivalent is Overlay.CreateTextual. This may be used to write custom speech too.

The benefits of using another character with SayBackground are that it calculates the position according to the same rule, and has its own internal timer for removing the overlay.
The benefit of using Overlay.CreateTextual is that you don't need dummy character(s). Note that unlike blocking speech, where you may use 1 dummy character always, for non blocking speech you need as many dummy characters as many simultaneous background speeches are there.
#2013
Quote from: Ghostlady on Mon 21/08/2023 04:27:51I figured it out.  I forgot about the saving and you can't add anything new to the rooms and I was using a save.

This is strange. When you restore a save the room's backgrounds still should be in place since these are not written to a save but taken from the current room file. Room bgs animate by default, so unless there was a "fixed bg" parameter set at the time the save was done, I cannot explain why animation was not playing.
#2014
Updated to Beta 7
(Please use download links in the first post)

Changes in this update:

Contains all fixes from 3.6.0 Patch 4.

Editor:
- In Dialog Script editor support most Edit menu and context menu commands from the regular Script editor, with a few exceptions.
- Added "Replace with all sprites from folder" command to the View editor's context menu.
- For Audio Clips in the project tree added "Force Reimport", "Force reimport all file(s)" and "Replace Source File" context menu commands.
- For Output Panel added "Copy selection" context menu command.
- Improved LipSync panel looks in case user's system has display scaling option enabled.

Engine:
- Support handling multiple mouse clicks per game frame, similar to how multiple key presses were supported since 3.6.0.
- Fixed program crash occuring when trying to get a screenshot from a save which does not contain one (regression in previous 3.6.1 Betas).

Android:
- Fixed crash in AGS Player when opening a games directory for browsing a list of games (regression in previous 3.6.1 Betas).
#2015
Quote from: Gal Shemesh on Sat 19/08/2023 17:26:51At this point I can only assume that the old engine version scripts were more forgiving.

I suppose that this is the only option here, as the above code normally should not even compile, not finding a bracket match.

By the way, I recommend to put checks in order by default, making the game progression easier to understand: test variable case 0 first, then case 1, and so forth.
#2016
There seem to be some kind of misunderstanding here, so I must clarify something first.

There's a big difference between a sequence of bare "ifs" and "else ifs". These are logically different, and of course must not be substituted during the migration process.

1. Sequence of ifs:
Code: ags
    int a = 10;
    int b = 20;
    int c = 30;
    
    if (a == 10)
    {
        Display("Checked first");
    }
    if (b == 20)
    {
        Display("Checked second");
    }
    if (c == 30)
    {
        Display("Checked third");
    }

Here every "if" is a separate check, not depending on the previous ones, and therefore will be checked one by one regardless of the previous check's result. In the above example the engine will display all 3 lines.


2. Sequence with else ifs:
Code: ags
    int a = 10;
    int b = 20;
    int c = 30;
    
    if (a == 10)
    {
        Display("Checked first");
    }
    else if (b == 20)
    {
        Display("Checked second");
    }
    else if (c == 30)
    {
        Display("Checked third");
    }

Here the if/else ifs form a single chain of checks, and the following "else ifs" will only be checked if the previous failed. As soon as one of the checks succeeded, the rest of the sequence is skipped. In the above example engine will display only the first line.

These are the syntax rules, common to any program language using these constructs. If the engine's behavior does not match this, this would mean there's a error either in script compiler or in the engine.

I tested this in 3.6.0 just in case, and both cases work as expected there. (But I suppose if they did not, users would notice this long time ago.)

If some script does not work as expected in your game, then please post the actual script example, as there may be other reasons for it to not work.
#2017
The "Find" dialog is in Edit menu, which is only visible when any script is open.


Can you double check that the room has a second background? Do you see it in the list of backgrounds when you open  "Background" list in the room editor, and is it visibly different from the first one?

Could you perhaps upload your room file to let us check it out?
#2018
Quote from: Baguettator on Thu 17/08/2023 22:06:15Hi ! How is working the Web Compiler ? Does a big game (like 1,5Go of size) can be launched on the web ? And how it works ? It allows multiplayers, or players on different computers can see the same game at the same moment and everyone can control it ?

I don't know about the size, so cannot answer that, but I suspect that large games won't work well in browser, the loading times will be huge.

I suppose that if multiple clients connect to the same web server running the game, then they will be able to send input to it, and see and control same game. That won't classify as "multiplayer" though, and AGS itself won't be able to distinguish clicks from different clients, for AGS it will look same as if multiple people were taking turns to click with the same mouse.
#2019
Quote from: Ghostlady on Thu 17/08/2023 19:29:10I don't have that set in the room script. Actually it's a very small script with not too much going on.

Do you have this in any of the global script perhaps? You may search for SetBackgroundFrame in the whole project using Find dialog in AGS.
What is the value of BackgroundAnimationDelay?

I don't think there's any other condition under which this won't run.
SMF spam blocked by CleanTalk