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

#141
Quote from: Khris on Tue 25/07/2023 22:14:41Nice work, just wanted to point out that AGS supports so-called extender functions.

Thanks, @Khris! :) I'm learning from the best I guess.

And 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*?

*By the way, I've just posted my final mini-game "Going Home", which wasn't possible without your, @Crimson Wizard and @Snarky's help. So thank you all! :) You may find it in the Completed Game Announcements section.
#142
Completed Game Announcements / Going Home
Tue 25/07/2023 22:03:37
"Going Home" is a very short point-and-click adventure game, with full speech acting and a funny plot:

You're Roger. When the game starts you find yourself in an unknown place, somewhere in the universe. But, you're not alone - there's someone else there with you! Will you dare and check who that is and find a way to get back home? Or maybe this is not even about you!





I made this game during learning my way in the AGS engine. The idea was to re-create the Sierra-style AGS template from a complete scratch, to learn bit-by-bit how it is made, and then to take it from there and make an actual mini game that includes full speech acting and a funny plot. I hope you'll like it the same as I had making it. :)

Many thanks to the AGS community for their kindness helping me out with all my queries. This game wasn't possible without your assistance, and I look forward that it will be one of many from my future creations.

*The game has been also fully translated to Hebrew.

Available for download in the AGS game database:
https://www.adventuregamestudio.co.uk/site/games/game/2682-going-home/
#143
Quote from: Crimson Wizard on Tue 25/07/2023 15:38:23
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").

Yep, you're 100% correct. I've just finished modifying my entire mini-game to use this custom function, and all the dialogues to use the regular scripting with indentation; I also find it quite straightforward when copying 'saying' lines from regular scripts to dialogue scripts and vice versa, as I don't use the unique dialog scripting.

I also removed all the '&' signs from the translation file, so I now have a cleaned file with just the literal strings in it which looks and works great! :)

The only thing I'm trying to figure out now is how to set the dialogue selection options when the dialogue starts to align to the right of the screen, as currently they're aligned to the left.
#144
Thanks @Crimson Wizard, I much appreciate all your input.

For 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.
#145
Hi @Khris :)

On the same senario of the Narrate custom function you assisted me with, I'm trying to make the same thing for character.Say (any character) so the '&' with the speech file number will be outside of the actual string and not part of it, like when I call for the Narrate function as you instructed me:
Code: ags
Narrate(1, "Damn, you're looking good!");

However, I'm having some trouble modifiying the function to work.

The current function of yours with a little tuning for all the voice modes looks like this:

Code: ags
void Narrate(int cue, String text)
{
  String cueString = String.Format("&%d",cue);
  {
    if (Speech.VoiceMode == eSpeechVoiceAndText && IsSpeechVoxAvailable())
    {
      AudioChannel* ch = Game.PlayVoiceClip(cNarr, cue);
      Display(text);
      if (ch != null)
      {
        ch.Stop();
      }
    }
    else if (Speech.VoiceMode == eSpeechVoiceOnly && IsSpeechVoxAvailable())
    {
    cNarr.Say(cueString);
    }
    else if (Speech.VoiceMode == eSpeechTextOnly)
    {
      Display(text);
    }
  }
}

I've duplicated the custom function and managed to modify its code to make a specific character to say his cue, the same as the custom Narrate function does, but it's only for a specific character:

Code: ags
void Roger(int cue, String text)
{
  String cueString = String.Format("&%d", cue);
  {
    if (Speech.VoiceMode == eSpeechVoiceAndText && IsSpeechVoxAvailable())
    {
      AudioChannel* ch = Game.PlayVoiceClip(cEgo, cue);
      cEgo.Say(text);
      if (ch != null)
      {
        ch.Stop();
      }
    }
    else if (Speech.VoiceMode == eSpeechVoiceOnly && IsSpeechVoxAvailable())
    {
    cEgo.Say(cueString);
    }
    else if (Speech.VoiceMode == eSpeechTextOnly)
    {
      cEgo.Say(text);
    }
  }
}

Can you help me out making it work for any character?

