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

#161
Thanks for the checking. I'm really not sure what's going on - I can swear it didn't work before in more than one project that I tested, but from unknown and awkward reason when I test the game now from the zip file that I shared, the replaced speech file is played correctly. I hope it will remain that way and that we didn't both encounter a temporary scenario that it actually works.

Thanks again for looking into this! So the only issue remains is the isSpeechVoxAvailable matter that keeps returning 1 when the game is begin test from the editor, even when there are no speech files in the Speech folder.
#162
Yep, if I rebuild all files then the new file that was replaced plays without any problem when running the game from the editor. Same as if I delete the Speech.vox file altogether from the Compiled folder.

Attached the new test game that I made if it helps - link

I've included in it a "_RESOURCES" folder with 3 speech files that I originally made for the Narrator in my version of the template. The first file is already in the Speech folder. I removed all the pre-compiled files so you could test it from scratch.

* There's also the Enter hotkey in it for the return value of the isSpeechVoxAvailable matter for your convenience. :)

If there's anything else you wish me to test from my side kindly let me know.
#163
Found the problem. It's quite confusing and hard to spot but I got it - it's not when adding new sound files, which work fine without recompiling. It is when you modify or replace the sound files that were already compiled, if for example you want to re-record a certain file or replace what is said in it while keeping the origianl file numbers.

Steps to reproduce:
1. Create a new game with the Sierra-style template.
2. Put 1 audio file such as Ego1.wav in the Speech folder.
3. Go to the cEgo_Look function and change the "Display()" with player.Say("&1 Damn, I'm looking good!");
4. Rebuild all files.
5. Run the game with F5 and confirm that the Ego1 file is played.
6. Close the game and delete the Ego1.wav from the Speech folder.
7. Copy an different audio file to the Speech folder and rename it to Ego1 as well.
8. Run the game with F5 - the new replaced file won't be heard but the previous one that was originally compiled.
#164
Quote from: Crimson Wizard on Mon 10/07/2023 16:10:18@Gal Shemesh

I tried this in 3.6.0, and it works as expected: if I add new files to Speech folder, or replace existing ones, without rebuilding speech.vox, then run the game from the Editor, then the files from the Speech folder are used.

Please tell in detail, how did you test this case in your game?

Yes, that works for me too - the actual problem is this:

Rename your Speech folder to SpeechOld or something, and make a hotkey to see what isSpeedhVoxAvailable() returns to you - run the game from within the editor and it will return the value 1 instead of 0, even if there are no speech files available, which is incorrect. If you re-build all files and check this by running the game (that doesn't have any speech files in it) from the EXE, the hotkey will return to you the value 0, which is what it should have done by running the game from the editor. That's one problem.

The second problem is if you compile all files and then add or change an existing speech file in the Speech folder, when testing the game by hitting F5 from the editor, it won't reflect in the game unless you delete the Speech.VOX file from the Compiled folder.
#165
Thanks guys for the input! Much appreciated.

I'm glad that at least I know by now how to troubleshoot this if this is a bug - I checked both scenarios when running my game from the EXE file, based on different conditions that I set when the speech VOX file exists and when it is not, so I'm not worried:

I set in the game_start() function a condition to check if the IsSpeechVoxAvailable is false. If so, it changes the default Voice & Text mode and button to Text Only. I also added an else if statement for displaying a text message to the players about the missing sound pack, if they were to click on the Voice button in the settings panel.

And so, if IsSpeechVoxAvailable is true, the game starts in the default Voice & Text mode and players could cycle through the different voice modes using the Voice button.

Now I'm back testing my game from the editor, and just make sure that there is no speech VOX file in the Compiled folder until if and when this is fixed, so when I add / change sound files in the Speech folder I don't have to recompile everything every time.

Again, thanks for looking into this! This is not taken for granted and I much appreciate you participation and help.  :)
#166
Yes, that would be great if it could behave that way.

I just checked whether the IsSpeechVoxAvailable() returns 0 when running the game from the EXE file and it actually does. Though I never thought there is a difference which is why I always relayed on running the game with F5 from within the editor.

Another thing I just noted in case the above thing gets fixed/added - if I compile all files once and a VOX file was created in the Compiled folder, when running the game from the editor it ignores the Speech folder completely and relays on the Speech.VOX file in the Compiled folder.

The same thing goes when adding more files to the Speech folder - if a Speech.VOX file was already compiled and I add new speech files to the Speech folder (or replace an existing file name with an alternate version) they don't play in the game until I re-compile all files. If I want the editor to relay on the actual Speech folder, I have to manually go into the Compiled\Windows folder and to delete the Speech.VOX file; I also manually delete the Speech.VOX file from the Compiled\Data folder to be on the safe side that it doesn't get use when testing the game.

I think that as long as the game is in development, testing the game from the editor should not relay and use the compiled VOX files, but rather relay on the presence of the source raw files in the game's folders.

Thanks for looking into this!
#167
AGS Editor .NET (Build 3.6.0.50)
v3.6.0, July 2023
#169
Nope. I have manually removed these files to be on the safe side from both the Data and Windows folders within the Compile directory. If I either run the game for a quick test from the editor or select to build all files where there is no speech files in the Speech folder, no VOX files get created, yet IsSpeechVoxAvailable remains to be equal to 1.

If I add a speech file and hit F5 for a quick test, the speech file plays in the game, though no VOX file gets created in the folders unless I selected to build all files - not sure if that's the correct behavior...
#170
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
#171
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.
#172
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
#173
@Khris, my man - what would I do without you! It works fantastic! Thank you so much!  ;-D  ;-D  ;-D
#174
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);
  }
}
#175
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.
#176
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
#177
Thanks for the links! I actually posted it here. Should I re-post under the 3.6.0 build too?
#178
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
#179
Thanks @Khris. I will post a bug report then in the "Bug reports & suggestions" thread.
#180
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.
SMF spam blocked by CleanTalk