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

#261
There's a function called Game.DoOnceOnly which is meant to do something only once during the game.
It allows to avoid making lots of variables for each case when you need something like this.

https://adventuregamestudio.github.io/ags-manual/Game.html#gamedoonceonly
#262
Quote from: Gal Shemesh on Tue 25/07/2023 22:56:26And thanks for pointing this out! I didn't understand at first why I couldn't just use cCharacter along with my new custom function name and make it to work. So that extender you mention is the 'this' word before the Character*?

This is a respective manual entry:
https://adventuregamestudio.github.io/ags-manual/ExtenderFunctions.html

'this' in function argument defines which object type this function will belong to, while 'this' keyword in statements is a reference to "current object".

There's an article that overviews the object functions with 'this':
https://adventuregamestudio.github.io/ags-manual/OOProgramming.html
#263
Quote from: Ghostlady on Tue 25/07/2023 21:27:08I still have the original folder with everything in it including the compiled folder. The ac2game.dta file is available.

Alright, so you do have the project source, so unpacking the compiled game is not necessary.

Quote from: Ghostlady on Tue 25/07/2023 21:27:08The new AGS recognized this game and pulled it up in the list to "Continue an Existing Game" and "Continue a Recently Edited Game".  Continue an existing game will put me into the new AGS folder (do I need to copy all the files to there?) and the other will ask for an import but I am getting errors that it doesn't have access.  I don't know how to add an image with the errors.

I'm sorry, I could not really understand what did you do. What do you mean by "Continue an existing game will put me into the new AGS folder", is it AGS program files? If so, then no of course you should not put any files there by hand...

If you're getting access errors, then likely your project is located in a directory where you do not have a write permissions. Prior to AGS 3 the old editors would store the game projects inside their own program folder by default, but this is not the case now. You should normally store your projects in "User Documents", or anywhere else on disk where you have write access (can create folders and files).
#264
Quote from: Gal Shemesh on Tue 25/07/2023 17:47:24The only thing I'm trying to figure out now is how to set the dialogue selection options when the dialogue starts to show from right-to-left on the screen

If you mean that the dialog options cannot be aligned to the right side, that's apparently another thing that is not supported in AGS. There's a number of elements that may be drawn besides the option text, such as "bullet" icons and option numbers, all this has to be accounted if alignment is implemented.

At the moment the only alternative is to use custom dialog options render:
https://adventuregamestudio.github.io/ags-manual/CustomDialogOptions.html
#265
Quote from: Gal Shemesh on Tue 25/07/2023 14:47:54For the time being I managed to create this custom function (end of page 2) to make character speech without having the '&' pointer in the actual strings, and so the translation file is now cleaned from speech file pointers whatsoever.

I have to clarify, that this function type won't work with the settings "custom say/narrate function in dialog scripts", because it currently expects function to have a single string argument. This is tied to how dialog scripts are parsed, so I don't see any feasible way to support an arbitrary function prototype at the moment.

Therefore it has to be called explicitly in the dialogs (with "custom function" settings one may use classic dialog script in the form of "charname: sais").
#266
The situation with the speech numbers is actually even worse, because you can switch speech.voxes regardless of the language, that is have text in one lang and speech in another.

But if the speech numbers are different or missing in the translation, then it's possible to play mismatching voice-over in "original" language.

In other words, the speech numbers in translation of language A will be controlling voice-over in language B. And it is possible that neither of those two languages are the "original language", which means that we may not even have access to the texts in language B to check if numbers are matching, since these texts will not be loaded.

This is a very serious oversight by me in this feature, I did not realize this when adding support for multiple speech.voxes. I'm not really certain how to improve this properly now. Some very serious thought has to be put into this.

But at the moment it seems that you must keep same numbers everywhere, to avoid breaking things.

EDIT: So, apparently, the source text must enforce the voice number, contradictory to what I stated above.
the source text is always available (loaded in memory), therefore it's possible to check its contents.
But this will require numerous changes in the engine, because currently it's coded in such way that the original text is discarded and replaced by translation very early, and the translated text is then passed further into the speech functions.
Also, it's not immediately clear which potential problems this may cause.
This problem has to be documented and thought through very well before changing anything.

This is definitely not for 3.6.1 update.
#267
Quote from: Gal Shemesh on Tue 25/07/2023 11:11:42You gave me answers to everything, so I'll just wait for the next stable build with the buttons text fix and the set label to non-translating option for the score label.

This Translated property is already available in the 3.6.1, I discussed this in the "RTL" issue ticket, and noted in the changes list in the 3.6.1 release thread.