Thanks

UPDATE:
I've just nailed it! The problem I had is that I declared the name 'character' after Character* which is already in used by AGS, so I changed it to 'myCharacter' instead.

Here's the code if anyone is interested not to include the speech file pointers ('&') in the actual character strings. This is very handy if you don't want to have the '&' pointer along with the strings in your translation file, and so you won't have to copy it for any translated lines below the original line. :)

Code: ags
// this function is used for showing character speech while having a speech file pointer OUTSIDE of the actual string.
// if you don't have a speech file yet just type 0 in its place.
// call for this function as follows where 1 is the first speech file of cCharacter:
// SayNew(cCharacter, 1, "A string for the character to say.");
void SayNew(Character* myCharacter, int cue, String text)
{
  String cueString = String.Format("&%d", cue);
  {
    if (Speech.VoiceMode == eSpeechVoiceAndText && IsSpeechVoxAvailable())
    {
      AudioChannel* ch = Game.PlayVoiceClip(myCharacter, cue);
      myCharacter.Say(text);
      if (ch != null)
      {
        ch.Stop();
      }
    }
    else if (Speech.VoiceMode == eSpeechVoiceOnly && IsSpeechVoxAvailable())
    {
      myCharacter.Say(cueString);
    }      
    else if (Speech.VoiceMode == eSpeechTextOnly)
    {
      myCharacter.Say(text);
    }
  }
}

Put the above in the GlobalScript header. And then call for it from other scripts like this, where cCharacter is your character ScriptName and 1 in the example is its first speech file Char1.ext in the Speech folder:

Code: ags
SayNew(cCharacter, 1, "the text string you wish the character to say"); 

* Note that this does not affect dialogue scripts and per my current knowledge, I'm not sure how to implement this in a way that dialogue scripts could use it with a speech file pointer that is outside of the literal string. So currently is you want to use this in dialogues you will need to use indentation and to use regular scripting method.
#146
Thank you so much @Crimson Wizard for taking the time to realte to all my queries! Much appreciated. :)

You 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.

As for the clarification about the '&' sign with the speech file number:
personally 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.

Personally (and I might be mistaken), I 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, and knows to pick the appropriate file from the sub-directories in the Speech folder if a translation is used. So while Ego1.wav in the root of Speech is used for the default langauge, Ego1.wav in Speech\Hebrew for examlpe is used as the speech file of the same line, only in Hebrew voice-over. So why would someone want to have it point to a different number? I mean, wouldn't it make a mess troubleshooting afterwards?

Hope it makes sense. :)

*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...?

**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; I had to take a translation file from a backup I had in hand and to copy it to the game's folder in order for the game to load again. Deleting the translation file from within the editor doesn't cause any issues loading the game without a translation file, though.
#147
Hi @Crimson Wizard

I 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?

I also found these problems so I share my feedback below if you find it required for future fixing:

- 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.

