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

#1
I'm working on a little tribute to the classic GameBoy:

#2
Quote from: eri0o on Fri 10/11/2023 10:56:30(...) and some jams specifically disencourage using it - GMTK jam is the one I think here.

Yes, I have noted that too. I never understood this prejudice since, although AGS is mainly used for adventure/point & click, it is somewhat versatile. While the game is 2D* and goes up to 1080 (I don't know how the engine works with various 4K animations), till now I haven't found anything in it that I can't do in, for example, Unity or Godot.

*Yeah, I know there are modules for a kind of 3D, but clearly, it's not the engine's strength. And that isn't a problem for me.

I don't believe in good or bad game engines... there are engines optimal for the game you want to develop. And AGS seems very competent to me.
#3
The theme is interesting! I can't promise anything, but maybe I'll start working on a little game. I even have the idea of putting in some Easter eggs related to previous MAGS themes of this year.
#4
A draw, wow. It's fair, though. I liked both games.
#5
Great to see that there will be, at least, two entries this month!

I'm currently playin' The RoadTrip in my RG351V:


#6
Quote from: Khris on Mon 12/06/2023 22:16:45(...) it probably stems from accidentally using player.IsCollidingWithObject(i) I guess.

You're right, Khris! That was the problem. This is how the code ended up so that the sound plays only once every time the player enters the collision zone... and it works without problem:

Code: ags
// above rep_exe
AudioChannel* objCollision;
bool hasCollided = false;

void roomCollisions() 
{
  bool isColliding = false;

  for (int i = 0; i < Room.ObjectCount; i++) 
  {
    if (player.IsCollidingWithObject(object[i])) 
    {
      isColliding = true;
    }
  }
  
  if (isColliding && !hasCollided) 
  {
    objCollision = aCOLLISION.Play();
    hasCollided = true;
  }
  
  if (!isColliding)
  {
    hasCollided = false;
  }
}
// inside rep_exe
 roomCollisions();

Many thanks!
#7
Quote from: Khris on Mon 12/06/2023 21:13:40This should work:

Code: ags
// above rep_exe
AudioChannel* objCollision;

void roomCollisions() {
  if (objCollision == null || !objCollision.IsPlaying) {
    bool playIt;
    for (int i = 0; i < Room.ObjectCount; i++) {
      if (player.IsCollidingWithObject(object[i])) playIt = true;
    }
    if (playIt) objCollision = aBang.Play();
  }
}

  // inside rep_exe
  if (player.Room >= 3 and player.Room <= 7) roomCollisions();

Thanks, Khris! Your first attempt before the edit was the very same I did (and it gave me a 'Type mismatch: cannot convert 'int' to 'Object*' error). But with this new code, it works perfectly! (I only have to change a little thing because I want to play the sound only once when the player enter the collision zone each time, but it was easy to do)
#8
I have a scenario where I need to play a sound every time the player collides with ANY object in the room, not just a particular one. I have a code that executes repeatedly and accomplishes this perfectly, but only with specific objects.

Is there a way to achieve the same result with every object in the room using the IsCollidingWithObject function? That way, I can write a single function that works globally in every case.

PPCollision module have a function named "CWithAnything" that does exactly this, but I have problems with the module (maybe because it's old).

Thanks!
#9
Nice theme! Sadly, I don't have much free time this month... I'll try something, though.
#10
Did you have the "Compiled/Windows" folder open in the (Windows) explorer while building the EXE? I have noticed I have to close that folder before build the EXE.
#11
Wow, many thanks @Crimson Wizard! That saves me a lot of time!

In my case I declare this function in the SpeechBubble script (obviously under void SayBubble):

Code: ags
void SayBubbleTra(this Character*, String message)
{
  this.SayBubble(GetTranslation(message));
}


without "GUI* bubbleGui" and "bubbleGui", and later Import it in the Header (of SpeechBubble script):

Code: ags
import void SayBubbleTra(this Character*, String message);

#12
Hi, @Snarky!

I've found a strange behaviour with the module (I just realize). With the default language it works perfect, but when I use the translation AGS system, the lines with .SayBubble don't get translated, but they are generated in the 'English.trs' file. (other things like labels, characters names... works well. The problem is only with the .SayBubble lines). I'm using AGS 3.5.1.22.

Alternatively I could write, in each SayBubble, something like:

Code: ags
if (Game.TranslationFilename=="")
{
player.SayBubble("Me pregunto si habrá algún poblado cerca...");
}
else if (Game.TranslationFilename=="English")
{
player.SayBubble("I wonder if there's a town nearby...");
}

but that would be tedious compared with the AGS translation System.
#13
Quote from: Crimson Wizard on Fri 14/04/2023 23:53:32If only 1 image is supposed to be on screen at the same time, then the easiest way here would be to have 1 GUI, and change its BackgroundGraphic. This way you always know if GUI with an image is visible, and which image is that.

Fantastic! Works like a charm, sometimes I tend to overcomplicate things  :-D
#14
Quote from: Crimson Wizard on Fri 14/04/2023 22:57:16How do you display these images exactly, in AGS terms? Why cannot you check whether *some* image is already displayed and remove it before displaying another one?

I was a bit more inexperienced when I did that game so: all the 15 names in the board are, each one, a button GUI (example: Button6/Helmet). When I click that button GUI another GUI (that contains the image, gHelmet) is set to visible=true. For example:

Code: ags
function Button6_OnClick(GUIControl *control, MouseButton button)

{
if (onoff==0) //to check the mouse click
  {
gHelmet.Visible=true; //the hint image displayed
onoff=1;
  }
  else if (onoff==1)
  {
    gHelmet.Visible=false;
    onoff=0;
    }

As far they are 15 image GUIs (gHelmet, gRabbit, gDeet, and so on) and therefore 15 Button GUIs, I can't find a reliable way to do what you said (check whether *some* image is already displayed and remove it) without writing too many lines of code. I'm sure I'm missing something.
#15
Last year, I created a small silly game for MAGS in a few weeks. Although it wasn't my first game made with AGS, it was my first "published" game (now I'm working on two more titles). While watching the video that Stupot kindly recorded for the MAGGIES 2022, I realized (among other things that I have fixed now) something weird: in one of the rooms (Roman room), we have a board with many items that we have to find. As a hint system, I made it so that when the name of the object is clicked, an image of the item appears (and when the name is clicked again, it disappears). That image(s) is/are also a GUI, just like the item names on the board (yeah, a label would be better). However, I noticed that when someone clicks on another name (without clicking again to make the previous image disappear), the previous image remains and the effect is pretty awkward. I'd want that when one name is clicked and the previous image remains, that previous image dissapear before that make the other visible.

Here's the video (courtesy of Stupot) at 24:10:


I was thinking of possible solutions... maybe creating an array and assigning each item name (which is also a GUI) a position in the array. But I can't find a way to do it.


Thanks!
#16
Wow, many interesting MAGS games! hard to select a few... but I've made my election.
#17
AGS Engine & Editor Releases / Re: AGS 3.6.0
Sat 01/04/2023 23:24:00
Thanks to everyone involved!
#18
Thanks, Khris! Works like a charm.
#19
Hi everyone!

I was trying to do what is on the title. I have a text label (label3) inside a GUI that says "Interact", and I want that when the cursor is over that label the label change its text to "Select" but, when the mouse leaves that label, I want it says "Interact" again.

I thought in using GUIControl  to get the mouse coordinates with GUIControl.GetAtScreenXY(mouse.x, mouse.y). But I have a problem because the text remains fixed in "Select" even when the mouse leaves the label (instead of change to "Interact" again).

That's my faulty code:

Code: ags
GUIControl *guicon = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
Label *lab;

  if (guicon != null) //Mouse is on the label
  {
    lab = guicon.AsLabel;
  }
  if (lab != null)
  {
    if (lab.OwningGUI==gInfo)
    {
      Label3.Text="Select";
      }
    }

Maybe there's a more efficient way to do that. I guess I'm complicating things  :) .

Many thanks!
#20
Thanks for the info about how system.gamma works, eri0o!

Quote from: eri0o on Sun 26/02/2023 10:32:25Are you trying to make a dark game and facing monitor differences?

Yes, my game has some dark rooms (forests, wetlands). On some monitors it looks a bit too much darker but, as I've tested it, it's not a really really big problem. So I'm not too worried about it. Maybe I'll put a Gamma slider on my Config GUI, but with a warning that it will only works on fullscreen (disabling it when windowed).
SMF spam blocked by CleanTalk