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

#21
Hello again. I'm making quite a bit of progress with my game and now I'm on the subject of translations. I have managed to make it possible to change the language, at runtime. However, when I save a game with a certain language, for example English, when I restore the game, the game resumes with the active language, not with the language in which it was recorded. I guess this is normal behaviour, isn't it? But... can you save the language in the game as a data added to the savegame?
#22
oh, thanks in order to check it it works I had this:
Code: ags
function on_event(int event, int data)
{
  
    if (event == eEventRestoreGame)
    {
       // Display("DATA %d ", data);
    }
    
}

but if I remove it, it works!!! Thanks!!! Very useful, as usual!!
#23
I have a GUI for restoring save games that works perfectly, except for one detail. These are snippets of their codes:
This is the function that makes appear the GUI:
Code: ags
function show_restore_game_dialog()
{
  gRestoreGame.Visible=true;
  gRestoreGame.X=(Screen.Width-gRestoreGame.Width)/2+500;
  gRestoreGame.Y=(Screen.Height-gRestoreGame.Height)/2;
  Mouse.UseDefaultGraphic();
  // get the list of save games
  gRestoreList.FillSaveGameList();

  if (gRestoreList.ItemCount > 0)
  {
    // if there is at least one, set the default text
    // to be the first game's name
    gRestoreText.Text = gRestoreList.Items[0];
  }
  else
  {
    // no save games yet, so default to empty text
    gRestoreText.Text = "";
  }
}

This is the code I use for restoring a savegame:

Code: ags
function btnRestoreGame_OnClick(GUIControl *control, MouseButton button)
{
    
    if (gRestoreList.ItemCount<=0)
    {
      player.Say("No hay ninguna partida guardada");
      cerrar_gui_propietaria(control);
    }
    else
    {
      if (gRestoreList.SelectedIndex >= 0)
      {
        //cerrar_gui_propietaria(control);
       
        RestoreGameSlot(gRestoreList.SaveGameSlots[gRestoreList.SelectedIndex]);
        
      }
    }  
  
}

The rest of the codes I think are not relevant.

When I test the game and record a game, it is perfectly recorded. If I use these routines to recover one of the saved games, it works too but....it fades-in to black, and the screen stays black permanently....until I press a key or the cursor mouse, so that with a fade-out the correct scene appears and the game continues without problem.
How can I avoid the need to have to press the mouse or a key for the process of restoring a game to be done perfectly?
#24
QuoteTo test if your game can properly load a savegame, you need to create a fresh savegame first, then restore this new savegame.
In order to to this, where are exactly the savegames stored?

here C:\Users\USER\Saved Games\NAME_OF_THE_GAME ??
#25
Oh thanks!! I didn't understand exactly the error message, because sometimes it says game:8, save 7, or game:10, save:9 or differents values.
#26
I have created a GUI to restore save games. For this, I have created a GUI with a list box (gRestoreList) in which I load the list of saved games and a text box (gRestoreText) in which I put the name of selected item:

Code: ags
function show_restore_game_dialog()
{
  gRestoreGame.Visible=true;
  gRestoreGame.X=(Screen.Width-gRestoreGame.Width)/2;
  gRestoreGame.Y=(Screen.Height-gRestoreGame.Height)/2;
  Mouse.UseDefaultGraphic();
  // get the list of save games
  gRestoreList.FillSaveGameList();

  if (gRestoreList.ItemCount > 0)
  {
    // if there is at least one, set the default text
    // to be the first game's name
    gRestoreText.Text = gRestoreList.Items[0];
  }
  else
  {
    // no save games yet, so default to empty text
    gRestoreText.Text = "";
  }
}

In this GUI I have also a buttom called btnRestoreGame and this is his function:

Code: ags
function btnRestoreGame_OnClick(GUIControl *control, MouseButton button)
{
  
  if (Game.GetSaveSlotDescription(gRestoreList.SelectedIndex)==null)
  {
    Display("no hay nada en el slot %d ", gRestoreList.SelectedIndex);
  }
  else
  {
    String selectedText = gRestoreList.Items[gRestoreList.SelectedIndex];
    Display("TEXTO en %d, es %s ",gRestoreList.SelectedIndex,  selectedText);
    RestoreGameSlot (gRestoreList.SelectedIndex);
  }
  
}

but when I prove the game, and I try to restore a saved game I obtain this error:



I don't understand why!! Any help???
#27
Thank you. As always very effective and useful!
#28
Is there any way to position a video (of a smaller dimension than the background) in a room, and also, that the video is seen at the same time as the background? (As if, for example, there was a room with a movie screen and a movie was projected, for example. Thank you!
#29
Thanks, very useful answer!!
#30
I'm sorry for the question, but I thought there was some kind of log or something similar that could show the value of the variables. The truth is that I have not only read the manual, but I have also translated it into Spanish... what happens is that sometimes, what we need is not usually in the form we expect it to be and even if we have it in front of our eyes we do not see. Nevertheless, thanks for the answer!
#31
I am trying to modify a dialog window to show the options with custom designs, but I have a question about how to show the value of variables in real time in "runtime", with a function such as "trace" or "console.log" or something similar, but I don't know how to do it...
The situation is that in a customScript I read
All of the Custom Dialog functions run on the non-blocking thread. That means that you should not make any blocking calls, such as Character.Say, Wait or Display within them, as they may not behave correctly

and I don't know any other way to display values on the screen apart from display and player.Say
Thanks!!
#33
Hi! I've understand all the process explained here https://adventuregamestudio.github.io/ags-manual/CustomDialogOptions.html#custom-dialog-options-rendering but I'm trying to add a background image but it doesn't work:

Code: ags
function dialog_options_render(DialogOptionsRenderingInfo *info)
{
 // info.Surface.Clear(GamePerxeo.color_fondo_dialogos);
  //info.Surface.Clear(COLOR_TRANSPARENT);
  DrawingSurface *surface = info.Surface;

  surface.DrawImage(info.X, info.Y, 1097, 10);
  int ypos = 0;
  // Render all the options that are enabled
  for (int i = 1; i <= info.DialogToRender.OptionCount; i++)
  {
    if (info.DialogToRender.GetOptionState(i) == eOptionOn)
    {
      if (info.ActiveOptionID == i)
        surface.DrawingColor = GamePerxeo.color_opciondialogo_activa;
      else
        surface.DrawingColor = GamePerxeo.color_opciondialogo_noactiva;

      surface.DrawStringWrapped(5, ypos, info.Width - 10,
              eFontPerxeoFont, eAlignLeft, info.DialogToRender.GetOptionText(i));
      ypos += GetTextHeight(info.DialogToRender.GetOptionText(i), eFontPerxeoFont, info.Width - 10);
    }
  }
}

The image I want to add is supposed to have the ID 1097 but with the above code, the background image does not appear. what am i doing wrong?
#34
I am very grateful to you, and yes, it is true that practically everything is in the manual, but even reading the manual sometimes, not everything is 100% clear to me and it is difficult to find suitable examples out there.
#35
I have some questions about customizing the dialogs.
1) It is possible to use a GUI as a place to show the texts of the dialogs and I understand that this GUI has to have a text-label to be able to show the options of the dialogs there, but where does AGS tell that this is the field-text where to put the dialogues?
2) How do you change the typography of that text field?
3) What configuration is needed in the GLOBAL SETTINGS for our custom GUI to be used?
#36
Thanks!! SOLVED with capitals!!
#37
thanks!!! I supose that it's not managed with the unhandled_event native of Ags, it isn't?
#38
What is the way to indicate which is the exclusive inventory object with which we want to interact so that it is the only one possible and any other interaction is interpreted as invalid and is not detected by the function hotspot.IsInteractionAvailable(mouse.Mode)


In other words:
1) If I use the correct inventory item with an hotspot i want to run the correct action with isInteractionAvailable
2) If i don't use the correct inventory item with an hotspot i want to run a personal unhandled event to manage it.
 
#39
The dedication you have with newbies like me is incredible! Admirable! Thanks a million, I'll check it out right now!
#40
And one of the randomFunctions as example could be this one (the others are similar):

Code: ags
function RandomSay (String name,  int generoNumero,  int x,  int y)
{
  int random;
   String demostrativo;
   player.Walk(x, y, eNoBlock);
   player.FaceLocation(x, y, eNoBlock);
  if (generoNumero==1)
  {
    demostrativo="ese";
   }else if (generoNumero==2)
   {
     demostrativo="esa";
   }
   else if (generoNumero==3)
   {
     demostrativo="esos";
   }
   else
   {
     demostrativo="esas";
    }
   
// Genera un número aleatorio entre 0 y 5
	random = Random(5); 
  // Mostrar un mensaje correspondiente al número aleatorio
	if (random==0) player.Say("¿Qué puedo decirle a %s %s que tenga sentido?", demostrativo,  name);
	else if (random==1) player.Say("No quiero hablar con %s %s, creo no me va a ayudar.", demostrativo,  name);
	else if (random==2) player.Say("No se que decirle a %s %s. ", demostrativo,  name);
	else if (random==3) player.Say("¿Estás seguro de que quieres hablar con %s %s?", demostrativo,  name);
	else if (random==4) player.Say("¿Hablar con %s %s? ¿Estás loco?.", demostrativo,  name);
	else if (random==5) player.Say("No tiene ningún sentido hablarle a %s %s.", demostrativo,  name);
  Mouse.Mode = eModeWalkto;
}
SMF spam blocked by CleanTalk