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

#201
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.")
?
#202
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.
#203
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.
#204
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();
  }
}
#205
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!
#206
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...



#207
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!
#208
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...
#209
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...
#210
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
#211
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
#212
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
#213
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
#214
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
#215
Hi everyone,

I'm working on a Hebrew game template and encountered an odd issue when trying to import a Hebrew SCI font of 256 characters that my local friends had created in SCI Companion. The font looks like this:


When I import it into AGS, all the characters after the 128 English characters turn into question marks as shown here:


Is this a bug?

Thanks
#216
@Snarky
The main idea is to NOT include irrelevent things in the background, just to save the "trouble" of adding a line of code. So @Crimson Wizard's solution is exactly what I was looking for.

The example with the 10 pixels black bar was just a basic example, so one may think "hey, just add that line to every background you have'. It gets much more complicated though if say you have plenty of 'portion of rooms' which are much smaller and in various sizes than your actual game resolution. If you put these 'portion of rooms' on black backgrounds that fills the entire screen and you think later "hey, I wish I'd put that 'portion of a room' a little more to the left/right/up/down on the black background, then you won't only have to re-edit your artwork but also to manipulate the entire room properties and settings that I mentioned above. So being able to move around a 'portion of a room' in code is the best way to doing it. I wish of course that positioning of a room could have been done from within the room's properties panel by X and Y settings rather than doing it in code. But until it's implemented (if at all), doing it in code works for me just fine.

I followed @Crimson Wizard advice and put the line of code "Screen.Viewport.SetPosition(0, 11, Room.Width, Room.Height)" within a "room_Load()" function in the global script and it works for all rooms. :)
#217
Quote from: Crimson Wizard on Sun 18/06/2023 14:52:36Hello.
Yes, since AGS 3.5.0 you may freely set room position on screen using Viewports. Screen.Viewport is a primary viewport.

For example
Code: ags
Screen.Viewport.SetPosition((Screen.Width - Room.Width) / 2, (Screen.Height - Room.Height) / 2, Room.Width, Room.Height);

Will center current room in the screen.

You probably should do this in "on_event" function, on "eEventEnterRoomBeforeFadein" event, - then this will be performed each time a next room is loaded.

IMPORTANT
AGS automatically handles coordinate conversions (such as offsets) when using functions accepting screen coordinates like Room.ProcessClick or Character.GetAtScreenXY, and so forth, so you don't have to worry about that.
But if you're using functions that accept room coordinates and want to pass screen coords there (or vice versa),  then you should take offsets into account, or use Screen.ScreenToRoomPoint and Screen.ScreenToRoomPoint functions respectively. Same is true for scrolling rooms case.

For example:
Code: ags
// will work fine, AGS converts mouse coords to room automatically
Room.ProcessClick(mouse.x, mouse.y, mouse.Mode);

Code: ags
// Imagine you want to move character to the cursor pos
Point* room_pt = Screen.ScreenToRoomPoint(mouse.x, mouse.y);
player.x = room_pt.x;
player.y = room_pt.y;

Related articles in the manual:
https://adventuregamestudio.github.io/ags-manual/Screen.html
https://adventuregamestudio.github.io/ags-manual/Viewport.html
https://adventuregamestudio.github.io/ags-manual/Globalfunctions_Event.html#on_event

Thank you so much! :)
#218
Hi everyone,

I was trying to find this one out in the manual and online, but didn't find anything that matches my issue. If it was discussed somewhere in the forum please kindly direct me to the appropriate thread:

I'm looking for a way to be able to position smaller rooms than the gameplay resolution on the X and Y axis. For example, a gameplay in a 320x200 resolution and backgrounds in 320x190 (10 pixels short, like in Sierra's "King's Quest VI"). Currently when I import for example a 320x190 background it sticks to the top left corner of the screen, leaving me with a black bar of 320x10 pixels at the bottom of my background. I wish to have this "black space" ABOVE my background and not below it, so I'm looking for a way to position my rooms's at 0 on the X axis and at 11 on the Y axis. Is there a way to achieve this?

The above is just one example. I can think of other examples this may be useful. For example, when you want to have much smaller rooms than the game resolution, such as a room that takes only 30% of the screen, and you wish to have the freedom positioning that room around the rest 70% area within the engine if you changed your mind on the initial position that you set it up, and so the room will move with all its pre-defined properties you worked hard to set up; such as Edges, Characters, Objects, Hot Spots, Walkable Areas, Walk-behinds and Regions.

Attached below screenshots from the original "King's Quest VI" and its currently equivelant appearance in AGS.

Thanks!



#219
Quote from: kconan on Mon 08/05/2023 05:40:41I was in living in Hong Kong at the time, and used a commercial place there that did a fantastic job.  I went to the HQ office and they asked me how many thousands I wanted, and I said can you do like "20"...haha.  I ended up getting 100.  The image is actually printed on the CD.




Pretty cool! :)
#220
Quote from: kconan on Sat 06/05/2023 06:28:49Love that box, the side/binder art is cool!  I had one made back in 2012 when I finished my AGS game.  The style was similar to the old Atari 2600 River Raid box.




Last year I updated my game, and put it up on Steam for a buck. 

That looks awesome! So professional. :)

Is this a home-made or commercially done in a factory? I'm curious as the CD's artwork with the circular cut in the middle and around the outer circle which makes the CD's holographic shine in between looks like it was printed on a blank shine CD surface in a professional color thermal printer, like the Rimage Everest or similar. Am I correct? Or is it a sticker label with an accurate cut for the holographic CD shine that shows through?
SMF spam blocked by CleanTalk