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

#21
Hi @Crimson Wizard I was wondering to ask you if it's possible with this module to have some sort of key pushed combination? For example if you push 'A' it goes with punch1, if you push another time 'A' (within a range of time) it goes with punch2 and so on? If that's possible how to do something like that?
#22
I see you had some experience from the past. I am sure if you keep improving your skill you'll become even much better. Currently I am working with my team on a game we are going to release this year if all goes well but if you need any kind of support/brainstorming I'd be happy to help.
#23
Quote from: Giacomo on Sun 07/07/2024 15:56:18I didn't know anything about scripting and graphic, so it took me a lot to make it, especially to draw animations and backgrounds.

The game look good, congrats. Did you had any past experience of drawing? Or you had zero knowledge and did these graphics? If that so its quite impressive because for a person like me, making this kind of graphics would take a whole lifetime if it goes well.
#24
Quote from: Khris on Mon 15/07/2024 19:52:18However you could also use custom dialog rendering to create your own simulated text box, but there's no easy way to do that, you have to do all the key processing and rendering yourself.

Alright I got it. Later I decided to change some mechanics to make it more easy and using only dialog scripts.

ps: Side note: There is no way to exit a dialog outside a dialog script? For example let's say I have a dialog running and I want to push a button to exit the dialog?
#25
Quote from: Khris on Mon 15/07/2024 10:50:30you need to use a dialog option that shows a separate text box to be able to have full access to what the player typed.

You mean like selecting a dialog option and it pop up a custom text box? like:
Code: ags
1. ask
2. eat
3. show text box
#26
Yeah this piece of code is what I have in my dialog_request which works fine.

Question was how I get the typed message submitted when you use the Show Text Parser inside a dialog script?
Because if you use the Show Text Parser inside a dialog script then the Parser.ParseText get called automatically without submit any string. My guess is that there is no chance to know what the player typed using this method.

A side note I think it would be useful also to have something like Parser.SetWordType(int wordGroup, eType); so you can have a word to be normal type but if you need you can set that word to be ignored later on in run-time, something like this:

Code: ags
if (param == dDialog1.ID) 
{
  if (Parser.Said("where are you")) 
  {
     string msg = Parser.GetLastWordTyped(); 
     Display("player typed: %s", msg);
     Parser.SetWordType(1, eIgnored); // set the word "where are you" to be ignored
  }
}
#27
Beginners' Technical Questions / Parser text
Sun 14/07/2024 22:27:29
Hey guys I am getting stuck while trying to do something. I am using the Show Text Parser inside a dialog script. This way AGS call automatically Parser.ParseText without to store any string. But how do I check what is the player text? Because I'd like to do something like:

Code: ags
if (param == dDialog1.ID) 
{
  if (Parser.Said("where are you")) 
  {
     string msg = Parser.GetLastWordTyped(); 
     Display("player typed: %s", msg);
  }
}
#28
Thanks Khris, that's right, I just had to append the whole thing which make sense.
#29
That's cool! Btw you can find this in the manual by searching for: Game Variables. I might know this because I have been using ags for 11 years now. Regarding the other questions you might wait for someone like Crimson Wizard or some other dev.
#30
Are you using the "Think" function to display this text? Btw maybe you can add this on game start:

Code: ags
game.speech_bubble_width = 400;
#31
If you don't mind can you show a picture on how this is looking?
#32
I think a workaround can be to have a custom GUI where you display your text? Maybe the size of the text border box have his size regardless what is your resolution but it's just a guess.
#33
My guess is that you can do it with variables. Like you can declare some variables outside at the top of the script:
Code: ags
int ObjPositionX, ObjPositionY;
Then on room_load you set the variable to be the init object position:
Code: ags
ObjPositionX = oObject.X;
ObjPositionY = oObject.Y;
When you need to reset then you can do the opposite:
Code: ags
oObject.X = ObjPositionX;
oObject.Y = ObjPositionY;
#34
Yeah I notice there is now String.Join() which seems to be looking cool. I've been trying to use it but it always gives me an error that it can't convert string[] to string or viceversa, I am sure I am doing something wrong. By the way, I've been trying to code a different version to split the words into array. While this seems to be working there is something which it doesn't for some reason.

Code: ags
#define MAX_NUM_WORDS 7
  
String Words[MAX_NUM_WORDS];
int numWords = 0;