Quote from: Gal Shemesh on Tue 25/07/2023 11:11:42personally I'd prefer to have the pointer to the speech file only from the editor script side, so it won't show as part of the string. The reason is that it makes the translation process more fragile, as there's more place for errors which will only occur in the translated line if they're not written properly, either by a mistype or by forgetting to put the pointer at all. And then you can find yourself have to go all over your translation file again line-by-line to fix this - happened to me just last night.

This is how the translation system works in AGS at the moment - it writes source texts as translation keys as-is, also regardless of any meta data in them. The speech sign is only one potential problem, there are others, like typos, or the fact that same text in language A may have different translations in language B depending on a context. This is an issue of its own, and fixing this properly would require a major redesign of the translation system in the engine (as well as adjusting any plugins that rely on current system).

There's also no such thing as "editor script side", the texts that are part of the script or properties are compiled into the script or game data as-is. If we wanted to separate speech tags from them, we would have to introduce a new separate part of data for each string.

Quote from: Gal Shemesh on Tue 25/07/2023 11:11:42I don't see why someone will want to have a custom behavior with the particular translation in terms of speech files, since AGS by design uses the same index speech file numbers for all languages

No it does not use same index speech file by design. It uses whatever is written in the text. Besides the voice-over was not supported for multiple languages before 3.6.0, it's a very new feature, that has not been fleshed out yet.

But, regardless, by "custom behavior" I meant that the users may want to parse and process the language texts themselves in the script, and execute text and voice-over using custom methods, by either parsing default AGS speech tags, or having completely custom meta-data. If engine would enforce playing a voice-over depending on its presence in the source text, that would conflict with such approach.


Quote from: Gal Shemesh on Tue 25/07/2023 11:11:42*By the way, maybe it's my bad but I've found that when I accidently clicked on the Update option instead of on Compile in on the translations file entry in the editor, I got duplications of the same lines in different places in the translation file. Maybe it was after fixing something in some lines, and then reverting them back as they were before the change and it caused the original version of the strings to appear more than once in the translation file. Is this normal? When this happens, I'm not sure where should I put the translation lines: under the old line of the same string in the translation file or under the new line...?

It is also a known problem that any change to a source text will cause it to create a new entry in the translation.
Solving this also needs a translation system redesign.

Quote from: Gal Shemesh on Tue 25/07/2023 11:11:42**Also, when I began the translation process and troubleshoot the different issues, I found that if I remove the translation file from the game directory altogether, that the editor then refuses to load the game afterwards

Editor is rather sensitive to the removal of project files. I might fix it to let it load at least.
#268
Here's an archive containing some tools that we develop along the engine (they are not distributed along with AGS yet, but they are built on our build server):
https://www.dropbox.com/s/6wfl3foo3jb9iyu/agstools-360.zip?dl=0

Among them there's a program called "agsunpak.exe". It's run from command line (windows console) simply as "agsunpak path_to_compiled_game path_to_unpack_folder".

For example:
Code: ags
agsunpak myoldgame.exe myoldgame_files
will unpackage myoldgame.exe into the folder myoldgame_files (I think you have to create this folder yourself).

After you unpackaged your game, open the editor, choose to open an existing game, and select unpacked file called "ac2game.dta". AGS will start an "import old game" process.

If that does not work:
- Download AGS 2.72, and use it to open ac2game.dta instead.
- save the project in 2.72.
- open modern editor and try importing this project again.

You likely will have compilation errors because global script won't be recovered (as i mentioned), but other things may be more or less intact.


UPDATE

I experimented with some very old game myself, and found that there theoretically may be an error in the 2.72 AGS Editor when you open the game for the first time, because it cannot arrange all the sprites in the "Main folder" in sprite manager.
The error message looks like:
QuoteSome orphaned sprites were found, but the Main folder doesn't have free space to recover them all. Remove some sprites from your Main folder, then try again.
I don't know what's the deal with that, and whether that will be a problem with your game.

But if you have this, to solve this problem do the following:
- Open the Sprite manager
- Create a number of subfolders
- Move all the sprites from the main folder into the first subfolder. (drag to select sprites, drag to move them to any subfolder)
- Save and close the editor.
- Open project again.

Repeat this process until it stops complaining.
#269
Quote from: Gal Shemesh on Tue 25/07/2023 00:56:55I have some more feedback to share. I've just finished my short game and also fully translated it to Hebrew - I have found that GUI buttons still show from left-to-right, although the rest text of the game shows correctly based on the translation file. Was this supposed to be fixed in the recent patch?

There have been a mistake made with buttons, where it uses the settings inverse. I did not notice this in time. It should be fixed in the temp build here, but there will be another beta update soon too:
https://cirrus-ci.com/task/4938154059235328



