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

#61
AGS Engine & Editor Releases / Re: AGS 3.6.0
Sat 01/04/2023 23:24:00
Thanks to everyone involved!
#62
Thanks, Khris! Works like a charm.
#63
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!
#64
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).
#65
I wasn't sure where to post this, but I guess this is the right place.

It's a triviality, very low priority request. But I'd want to know if there's a posibility to make System.Gamma works on windowed mode (for now this only works on MS Windows FullScreen). IDK if that's a hard thing to do (or if it's even possible), but I leave this request for future.

Thanks!
#66
The virus thing has been discused before, it's indeed a false positive (at least the majority of cases). I think I remeber that it has to do with the engine accesing to the .exe repeatedly (or something like that). From memory, one of the solutions is in General Settings>>Compiler set "Attach game data to exe" FALSE. But sure Crimson Wizard knows more about it. 
#67
Quote from: Crimson Wizard on Tue 21/02/2023 20:08:58This was done in the experimental branch, but now added to 3.6.0 in the latest update.
https://www.adventuregamestudio.co.uk/forums/ags-engine-editor-releases/ags-3-6-0-release-candidate-rc1/msg636653570/#msg636653570

Wow thanks, CW! I'll be testing it. I'm on 3.5.1 but that's an excellent reason to "migrate" to 3.6.0.
#68
If I understand you correctly: for the textbox you have to create a new text GUI (in the GUI's option on Explore Project). And in Game Start function (At Global Script) set that text windows GUI. For example: "SetTextWindowGUI (X);" where X is the number of your text GUI.

For the portrait: in General Settings, Speech Style: SierraWithBackground. Later you have to set a Speech View to your character(s).

I recomend you to read the AGS Manual.

#69
This maybe it's a silly question but... Is there any way in game to set VSync true/false with D3D9 or OpenGL? (System.VSync only works with Software Render)

I know I can set this from the editor (Default Setup), but it would be nice if the user can change it via a GUI inside the game.   
#70
Quote from: Snarky on Mon 13/02/2023 07:29:17There is another small improvement we can make in case a particular problem arises:

If the character movement is linked to animation (often called "anti-glide"), and the character movement speed (the distance it moves per animation frame) is large, and the animation delay is significant, then the fade-in effect could appear "jerky," with sudden jumps in transparency.

Specifically, this could become noticeable if AnimationDelay > 2, and 100*MovementSpeed/(endX-startX) >= 2 (but especially if it is some higher number like 4 or 5).

Thanks, Snarky! Since my character's movement speed is 8 and AnimationDelay is 4 (and that without counting that the character can run if user double click/ hold shift) the improvement is very welcomed.


#71
Yeah, we can agree on that. But as English isn't my first language sometimes i'm afraid of sound rude when isn't, always, my intention.
 
Quote from: Snarky on Mon 13/02/2023 06:51:59Note that we don't use player.Moving or any kind of loop: the transparency is directly tied to the character position, so it will automatically update as the character moves. And therefore we don't need any Waits or anything like that: the mapping of the position to transparency ensures that it fades in to reach full opacity only when the character arrives at the target X.

Wow, Snarky that's exactly what I wanted to do. Many thanks!
#72
Quote from: Snarky on Mon 13/02/2023 06:18:21"it doesn't work,

First of all: I never said Khris code doesn't work wich would be disrespectful. I only use the phrase doesn't work with my own code (I have the right to be disrepectful with myself  :-D). And later in my first reply I have done just that: explain what it does and how it differs from what I want to happen.

Yes, I know put a Wait on rep exec function isn't the best idea, that's why I call this a workaround and not a proper solution.

That's being said... I have been adapting the number of Khris code to my coordinates. But I couldn't get the desired effect. Many thanks anyway, Snarky!
#73
Quote from: Snarky on Mon 13/02/2023 05:59:57The only issue I can see with it is that depending on your animation speed

That's the key. With Khris code as is, the GUI becomes solid very fast. With my workaround (that involves Khris code) the GUI becomes solid more slowly, which produces a more dramatic effect.

#74
Well, I found a kind of workarround...

I create a Variable: int movement=100.

and in Room_RepExec:

Code: ags
if (player.Moving)
{
  Wait(10);
  movem--;
  }

 int tr = movem; // Khris code :-)
  if (tr < 0) tr = 0;
  gDark.Transparency = tr;

Not exactly what I had in mind, but close enough I guess.
#75
I was thinking on define the starting point (A) and the ending point (B) of my character's walk and assume that A is at (x1) and B is at (x2). And later write a script that will "read" my character moving from A to B and adjust the transparency of gDark along the way.

For example, something like:

Code: ags
 int x1 = 100;
 int x2 = 200;
 
 int steps = 100;
 
 int dx = (x2 - x1) / steps;
 
 for (int i = 0; i < steps; i++)
{
  if (player.Moving && x1 + i * dx)
  
  {
     gDark.Transparency = 100 - i;
  }
}

But, of course, that doesn't work neither  :-D
#76
Quote from: Matti on Sun 12/02/2023 12:43:25This depends on how you want it to work exactly. Should the GUI only become more visible while the player walks and should it immediately become invisible again if the player stops?

You could link the transparency directly to room coordinates, like this for example:

Thanks for the reply, Matti! Surprisingly your code is very similar to my first try, but for some reason as my code doesn't work I go for other stranger paths.

Quote from: Khris on Sun 12/02/2023 13:57:42while is used to create a loop (...)

Thanks for the explanation, Khris!

Quote from: Khris on Sun 12/02/2023 13:57:42A use-case for that is a blocking cutscene where the camera pans across a room.

Yes, I used it (instinctively, but without fully understanding it) when I need to pan the camera across the room at Intro.

Quote from: Khris on Sun 12/02/2023 13:57:42AGS has the three repeatedly_execute functions

Yes, I knew that  :-D  But, for some reason, I was confused about what exactly while does.

Well, I undestand what your code does, but I realise I didn't explain myself well. What I want to do is that the GUI appears slowly as my character walks from A to B, being A gDark.Transparency=100; and B gDark.Transparency=0;. But in the middle of the path from A to B, gDark should has a range of transparency (99, 98 ... 1, 0). So the effect is that the gDark appears very slowly while the character walks up to the B point (a region that trigger an event).   
#77
I was wondering if there's a way to link the character movement, for example, to the properties of a GUI (like its transparency). So while a character (the player) walks in X axis coordinates a GUI could slowly became visible (from 100 to 0 transparency). Or even a Music could slowly became more loud.

Maybe with a while condition?

Code: ags
While (player.moving? player.x >Screen.Width / 2?)
{
GUI.transparency--;?
}

But i'm sure I'm not understanding how while works.

Thanks!

#78
Quote from: Khris on Mon 06/02/2023 21:33:34Yeah, my bad; .TopItem is an integer. I fixed the code in my post :)

Thanks Khris! It works like a charm!  :)

