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 - Gal Shemesh

#181
Modules, Plugins & Tools / Re: AGS ThemeEditor
Tue 27/06/2023 17:02:06
Is there an updated link to download the Theme Editor? Would love to make a custom dark mode for AGS. Thanks
UPDATE: Sorry, the link didn't work at first. Now it works, though I see that it's for the source code.

Is there an actual executable for using the theme editor or instructions how to use it?

Thanks
#182
Quote from: Crimson Wizard on Thu 22/06/2023 01:38:26I opened a draft for changing this, but there's a number of questions following:
https://github.com/adventuregamestudio/ags/pull/2044

Questions are this:
1. Do we need a per-control setting that tells whether to apply RTL render? Alternatively, all GUI controls have a hidden "translated" flag, which is set by default, although only ListBox has a visible property in the editor (because list boxes may be used to store saves and other filenames, which must not be translated). We could make this flag tell whether to apply RTL as well.
2. How to deal with a situation when original text has one RTL mode, translation has another, but is missing an entry. Should the original text be drawn in original mode instead? For example: English game with Hebrew translation. Currently RTL is applied unconditionally. Should it be applied according to whether the text is original or got from translation?

1. By per control do you mean that all GUI elements (apart from List Boxes that already have it) will have the hidden 'Translated' bool flag visible in the editor? If so then that could be great, as one may want to keep a certain button for example in the original language, without it being affected by the translation file.

Regarding List Boxes that serves for game saves: I'm not sure how AGS handles it if the list box is set to accept other languages input, like Hebrew. I do remember from some the Hebrew version games that we could write our game saves description in Hebrew, while the filename created was always in English and with a general syntax of SaveXXX. But anyway, having a separated RTL bool option so the user could set whether the specific element should be switched to show text in RTL based on the translation file then that would be even better, as it gives more control on the appearance of the elements. I think that such bool should be for all GUI elements.

2. As for a missing entry - do you mean if the translation file has not been filled with a transation for a particular line yet but an empty line below the original text? If so then I think that the engine should always be based on the original; if the original is in English which is LTR then have the original text appear at the missing entry in LTR.
#183
Thanks @Crimson Wizard for all the testing. So you don't think that it's a bug after all in 'Voice Only' mode? I mean, it's weird that the pointer remains as if it's ready for hovering on hotspots and for revealing the top icon bar when it actually don't work until you click on the mouse - that is after the sound finished playing. All the other statements about the normal behaviors you mentioned are understandable.

Anyway with your, @Khris and @Snarky's kind help I managed to almost finish a basic upgraded template. I just have to work on the Hebrew font so it won't be a font of another game - currently it's Simon the Sorcerer's font in both English and Hebrew. Here's a short video describing what I've been working on: Upgraded Template Video

A summary of what was changed:
1. The template is a multilanguage - based on English and has a Hebrew translation file.
2. Updated 256 characters font that contains both English and Hebrew character sets.
3. Ability to switch between Voice and Text for both English and Hebrew are in the in-game settings panel.
4. Speech folder contains all English voices and Speech\Hebrew contains all Hebrew voices.
5. Display() messages are set to be shown based on the 'Narrate(int cue, String text)' method for adding narration voices, which are based on an invisible cNarr character.
6. Fix for showing the wait / hour-glass cursor when on 'Voice Only' mode, using @Snarky assistance with the String cueString = String.Format("&%d",cue); line in Global Header.

Let me know what you think, and of course suggestions to make it better are very much welcome.
Also, kindly let me know where would be the suitable place to upload the complete template once I finish working on it, so users with multilanguage game in mind could use it as a starting point.

Thanks
#184
Quote from: Khris on Wed 21/06/2023 15:16:24Just put
Code: ags
  game.narrator_speech = -1;

