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

Topics - PERXEO

#1
I want to make a cutscene animation, in which my character uses a skateboard to go from one side of a room to the other. During this movement (that I'm going to do with programming as you can see in my snippet of code), I want a view to be shown in which the character goes "swinging his arms" as if he were surfing. In a repeatedly_executed I have created this function
Code: ags
 int frame=0;
  if(GamePerxeo.SkatingActive)
  {
    player.UnlockView();
    //player.ChangeView(8);
    player.LockView(8);
    frame+=1;
    //player.Animate(8, 0);
    if(frame>=24)
    {
      frame=0;
    }
    player.Frame=frame;
    posPlayerx+=10;
    player.x=posPlayerx;
    skate.Visible=true;

view 8 is the view where the player is over the skateboard in a loop waving their arms.
skate is an object with represents the skateboard.

With the previous code the player is moving from a side to the other but only shows the firts frame of the view. I want to show all the frames of this view in a loop...until my player comes to the end.

Thanks for your help!!
#2
Beginners' Technical Questions / Reset a TIMER
Wed 24/05/2023 15:08:01
I see that in AGS there are only two functions (as far as I know), which have to do with TIMER. One is
Code: ags
SetTimer(int timer_id, int timeout)
and the other is
Code: ags
bool IsTimerExpired(int timer_id)
.
However, I would like to know how to override a SetTimer once it has started, ie something like StopTimer or ResetTimer. In any case, how do you cancel a timer so that it starts again from zero?
#3
I'd like to make a timer so that only when the player is standing still for a series of cycles, it could trigger a nice action like saying something, or scratching or looking at the clock. Something like
Code: ags
if(!player.Moving)
  {
     SetTimer(1,10000);
     if (IsTimerExpired(1)) 
     {
       player.Say("I'm getting bored");
        ,,,,any other action....
     }
  }

but I don't know where to place it and how to make it work correctly...
#4
Hi everyone! I've a snippet of code similar to this
Code: ags
 PuzzleD.rows[0]=getRow(0);
    PuzzleD.columns[0]=getColumn(0);
    piece0.X=posxInitial+(PuzzleD.columns[0]*witdh);
    piece0.Y=posyInitial+(PuzzleD.rows[0]*height);

 PuzzleD.rows[1]=getRow(1);
    PuzzleD.columns[1]=getColumn(1);
    piece1.X=posxInitial+(PuzzleD.columns[1]*witdh);
    piece1.Y=posyInitial+(PuzzleD.rows[1]*height);

 PuzzleD.rows[2]=getRow(2);
    PuzzleD.columns[2]=getColumn(2);
    piece2.X=posxInitial+(PuzzleD.columns[2]*witdh);
    piece2.Y=posyInitial+(PuzzleD.rows[2]*height);
.........................................
 PuzzleD.rows[n]=getRow(n);
    PuzzleD.columns[n]=getColumn(n);
    piecen.X=posxInitial+(PuzzleD.columns[n]*witdh);
    piecen.Y=posyInitial+(PuzzleD.rows[n]*height)


I want to resume this in an unique loop like this

Code: ags
 for(int i=0;i<=N;i++)
    {
        PuzzleD.rows[i]=getRow(i);
        PuzzleD.columns[i]=getColumn(i);
        "piece"+i.X=posxInitial+(PuzzleD.columns[i]*witdh);
       "piece"+i.Y=posyInitial+(PuzzleD.rows[i]*height);
}

but I don't know exactly how to do it. Piece1, piece2, piece3, .... pìeceN, are objects on a room, but I don`t have any idea how to parse it... thanks for your help!!!
#5
What functions, methods and properties does AGS have for handling arrays, and where is the glossary where I can find these elements?
In some sample code that has fallen into my hands, I have been able to see functions like lerp, but... I can't find them in the official manual.
#6
Hi everyone!!
I have another small problem with translations and audios in other languages.
I have these two codes, associated with two buttons for the English and Spanish language in the status bar. They are to change languages ��during the game.

Code: ags
function btnSpanish_OnClick(GUIControl *control, MouseButton button)
{
    Game.ChangeTranslation("Spanish");
    translation = "Spanish";
    Game.ChangeSpeechVox("Spanish");
    player.Say("A partir de ahora, todo será en Español");
    gControl.Visible=false;
    
}

function btnEnglish_OnClick(GUIControl *control, MouseButton button)
{
    Game.ChangeTranslation("Ingles");
    translation = "Ingles";
    Game.ChangeSpeechVox("Ingles");
    player.Say("From now on, everything will be in English");
    gControl.Visible=false;
}

Everything works "quite" well except that the dialogues do not change to English when I activate English as the language. However, all the rest of the texts, descriptions, player.Say("xxxx")...etc work perfectly. I have followed all the steps that come in the tutorial but no matter how much I compile over and over again and check the .trs files I can't find the solution.

Should I do something else, for the dialogs to change to the chosen language?
#7
I'm making progress in a game, and now I'm on the subject of voice translations.
I've created some subdirectories nested inside the "Speech" folder. One of this is "Spanish" and the other is "English". Inside I've put some audio files with the XXXXY.EXT way to name those things as explained on the tutorial.

I can see on tutorial that:

QuoteFor example, if you have this folder structure in your game project:

Speech

Francais

MyLang
then the editor will create following voxes:

speech.vox (with files only from the root "Speech" folder);
sp_francais.vox (with files from "Speech/Francais");
sp_mylang.vox (with files from "Speech/MyLang");

What I don't know is, where are these voxes created? (I do not see them)
When I tried to change language, with

Code: ags
Game.ChangeTranslation("Spanish") == true;
    translation = Game.TranslationFilename;
    Game.ChangeSpeechVox("Spanish");

the translation of dialogs and text is correct, but the change to the audio language doesn't work properly. I think this is because the voxes files are not created, but I don't know how to do it...

#8
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?
#9
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?
#10
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???
#11
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!
#12
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!!
#13
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?
#14
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.
 
#15
I have a code snippet for unhandled_events, which I want to use to give special responses to certain unhandled events.
Code: ags
function unhandled_event(int what, int type)
{
String locname;

locname = Game.GetLocationName(mouse.x,mouse.y);
  int randomNumber=Random(100);
  int usemode=game.used_mode;
  gLabelAction.Text=String.Format("%s, %d, %d", locname, randomNumber, usemode);
...
}


The gLabelAction tag is a label that I use to show the typical text in the status bar, to indicate "Use xxxx" or "View xxxx" LucasArts style.
When I hover over a hotspot, the text initially appears fine, with the name of the hotspot, but when the player hovers over the cursor, the unhandled event is updated with the name of my player. This invalidates the usage because it now says things like "Use this Peter" or "Look at this Peter" instead of "Use this piano" or "Look at this piano" which would be desirable. The randonNumber is only to show me that the unhandled event changes over the time.
What triggers the unhandled-events? on a click? are they like repeatedly-executed? How can I restrict it to the first click on a hotspot?
#16
What is the best place and the best method to determine if an object is solid or not? I mean to know in which part of the code should this type of thing be initialized? That is, at what point should I set oObjectX.Solid=true? In roomxxx.asc? In globalScript.asc?
#17
I have an animation where a character reaches down to pick up something on the ground, but I can't make the object disappear at just the right moment. The animation is too long and I wish it could know exactly which frame the frame where the object is taken is in, to make a call just at that moment so that it disappears at the right moment. I've sometingh like that:
#18
What is the best way so that when using an inventory object A, with an inventory object B, the resulting action is the same as if we do it the other way around, that is, use the inventory object B with the inventory object A ? When there are a lot of objects in a game, what is the best way to implement this?
#19
In an unhandled event, I can know two parameters that are the what and the type to know if we are interacting with a hotspot, an object, an inventory object, etc...
I would also like to know how we can find out which is the exact object that has called that unhandled event, to know not only if it is an object or a character, but also what it is and what its specific ID is. That's possible?
#20
I'm trying to add two walk behind areas to my game. First I select the Walk-Behind area ID 1, >>> Import mask from file >>>> and load the BMP image for area 1 and set the baseline. Then I select the Walk-Behind area ID 2 >>>> load another BMP for this area 2 and establish its baseline. Now when I go back to the walk-behind ID 1 area...it's gone. I don't know if there can only be one bmp loaded at a time, or I'm putting the layers in the wrong order to place my walkable-areas, but I don't know what the proper process is to be able to have 2 walk-behind areas at the same time .... any help????
SMF spam blocked by CleanTalk