Quote from: Gal Shemesh on Tue 25/07/2023 00:56:55- The 'game title' property from the General Settings doesn't have a line in the translation file. So if it's shown on a statusline in the game then it shows the English title backwards.

This might be years old error, probably nobody paid attention. I'll double check, but I suppose this may be fixed easily.

Quote from: Gal Shemesh on Tue 25/07/2023 00:56:55- Numbers (including Scores) and parentheses signs shows flipped. For example, the number 12 is shown as 21, and a string of "(something)" in parentheses shows as ")someting(".

The current implementation of RTL in AGS is: when text is reversed - everything is reversed, it does not parse the string to know what's inside, so digits and everything else will be in reverse order as well.
This indeed can lead to parentheses look wrong: if you have a string "(abcdefg)" and reverse it, then you'll have ")gfedcba(".

The existing solution was added in the 3.6.1 beta: set label to non-translating if it's meant to display numbers. Or workaround by creating dynamic untranslated string perhaps.


Quote from: Gal Shemesh on Tue 25/07/2023 00:56:55- If there's a string with a mix of Hebrew and English, the English text is shown from right-to-left instead of from left-to-right.

As been mentioned few times in the past, the AGS does not detect the language inside the text, it only uses the global option. If the option sais "RTL", then it will reverse everything.
This may be solved only by supporting the rendering using Unicode control characters which separate LTR and RTL parts in the text.
 

Quote from: Gal Shemesh on Tue 25/07/2023 00:56:55Last thing which I guess is by design, but maybe probably not brought too much to the attention as most games are in English: when including speech files pointers, for exapmle character.Say("&1 some line") or having a pointer in dialogue option cells, the pointer which is part of the string gets included for the English lines in the translation file. This requires to copy and paste them as well in the translated lines below them, or else the speech file will not play.

Yes of course this is by design, and there have been alot of translated games in the past, as well as certain amount of games in other languages, so either this was not bothering anyone, or nobody was bothered enough to report this as a problem, at least in my memory.
Currently, when game runs with translation, it passes the already translated line into the speech system, so that system does not know the original voice number at that time. I don't think that we can enforce automatically propagating voice numbers from source lines, as user might want to have a custom behavior with the particular translation too. But i guess that in theory we could support a translation option that does that (along with text direction and other things).

Quote from: Gal Shemesh on Tue 25/07/2023 00:56:55So my question, is there another way to include pointers to speech files but not to include the & sign in the actual strings? I can use custom function that @Khris assisted me with for making the narrator to play speech files, but I'm not sure how this can be implemented for dialogue options.

I'd like to clarify what is the problem, is it that you have to copy this sign, or that you cannot or do not want to use this particular & sign in the translation?

If you like to have your own meta-information in the strings, then that's perfectly doable with certain effort, where you parse the text in your custom function, display text using one method and play voice explicitly using Game.PlayVoiceClip (as an example).

