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

#121
Hi guys,

I have another query on this topic regarding the IsSpeechVoxAvailable function.

I made this temporary hotkey for checking if I have any speech vox files in my game:

Code: ags
if (keycode == eKeyReturn)
{
  Display("IsSpeechVoxAvailable %d", IsSpeechVoxAvailable());
}

However, even if I'm running a game without any sound files in the Speech folder, the IsSpeechVoxAvailable returns the value 1 as if there are. What I'm trying to do is to make a condtion that checks if there are no speech files available when the game is launched, and if so then the Speech.VoiceMode will be changed to eSpeechTextOnly.

Same as if the players click on the Voice button in the Settings panel for changing the voice modes - if there is no speech files available I wish to show them a message saying that, and perhaps with some link that they need to access for downloading the speech packs from.

Thanks
#122
Thanks guys!

I was just thinking about the "think" option as an easy approach to make the character change to a pre-configured thinking animation VIEW, so I saw the thinking option suitable. Only that I didn't understand why it doesn't loop. Funny that I missed the '(it won't repeat)' bit as I actually went over the Character.Think section in the built-in manual.
#123
Hi everyone,

A small question that may or may not be a bug - does thinking view supposed to loop or just to play once? I have set a thinking view to my character, and use the player.Think("some message");, however the view plays only once and then stops at the last frame. Unlike the Speech view which loops forever.

I reached these old threads: this and also this one where people asked about it, but the questions remain opened.

Maybe not many people use the thinking option so it was forgotten?

Kindly let me know.

Thanks
#124
@Khris, my man - what would I do without you! It works fantastic! Thank you so much!  ;-D  ;-D  ;-D
#125
Thanks for the clarification, @Khris! Noted down that this is a function too, only with the name 'bool'! ;-D I'm still trying to figuring out why it's not working, though. It says 'varaible is required on the left of assignment i' on the 'for (i = 0; i < this.ItemCount; i++)' line...

Code: ags
// saving a game
bool ItemExists(this ListBox*, String item) {
  for (i = 0; i < this.ItemCount; i++) {
    if (item == this.Items[i]) return true;
  }
  return false;
}

function btnSaveGame_OnClick(GUIControl *control, MouseButton button)
{
  int gameSlotToSaveInto = find_save_slot(txtNewSaveName.Text);
  if (gameSlotToSaveInto < 0)
  {
    Display("No more free save slots!");
  }
  // game save cannot be empty message
  else if (txtNewSaveName.Text == "")
  {
  Display("Game save cannot be empty!");
  }
  // check if no save slot was clicked on in the saves list box
  else if (lstSaveGamesList.SelectedIndex == -1)
  {
    SaveGameSlot(gameSlotToSaveInto, txtNewSaveName.Text);
    close_owning_gui(control);
  }
  // show the confirm overwriting dialogue
  else if (lstSaveGamesList.ItemExists(txtNewSaveName.Text))
  {
    open_gui(gOverwriteSave);
  }
}
#126
Thanks @Khris for the prompt response. Much appreciated!

I'm trying to figuring out where to put this bool you mentioned - when I'm trying to put it within the function it gives me 'the nested function is not supported' error as if I missed a closing brace, but if I add one to the end of the bool code it ends my whole 'btnSaveGame_OnClick' function, leaving the rest of my code out of it. Do I need to replace the bool with one of my functions, or have it in a different place in my code?

Sorry, I'm trying my best but coding never was my strength...  :~( Hope to getting better.
#127
Hi everyone,

I viewed the other threads about something similar, but found the information there a little overwhelming. I'm pretty sure there is a simple solution to what I'm after and would appreciate some assistance.

I copied the code of the Save Game panel from the Sierra-style template and I'm trying to make it a little better:

1. I've added a message if players click on Save while the text box is empty.