- 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(".

- 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.
 
All these matters can be worked-around by writing their content backwards. But the main problem is with the buttons that don't present the text from right-to-left based on the translation file //#TextDirection=RIGHT option.

Last 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. So 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 the 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.

Thanks
#148
I'm so glad to see the interest of members in my query. Everything that was done so far is beyond my knowledge and understanding, but the results look fantastic!

As a noob in AGS (even though I'm getting progress), to me a built-in feature (or plugin) to make such thing would be best, but I'm not sure how tedious of development in the engine it requires, so I'm not even asking.

Meanwhile, in the game I'm working on I changed the auto FadeOutAndIn feature in the General Settings to Instant, so I could have complete control on when to play transitions when changing rooms and when not to. I tried to make a duplication of a room in greyscale color and wanted to make it gradually transition to it with a CrossFade, but I couldn't find any way to manually call specifically for the CrossFade transition from the script; there's only way to call to FadeIn() and FadeOut().

Anyway, the AGS Fake Screen + Box Blur by @Dualnames for making the room greyscale while other elements on-top of it could remain in color also looks great; I haven't tested it yet, so I'm not sure if it can gradually make the room to go greyscale like a cross-fade and without any blur.
#149
Thanks guys! Will surely check both options.
#150
Thanks @Snarky for the prompt reply. I really don't want to relay on 256 color palette game, nor to have every background in my game twice as it won't be pratical since even if I would go in that route, this will only be for the background while I'll still need to turn each and every object and character in the room to greyscale as well.

I thought that there might be a plugin for doing such thing, but alas I don't find any - this may be off-topic but how do plugins are written for AGS anyway? Maybe I could ask a programmer friend to write such plugin so everyone could enjoy.
#151
Hi everyone,

Tried to look for this in the forum but can't seem to find that anyone has asked about it.

I would like to know if there's an opition in AGS to take the current state of a given room (meaning the exact frame of everything in it), and to make it gradually turn into a grayscale form of itself - like a cross-fade between 2 rooms?

I was thinking about 2 scenarios of using this:

1. When the player takes a close-up look on an inventory item, and then everything but the close-up item turns into a greyscale color, and so the player can be focued only on the colored image of the item; there's this "The Riddle of Master Lu" game that I really like which behaves like this when using/looking on inventory items. Here's a direct link for a specific time in a YouTube walkthrough video showing what I mean.

2. A colored credits rollup, showing on a froze frame of a room.

For the second scenario - I could just take a screenshot of the frame that I want in a given room and make a whole new room from it. And then to have a cross-fade between the rooms and have my colored credits rollup showing on top of it. But that's not an ideal way to achieveing this, as it will be only for that specific frame screenshot that I took. And if I decide to make some changes to the room I'll have to re-create that screenshot. And for the first scenario that will not work as I want this to happen dynamically in every place and state that the player is in.

Thanks
#152
Quote from: Khris on Fri 21/07/2023 07:14:45330 pages! Wow :-D

unhandled_event is a built in function. If it exists, AGS calls it whenever an event runs that doesn't have a handler function associated with it. It's closely related to the multi-cursor Sierra GUI and according event functions, so if your game uses the BASS or Tumbleweed template for instance, you're not going to really use it anyway.
Or rather, you should probably implement your own way of handling unhandled events.

Moving stuff into custom functions is a good idea in general, not only makes it your scripts more readable and organized but you can easily change global aspects, indeed.

Thanks so much for the detailed explanation, @Khris! Much appreciated. :)

As for my reference book - yeah, I called it AGS from scratch (the name may change) and it became long and detailed with information; I started from a complete empty project, as I wanted to learn my way with the engine from a complete scratch, and up to re-creating the base Sierra-style template game that comes with it. Then I began improving it and cover many aspects, such as making a plot, adding speech, building some puzzles, and also side features like the translation of a game to another language. By how it turned out, I really look forward to making a video tutorial course series on YouTube. Will update on the forum if and when it will be done. :)
#153
Thanks guys! As I progress in learning AGS (and writing some sort of a reference 'book' to myself that as of this moment has reached the 330 pages!), I always encounter with new problems and new creative solutions to solving them - I'm not a programmer so I don't immediately get many of the technical things, but I'm trying my best with the manual and the forum here, and only when I really don't find what I'm looking for I make a new thread and ask. I much appreciate your assistance! Thanks again. :)

@Khris, this is exactly what I'm after - to make my script right so I won't have to come back and change plenty of lines of code if I want to make a global change to something; I'm still trying to understand the suggested method that you mentioned, as I'm having some difficulties to understand this unhandled_event thing. But in general, I understand your point of using a function and then call for it, rather than writing the actual code many times in many places, and then having to tune it everywhere if you want to change something - I'm learning a lot from the Narrate function that you assisted me with. :)
#154
Hi everyone,

Is there way that global strings of generic messages, such as "That doesn't work" which is commonly used in else statements when using items on random things, could be included in the translation file?

I made some global strings in a game I'm working on so I'll only have to write them once, and then I call for them from any scenario that I like, preventing any duplications of the same line in the translation file. Though, I found that they don't get included when the translation file is generated...

If not, where would you put your generic messages in a way that they will be included in the translation file?