in game_start (or the first room's room_Load).

Regarding the syntax error in Display(&1 "Bla bla bla"): Display is a function that expects a string as first argument. You can't just put arbitrary characters in between the parens. The &1 belongs at the start of the string, exactly as with the Say command.
Thanks! It works great. Only difference compared to @Snarky script is that on 'Voice Only' mode the cursor remains as it was instead of changing to the hour-glass, and once the sound finished playing you actually have to make another click before the mouse cursor can return to interact with the environment; I just moved the mouse to the top edge to see if it can interact with the top bar icons in the Sierra style game and it doesn't pull the icons until I click on the mouse.
#185
Quote from: Crimson Wizard on Wed 21/06/2023 14:28:51I believe that Display (and all its functions family) can play voice precisely the same way as Say command does, if you call your voice files NARRXXXX.

Correction: Display uses a character index set by game.narrator_speech. It equals default player char on startup, but if this value is -1, then it will use NARRX files.

See here: https://adventuregamestudio.github.io/ags-manual/Gamevariables.html

Code: ags
Display("&1 Bla bla bla");
will play voice file 1.

EDIT: the manual should be updated, this essential information needs to be added to "Display" article, and also to "Voice speech" article
Can you please direct me to where / how to define the 'game.narrator_speech' variable to -1?
#186
Quote from: Crimson Wizard on Wed 21/06/2023 14:44:34@Gal Shemesh I corrected my reply once more after you replied, with example, please re-read it again.
Yes, just saw it and was in the middle of modifying my previous reply. Thanks a lot! I also agree that this should be in the manual. I'm trying for hours to find heads and tails in the manual on these topics but it's currently lack of them, that's why I asked for help. Much appreciate all your help, from both of you! :)
#187
Quote from: Snarky on Wed 21/06/2023 14:17:26I don't think there is any way to freeze the game in exactly the same way that Display() does (which is a "harder" pause than the other blocks in AGS), but it should be possible to make it wait in the same way as speech does, by... actually playing it as a speech line in that case:

Code: ags
  String cueString = String.Format("&%d",cue);
  if(Speech.VoiceMode == eSpeechVoiceOnly && IsSpeechVoxAvailable())
    cNar.Say(cueString);
Wow, that works just as expected! Thanks!!

Quote from: Crimson Wizard on Wed 21/06/2023 14:28:51I believe that Display can play voice precisely the same way as Say command does, if you call your voice files NARRXXXX.

Correction: you need to use DisplayAt for this, or DisplayAtY, as these functions act more similar to Say, being not as ultimately blocking as Display.
I will be glad to check this out - but does it work out-of-the-box or requires to have the custom Narrate function in the script header as well? And when writing the built-in Display() function, should I write it this way for calling the speech files:
Code: ags
Display(&1 "some string.")
?
#188
I will appreciate help on something similar to what you mentioned, @Snarky.

I've been tweaking the function with some 'if statements' so it will make sence with the 3 setting modes of 'Voice and Text / Text Only / Voice Only', as the modes did not affect the function and it always showed the text and played the sound no matter what setting was picked from the settings panel.

The new issue I'm facing now is when I set the game to 'Voice Only', as the speech sound plays without showing the text box on screen and the game keeps running in the background. Is there a way to make the function to sort of pause the game, the same as how the regular 'character.say()' function works which changes the mouse cursor to an hour-glass as long as the sound is playing, and that when it's done the control automatically returns to the player? The player should also have an option to skip the playing sound and get control back upon click.
#189
Actually, since the text is shown like a 'Display()' fuction, the player can't do anything as long as the message is on the screen but to click in order to close the message and skip that bit. Which is fine for me.
#190
Thanks a million, @Khris! :) It works great when I have a voice file in the Speech folder and also in sub-folders for other languages.

The only problem I found is that if I use the calling syntax as a placeholder when I haven't recorded voices yet for all the text lines, then the 'ch.Stop();' makes the game crash. So I put it within an if statement that checks if 'ch' is NOT equal to 'null'. So now if I don't have a sound file in the Speech folder yet the game continues.

Code: ags
void Narrate(int cue, String text) {
  AudioChannel* ch = Game.PlayVoiceClip(cNar, cue);
  Display(text);
  if (ch != null) {
  ch.Stop();
  }
}
#191
Hi everyone,

Sorry if this was asked before but I just can't find an exact thread about this issue.

I'm trying to make a Sierra "King's Quest 5/6" style game, where apart from regular character speech, there's an 'invisible' narrator that gives text information to the player upon looking / doing stuff, within a text box like the "Display" function. The thing I don't get is how to make this text box to show along with voice speech in the background, and that the speech will be based on the voice pack the game is set to run with.

I managed to import a voice sound to the engine and used its name with .play() and put it before the Display("string") line of code, but it's only for 1 language and it keeps playing even when the player interrupts and closes the text box. Besides, it's more complicated to work that way as I'll have to import all sound files to the engine. It also lacks the ability to pick sound files based on different languages. So I prefer to use speech as it pulls the sounds from the external Speech folder and its sub-folders for other langauges.

So I read a bit online and found that some are suggesting to use an invisible character as the narrator, and to position it in the center of the screen for presenting the text. So I tried it - after finding out that I can't use the 'cNarrator' script name for the character as it's already defined in the engine as a special character for dialogues, I gave my new narrator character the script name 'cNar'. I managed to achieve what I want, placing the narrator character in the middle of the screen and passing text and speech to it which works great in all languages. The only problem is that I don't want the text to be shown as speech text above its head but in a text box with a frame and all, that will also pause the game when shown, just like the "Display" function.

UPDATE:
I've just managed to write the code this way which is almost great, but the message displays only after the sound finish playing. The '&1' is the first sound file of the cNar character, pulled from either the 'Speech' folder for English or from the sub-folder 'Speech\Hebrew' for Hebrew:

Code: ags
function cEgo_Look()
{
  cNar.say("&1") & Display("Damn, you're looking good!");
  
}


Would appreciate some help.

Many thanks!
#192
Sorry, maybe I did not make myself clear.

You're right - in GUI elements the font is centered. However, in message boxes like in the screenshot below, if one of the languages has taller characters, whether they're in use in the string or not, the language with the shorter characters will be drawn in runtime with more space around the letters. I took the original template font and copied only the Hebrew alphabet characters to it to show what I mean.

As you can see in the screenshot below, there's more 'gap' below the Hebrew characters - gap which is based of the English characters height. Moreover, some characters like punctuation marks are shared between both languages if they're both on the same font file, and so it makes their alignment to one of the languages to look odd as you can see.

The other problem I find is if say a game has more than 2 languages - everything regarding speech will be okay as the appropriate language font index number can be set in the translation file. But all the GUI elements will be based on font index 0 which has only up to 2 sets of language characters. So the 3rd language and above won't be able to reflect for GUI elements if I understand it correctly...



#193
Quote from: Crimson Wizard on Tue 20/06/2023 23:33:36This is a known issue in the old version of template, where the script logic relied on the human-readable text.
The newest version of template should be fixed since AGS 3.6.0.

Here's the fixed code:
https://github.com/adventuregamestudio/ags-template-source/blob/169184f96a559b392f5205054d218440f1b0cd46/Sierra-style/GlobalScript.asc#L384-L401

Thanks! The new code makes much more sense after reading it.

@Khris, thank you too!
#194
Quote from: Crimson Wizard on Wed 21/06/2023 00:09:46I need to clarify, how do you see that the font is not replaced? Do you refer to the GUI?

If i remember right, the GUI fonts are not replaced by translation options at all. These options affect only speech and messages done using Display.
NormalFont is for general messages, SpeechFont is for the speech only.

If you need to replace fonts on GUI, you need to run over all guis and replace the font property on all eligible controls
Spoiler
Code: ags
function ReplaceFontOnAllGUI(int old_font, int new_font)
{
    for (int i = 0; i < Game.GUICount; i++)
    {
         for (int j = 0; j < guis[i].ControlCount; j++)
         {
              GUIControl* c= guis[i].Controls[j];
              Button* btn = c.AsButton;
              if (btn != null && btn.Font == old_font)
                   btn.Font = new_font;
              // and so on
         }
    }
}
[close]

Yep, you're right. I'm checking this on the GUI panels and I just now realize that the translation file settings don't affect them. I didn't even went to check if it works on regular speech and just now after reading your comment I find that it works for speech.

Thanks for the workaround code. But won't it be a static solution only for the font that is set there? I mean, the idea I had in mind is that the GUI font will be different for either English and Hebrew - again, only so I could have taller / shorter letters for each language. Otherwise from what I had checked, if both languages are set on the same 256 characters font set, the height of the font will be based on the taller character in the entire set. So if I have taller English letters and shorter Hebrew ones, the Hebrew ones will look like they have a gap of empty space from top / bottom...
#195
Not silly question at all. I very appreciate your prompt responses and your kindness trying to help me out. :)

Yep, I did compiled the translation file. I even tried to update it and also to rebuild all files just to be on the safe side, although it may not be necessary. Nothing helps... The engine seems to ignore the fact that
Code: ags
//#NormalFont=3
and
Code: ags
//#SpeechFont=4
are present in the translation file.

As for your reference to my outline font question - thanks! Didn't know it can be done from the editor. Silly me...
#196
Thanks @Crimson Wizard and @Snarky for the prompt replies. Much appreciated.

I didn't get to testing ListBox and TextBox yet. Being working on upgrading the template so both me and other users could benefit from having a pre-made multilanguage template that has both a translation file and speech for 2 lanugages as a starting point. I'm doing the voices for both languages myself. :)

Anyway, for the meantime I just wrote the Hebrew text backward in the translation file. Not the best way but I prefer to have it this way than in code as if it will be in code I might forget that it is broken in the first place. Hope that it will be fixed in a coming update.

I just posted another issue that appears like a bug with buttons, where if you have a function that changes the button text and it is based on a particular text for the function to keep functioning, then the function gets broken when the text on the button is shown based on the translation file. It looks like buttons don't work very well with translation in general at the moment. Here's a link to the other issue if you can take a look please. Thanks
https://www.adventuregamestudio.co.uk/forums/advanced-technical-forum/template-voice-and-text-trigger-button-code-breaks-in-translation/new/#new
#197
Hi everyone,

I think I've found another bug when working with translation in buttons that change their text from within scripts, like the 'Voice and Text' button in the settings panel of the Template game for changing between 'Voice and Text', 'Voice only' and 'Text Only.