2. I tweaked the 'else if' statement before it actually save so it will check if the lstSaveGamesList.SelectedIndex == -1, to make sure that there is no save slot selected in the list box. If there is, it goes to the final 'else' statement where it shows an overwrite confirmation GUI. The problem is that if the players write a game save name which already exists in the list box, it overwrites it no matter what. I'm willing to make it show the overwrite confirmation GUI if the text box is equal to any of the save slots in the list box, but can't figure out how to compare the text... Here's my code:

Code: ags
function btnSaveGame_OnClick(GUIControl *control, MouseButton button)
{
  int gameSlotToSaveInto = find_save_slot(txtNewSaveName.Text);
  if (gameSlotToSaveInto < 0)
  {
    Display("No more free save slots!");
  }
  // game save cannot be empty message
  else if (txtNewSaveName.Text == "")
  {
  Display("Game save cannot be empty!");
  }
  // check if no save slot was clicked on in the saves list box
  else if (lstSaveGamesList.SelectedIndex == -1)
  {
    SaveGameSlot(gameSlotToSaveInto, txtNewSaveName.Text);
    close_owning_gui(control);
  }
  // show the confirm overwriting dialogue
  else
  {
    open_gui(gOverwriteSave);
  }
}

Thanks
#128
Thanks for the links! I actually posted it here. Should I re-post under the 3.6.0 build too?
#129
Hi everyone,

I posted this in the beginners forum and it appears to be a bug, which also exists in the Sierra-style template, so just wanted to bring this up here and hope that it could be fixed in a future patch. Here's my original post link.

To sum it up here, it seems like when using an empty button sprite graphic for representing a selected inventory item graphic on-top of it (Sierra-style), using any of these text variables (INV) / (INVNS) / (INVSHR), has a graphic 'refresh' bug; it does not refresh when you pick an inventory item until you manually refresh the button's graphic, either by clicking on it or by doing a workaround to change the sprite image in code, and then to revert it back.

As a workaround, I updated the normal graphic of the button to something else within the function that hides the icon bar, like so:

Code: ags
btnIconCurInv.NormalGraphic = 0;

The 0 sprite will be invisible to the player as it occurs when the icon bar is hidden. And then I used the same trick within the function that shows the icon bar, while setting its graphic sprite back to what it should be. And then the button's graphic refreshes every time the icon bar is showing.

Thanks
#130
Thanks @Khris. I will post a bug report then in the "Bug reports & suggestions" thread.
#131
Hi everyone,

Trying to solve this by my own for hours. Would appreciate some assistance.

I'm working on a Sierra-style game with a top icon-bar, and a button with an empty sprite graphic for representing a selected inventory item graphic on-top of it. I followed the manual and set the button's text to (INVSHR). Now the problem is, once I pick an inventory item and close the inventroy GUI, if I then hover with the mouse cursor to reveal the top icon bar, the empty button that should represent the item's sprite remains empty - that is until I actually click on it that the graphic updates; and there must be a different graphic for the 'pushedImage' variable, or else it doesn't update the graphic at all.

I checked the Sierra-style template that comes with AGS and it behaves the same way. In Sierra games like "King's Quest V & VI" the empty button changes to the selected item from the inventory instantly.

Is this a bug or something that I'm doing wrong? To me it seems like the (INVSHR) in general works, but that it requires a manual intervention to actually 'refresh' the button's graphic, instead of refreshing it automatically.

Thanks

UPDATE:
I think that I solved it for now, but it's a workaround. I updated the normal graphic of the button to something else within the function that hides the icon bar, like so:

Code: ags
btnIconCurInv.NormalGraphic = 0;

The 0 sprite will be invisible to the player as it occurs when the icon bar is hidden. And then I used the same trick within the function that shows the icon bar, while setting its graphic sprite back to what it should be. And then the button's graphic refreshes every time the icon bar is showing.
#132
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
#133
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.
#134
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
#135
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.
#136
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?
#137
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! :)
#138
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.")
?
#139
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.
#140
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.
SMF spam blocked by CleanTalk