I've read here and found that I can just create a new script in the Scripts tree and that as long as the script will be above the other scripts, that I could call for things in it from the entire project. However, when I try to declare a string variable name and set it to store the actua text string that I wish to show to the screen, I get the error that type 'string' is no longer supported; use String instead. But when I try String with capital 'S', I get the error "cannot assign initial value to global pointer", so I'm not sure what I'm doing wrong.

Would appreciate some help.

Thanks
#155
Hi everyone,

Using AGS Editor .NET (Build 3.6.0.50)
v3.6.0, July 2023

Just wanted to report that if I open a few tabs in the editor, then go to a previous tab that was opened, change stuff and save my project (CTRL+S), the editor jumps to the most recent tab that was opened. Quite abnormal when saving your project regulary during each change you make and want to keep working on the same tab.

Thanks
#156
Awesome! Thanks @Crimson Wizard! You were one step ahead of me before I asked a further question - I just tried to make my function to start with the false state, and encountered with the problem that the return command which I had to put into the statement's brackets didn't work. Now with return RUN_DIALOG_RETURN; I can actually use it within the brackets. Though, I see that there is no parallel token for the goto-dialog command, so I have to use "dDialog2.start()" instead.

Anyway, I think that when using the unique dialogue script commands that it's all a matter of where you locate your statements in the code - sometimes it makes more sense to write them from end to start, and sometimes it's the other way around.
#157
Thanks @Matti!

I moved the "return" command after the last closing curly brackets and it works. But it doesn't work for "goto-dialog" which comes before it, so I need to use "dDialog2.start()" instead.

A little confusing - I thought that these commands need to come inside the curly brackets as they're part of the statements.

Anyway, thanks again! :)
#158
Thanks, @Khris! Not sure what I'm doing wrong. I still can't make it to work. Here's my code. It still gives me the error: Script commands can only be used in the area between a entry point and the closing return/stop statement

Code: ags
// Dialog script file
@S  // Dialog startup entry point
  if (wasTalkedWith_cJosh)
  {
Ego: Hello again.
  cJosh.Loop = 1;
  Wait(20);
Josh: Oh, hi Roger.
goto-dialog dDialog2
  }
  else
  {
Ego: Hi!
  cJosh.Loop = 1;
  Wait(40);
Josh: Hello.
return
  }

@1
  Wait(20);
Josh: Hi Roger! Name's Josh. Nice to meet you.
  wasTalkedWith_cJosh = true;
goto-dialog dDialog2

@2
  Wait(20);
Josh: No worries.
  cJosh.Loop = 0;
stop
#159
Thanks @Matti! :)

Using the regular scripting in dialogues with indentation to make the players talk works great. Though, I found that the dialogue scripting commands work with if statements as well, so I put an if statement that checks if wasTalkedWith_Josh is false, which then greets the NPC for a first time greeting using Ego: "Hi!". And then I added an else statement to it, which then greets the NPC with an "already know each other" message.

The problem I found however is that when using the regular dialogues commands, such as return, goto-dialog, etc within the if statement, it gives an error as if these commands "break" the if statement before it ended. And so it gives this error:

Script commands can only be used in the area between a entry point and the closing return/stop statement.

Any way of using if statements along with the regular scripting commands to return to options or to jump to other dialogues, instead of starting a different dialogue manually the traditional way with indentation?
#160
Hi everyone,

Been reading about dialogues in AGS in a few places, but can't find information on this topic:

I would like to have my characters greet each other for the first time they talk, but on their second talk and on I wish their greetings (whatever I write within the @S of the first dialogue) to change, as they already know each other.

What would be the correct way to doing this? I'm thinking about making a bool of 'wasTalkedWith' for each NPC, which will launch the first dialogue when the players talk with other characters, and then to turn it to true. Then, any further talk to the other NPC will launch a different greeting dialogue with an 'already know each other' greetings.

Is this the right way to doing this? Or perhaps there's a simpler way to change the @S greetings of a given dialogue?

Thanks
SMF spam blocked by CleanTalk