function SplitWordsIntoArray(String input)
{
  bool _go = true;
  numWords = 0;
  int space;
  
  while(_go)
  {
    space = input.IndexOf(" ");
    
    if (space == -1) // only a single word has been found
    {
      Words[numWords] = input; 
      _go = false;
    }
    else // add words into array
    {
      Words[numWords] = input.Truncate(space);
      input = input.Substring(space + 1, input.Length);
    }
    numWords++;
  }
}

Now if I use to "Display" those words its working good:

Code: ags
int i = 0;
while(i < numWords)
{
  Display(Words[i]);
  i++;
}

but if I use a label then it display only the last word, I've been trying to do this also in rep_exe but its always gives me only the last word
#35
Thank you guys for the tips I really appreciated, I will keep them in mind now. Yesterday I tried to keep coding the piece of script I shared with you, just to see how this will look in the long term. While all of this seems to be working good the whole script looks like an nightmare and difficult to keep track of. I might need to split each step on different functions and not doing everything in a single one.
#36
@eri0o Thanks for the tips. I was wondering how can I check how many words has been found and adding them to the formatting string? For example let's suppose I have something like this:

Code: ags
if (words[0].CompareTo("where") == 0) 
{
  if (words[1].CompareTo("is") != 0) Display(String.Format("Word is: %s", words[i])); 
  else Display(String.Format("Words are: %s %s", words[i], words[i])); 
}

// so if one word has been found:
// Display(String.Format("Word is: %s", words[i])); 
// if two word has been found:
// Display(String.Format("Words are: %s %s", words[i], words[i]));
// and so on -

Now while I was writing this message I thought that maybe I can add a new string called "message" which take care of that like:

// if one word has been found:
Code: ags
message = String.Format("%s", words[i])); 
// if two word has been found:
Code: ags
message = String.Format("%s %s", words[i], words[i])); 

And then later on I could simple call:
Code: ags
Display(String.Format("%s", message));
#37
@Crimson Wizard Thank you it's working good now! 😊

@Khris Thanks. The "CompareTo" seems to be working much better than the "IndexOf" for this kind of task. Here is what I got so far:

Code: ags
function CheckWords()
{
  // Array to store words
  String words[]; 

  // Split the input sentence into words
  words = txt.Split(" ");
  
  // Print out the words
  for (int i = 0; i < words.Length; i++) 
  {
    if (words[0].CompareTo("where") == 0) 
    {
      Display(String.Format("Word is: %s", words[i])); 
    }
    else
    {
      Display("No words to check.");
    }
  }
}

I don't know how to write something like -
if 3 words has been found then the display will format 3 words, if 2 words has been found then the display will format 2 words and so on and if none has been found then he just print no words to check. I could add those manually each time but I'd like to avoid doing that a thousand of times
#38
@Khris Thanks for the advices I will try to work out on it.


@eri0o
Thanks for your suggestion this might come very handy.
Do you mean this one?
https://www.adventuregamestudio.co.uk/forums/ags-engine-editor-releases/ags-3-6-0-patch-11/
Also I can't see to find this extended compiler in the General Settings.

Sorry you might mean this one:
https://www.adventuregamestudio.co.uk/forums/ags-engine-editor-releases/ags-4-0-early-alpha-for-public-test/

@Crimson Wizard  I am sorry for the tag, I am now using the latest ags4 and im trying to enable the extended compiler (I have your module Key Listener) and when I try to compile the game it pop up this error on the output console:



How can I fix it? I see that if I hide that piece of code then I get the same message for others functions inside the module
#39
Quote from: Khris on Thu 11/07/2024 16:39:39(leaving aside whether it's a good idea to have a game that will stop functioning if the server goes down/away).

This is a point to be honest. Using an online API to do such task is definitely a life safer but it's risky for this reason you mentioned. Going a few steps backwards I'd like to ask you a noob question which I hope you dont mind. I am using the String.IndexOf function to check if a word has been found. But I was wondering if there is a more solid method to do that. I noticed that if I have these two words like: "she" and "he" or "where" and "here" they both have "he" and "here" so for the function is like they are the same which I'd like to avoid that.
#40
Nice I am happy at least you got it solved and also thanks for the clarification. But I dont get why you said that you'd probably use an existing online API and http requests via the sockets plugin if this apparently can't be done? Or maybe you wasn't talking about using AGS?
SMF spam blocked by CleanTalk