I'm currently making an updated version of the template game and I made it with an option to switch between English and Hebrew during runtime, along with speech for both languages so it will give a better starting point for users with a multilanguage game in mind.

I made a Hebrew translation file and traslated all three modes of the 'btnVoice'. They all show up correctly when running the game in Hebrew. Clicking on the button in English works flawlessly and cycles back up when it reaches its last 'else if' statement. However, when the game shows the text based on the translation file, the function seems to break after 1 click on any of the modes and the button stops working - I checked them all by changing to English, putting the button on the state I wanted to check, reverted to Hebrew and clicked on it. The buttons changes to the text from the translation file, but the function breaks. It doesn't matter what text I fill in the translation file - it can be either Hebrew, English or a number. As long as the text is not the same as written in the function, the function breaks instead of go looking for the text in the translation file. This is the code:

Code: ags
function btnVoice_OnClick(GUIControl *control, MouseButton button)
{
  if (btnVoice.Text == "Voice and Text")
  {
    Speech.VoiceMode = eSpeechVoiceOnly;
    btnVoice.Text = "Voice only";
  }
  else if (btnVoice.Text == "Voice only")
  {
    Speech.VoiceMode = eSpeechTextOnly;
    btnVoice.Text = "Text only";
  }
  else if (btnVoice.Text == "Text only")
  {
    Speech.VoiceMode = eSpeechVoiceAndText;
    btnVoice.Text = "Voice and Text";
  }
}

Is this a bug? I'm not sure if it's related to the same cause, but I posted another issue that the buttons also don't get translated correctly and are showing their Hebrew text from Left-to-Right instead of from Right-to-Left, and it's although all the rest of my game looks from Right-to-Left. Here's the thead link: https://www.adventuregamestudio.co.uk/forums/advanced-technical-forum/buttons-text-remains-left-to-right-rtl-when-the-game-runs-in-right-to-left/msg636655887/#msg636655887]https://www.adventuregamestudio.co.uk/forums/advanced-technical-forum/buttons-text-remains-left-to-right-rtl-when-the-game-runs-in-right-to-left/msg636655887/#msg636655887

Thanks
#198
Hi everyone,

I'm having an issue setting up a specific font style for the 'normal font' text in my Hebrew translation file. According to the 'Translation settings' section, these are the instructions:

// ** Translation settings are below
// ** Leave them as "DEFAULT" to use the game settings
// The normal font to use - DEFAULT or font number
//#NormalFont=DEFAULT
// The speech font to use - DEFAULT or font number
//#SpeechFont=DEFAULT
// Text direction - DEFAULT, LEFT or RIGHT
//#TextDirection=RIGHT


I wish to have separated English and Hebrew fonts in my game, and not a mix of one font that has the characters of both languages, as I found that if my English letters are taller than my Hebrew ones, the Hebrew letters will have more 'empty space' on their top / bottom side and vise versa.

I understand that if the values above remain as DEFAULT the engine will use the default fonts in index 0 and 1 (there's also index 2 for the outline font for which I have another question below). So I added 3 additional fonts that contain the Hebrew letters in index 3 (for normal font), 4 (for speech) and 5 (for outline), and I wish that the engine will pick them up if the game is run in Hebrew from the game setup.



So I went into the Translation file and set the NormalFont line to 3 and the SpeechFont to 4, however the engine still go and pick the Normal font in index 0 even if Hebrew is picked for the game language in the game setup, and so the game appears in gibberish since there's no Hebrew letters drawn in the normal font index 0. If I import the Hebrew font over the normal font index 0 then everything appears fine of course.

Any idea of why the engine doesn't pick the new index font numbers even if it's set up in the Translation file?

As for the outline font question, since it's not mentioned in the translation file instructions, is whether there's a "//#SpeechOutlineFont=" option for setting up a custom outline font for the engine to pick if run in Hebrew from the game setup?

Thanks
#199
Hi everyone,

I've made a 'Right to Left' (RTL) Hebrew version for the template game that comes with AGS, with a translation file (Hebrew.trs), as explained in the manual, and it works quite fine. The only problem I encounter with is that although most of the text switches to be written from 'Right to Left', all the buttons text remains written from 'Left to Right'.

I've set the TextDirection to RIGHT in my translation file as all other text strings (as far as I found) appears correctly, so I'm in doubts what goes wrong...

Thanks
#200
Quote from: Crimson Wizard on Sun 18/06/2023 23:30:26If I remember correctly, AGS has a hardcoded limit to 128 characters when importing SCI format.

If you upload this font, I might look if it feasible to safely load it without breaking 128-long fonts.

Thanks @Crimson Wizard
Here's a direct link: https://github.com/adventurebrew/hebrewadventure/blob/master/sq3/PATCHES/font.004
SMF spam blocked by CleanTalk