Now that you said it, it makes sense that .TopItem is an integer.
#79
Quote from: Snarky on Thu 02/02/2023 10:44:01I would also add:

-each time the player quits/exits to main menu/brings up the main menu

The only little wrinkle is that you should then ensure that when the game is loaded, it doesn't start off with those menus open. You can do this by closing them in on_event(), inside a check if(data==eEventRestoreGame).

Agree. That's what I do in Another Museum (my MAGS game).

In GlobalScript I create a bool

Code: ags
 bool QuitTheGame = false;

Then in Repeatedly Execute Always I put:

Code: ags
if (QuitTheGame)
      {
        QuitGame(0);       
       }

And made a function on event:

Code: ags
function on_event(EventType event, int data)
{
  if (event == eEventRestoreGame)
  {
    gQuit.Visible = false;  //My quit the game GUI
    QuitTheGame = false; 
  }
}

And last in the On Click script of the button of "Quit" in my quit GUI:

 
Code: ags
gQuit.Visible = false;
      QuitTheGame = true; 
      SaveGameSlot(1, "AutoSave"); 
#80
Quote from: Khris on Mon 06/02/2023 10:53:26You can use this

Thanks for your time, Khris. But it's weird. I write the code inside the function as you said:

Code: ags
function btnInvDown_OnClick(GUIControl *control, MouseButton button)
{   
     InventoryItem* ii = invCustom.TopItem; 
  invCustom.ScrollDown();
  if (ii == invCustom.TopItem) aStuck.Play();
  else aScroll.Play();
}

and I get this error:

GlobalScript.asc(534): Error (line 534): Type mismatch: cannot convert 'int' to 'InventoryItem*'

I'm confusing about what is happening to get the Type mismatch: cannot convert 'int' to 'InventoryItem*' error  :-\

Quote from: Matti on Mon 06/02/2023 11:30:36On a side note: As a player I find it convenient if the arrow buttons already indicate that there are no more items in one direction.

Yes, it's a very good idea too. Thanks  :)
SMF spam blocked by CleanTalk