The custom functions may be used in dialog scripts if you assign their names in General Settings ("Custom Narrate function in dialog scripts" and "Custom Say function in dialog scripts".

Unfortunately the dialog option titles themselves won't work like that, there's a difference in how these are processed in the engine, and previously I was not able to make this work easily.
The workaround is to uncheck the "Say" checkbox at the option, and duplicate the option's text in the dialog script as the first line by the player.
#270
I wonder if a solution here is as trivial as to disable frame processing at Object.SetView, while keeping legacy SetObjectFrame behavior.

It's curious to note that Character.LockViewFrame does not process the frame's behavior (that is - does not play frame sounds). Only Character.Animate does.
#271
Are you speaking of a project source, or compiled game? Do you remember which version of AGS was it made with?

Project source may be imported.

Compiled game may be unpacked using a tool, and parts of it imported into the newly created project. If your game is made with AGS 2.70 or earlier, then there's a chance that room scripts will be intact, because they were saved into the compiled rooms for some reason. But the global script and script modules cannot be, because currently there's no known script decompiler.
#272
There's a peculiar problem that I'm currently trying to solve.

Historically object's animation in AGS is designed so that you have to call Object.SetView first in order to assign a view, and only then Animate in order to begin animation.

This is in a way similar to Character's LockView/Animate pair, but there's a caveat: for some reason, unlike Character.LockView, Object.SetView also triggers a linked sound frame, while for Character this is only done when Animation starts.

I don't know if this is intentional or not. This may be related to Object.SetView internally passing to an older function called SetObjectFrame, which possibly could have been used as a step-by-step replacement to animation in older versions of AGS.

But this behavior conflicts with Animate, because apparently, a pair of SetView/Animate will cause 2 frames, or same frame to be processed 2 times in a quick succession. By "processed" I mean anything related to the frame's activation. Currently this is playing a linked sound.

To clarify: if you have a sound linked to a frame 0 of the given loop, then setting object to that frame with SetView, and then calling Animate will play that sound twice. Normally we do not notice that because the sounds will play in sync. But it may be found out if you print the state of AudioChannels somewhere in real time.

With the addition of "volume" parameter to Animate() function in 3.6.0 this issue becomes more complicated, because user may want to animate an object with one volume, but SetView will play it with a full volume.

At first I thought that adding AnimationVolume property to Object will solve this (similar to one added to Character type), but then realized that this does not solve this logical conflict between SetView and Animate at all: because both object's AnimationVolume and current Animate's vol param are relative factors that are consecutively applied to the default volume (i.e.: final_volume = 100% * AnimationVolume % * current Animate's volume %). As a result SetView will play a sound with one volume (not yet affected by Animate's parameter), while the rest of the frames will be once again played with other volume.
The only way to mitigate this would be to always run Animate with volume param = 100, which effectively makes this parameter useless...


To summarize this conflict:
- You must call SetView if you want to Animate an object;
- At the same time calling SetView processes the current frame's behavior regardless of whether you are planning to animate or not.


I'd like to find some solution for this, because it's wrong and annoying. Ideally this solution should be something applicable to the 3.6.1 release, as it's already causing trouble to users (this is how I found this problem).
#273
There's an experimental change that adds object pointer as an argument to all interaction functions:
https://github.com/adventuregamestudio/ags/pull/2061

I would appreciate if somebody could download a test build and try it out, see if it works well:
https://cirrus-ci.com/task/4853453999046656
Updated version, fixed Hotspot's WalkOn and Mouse over event args:
https://cirrus-ci.com/task/4755886569160704
(will be ready in 30-40 mins after posting this)
#274
@.M.M.  could you try the latest build here and tell if the error still persists?
https://cirrus-ci.com/task/5862661473173504

you may download either installer or a zip archive from where it sais "Artifacts".
#275
This thread made me concerned about the Room missing a Tint method for its bgs. Having that would also make it much faster, as the Tint property is applied using shaders with Direct3D/OpenGL gfx driver, while tinting the dynamic sprite currently makes it change the pixels.
#276
Quote from: Nahuel on Fri 21/07/2023 20:37:34But it does affect objects and also characters (when using UseRoomAreaLighting: true) So it will be possible then to create a DynamicSprite and place it and then AreaTint that could work! I'll give it a try, I'm not that familiar with DynamicSprite but I will try some stuff and come back.  :smiley:

You are probably talking about placing a dynamic sprite as an object or character, and make it tinted using ambient tint too?

I thought about it, but am concerned that this may conflict with walk-behinds, so you will have to re-adjust baselines everywhere.

It's safer to tint the dynamic sprite itself and paint on room background, please see the steps I added to my previous post.
#277
@Nahuel I don't remember, does AmbientTint not affect the room background?

If Tint command is acceptable in terms of visuals, then you could apply same effect to the background using DynamicSprite and Tint method. This will save on making extra variant of background for each room.

1. Create a single global DynamicSprite (you need only one, as only 1 room will be affected at a time).
2. For this effect: create or resize this dynamic sprite to the size of the room's viewport. (You could use room's size, but that will be redundant if the room is scrolling, and scrolling is paused during this effect,)
3. Get room bg's drawing surface, and paint the visible region on the dynamic sprite.
4. Do DynamicSprite.Tint(...).
5. Paint DynamicSprite's contents onto the room's BG.
6. Hmm.. I think you also need another dynamic sprite to store the original BG's portion and copy it back later.
#278
Perhaps the cheap version of this is to use AmbientTint or a grey GUI/overlay with varying level of translucency?
At least I'd try that first and see how that works.
#279
Found few more regressions in 3.6.1.

One noteable one is: calling ChangeRoom from the dialog script is broken and leads to weird behavior.


EDIT: sorry, false alarm, it was a scripting mistake in my test game apparently.
#280
Hmm, I suspected something else was affecting this.
But I'd like to add following for the reference:
Code: ags
player.ChangeRoom(1); //player back to initial room
Loop = Loop + 1; //change Loop to 2
In AGS room change is performed only after the script is finished, so ChangeRoom call is scheduled. This means that "Loop = Loop + 1" will be performed before the room is changed. Normally it's advised to call ChangeRoom last, to avoid misinterpretations.
SMF spam blocked by CleanTalk