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

#261
I considered that, but in the first instance I thought it is better to keep the logic separate, so that the update function doesn't need to consider anything about how the GUIs are positioned and why, except that they are meant to be room-relative. With your method you'll either need another set of position coordinate variables for each GUI (and although that doesn't look so bad when it's just one of them, like in your example, I was imagining that there could be quite a few), or you'll have to copy all the original positioning logic to the update function.

As for the second case, if the characters/objects may move as well, and the GUIs need to be repositioned relative to them, then sure, you can't get away from the need to rerun the positioning logic. (But this was not the original question.) In that case, if you have a lot of GUIs, I would suggest pulling that out into its own function.
#262
Wordle 578 4/6*

⬜🟨⬜⬜⬜
⬜⬜⬜🟨🟨
🟩🟩🟩🟩⬜
🟩🟩🟩🟩🟩

Not a word I could define, beyond
Spoiler
"Is it some kind of vegetable?"
[close]
#263
Code: ags
int oldCameraX;
int oldCameraY;

function late_repeatedly_execute_always()
{
  int deltaX = Game.Camera.X - oldCameraX;
  int deltaY = Game.Camera.Y - oldCameraY;

  // Nudge all the room-relative GUIs
  myGui1.X = myGui1.X - deltaX;
  myGui1.Y = myGui1.Y - deltaY;
  // etc.

  oldCameraX = Game.Camera.X;
  oldCameraY = Game.Camera.Y;
}

Quote from: Rik Vargard on Tue 17/01/2023 21:10:56Thing is, I don't understand a thing about the code you shared and I'm sorry because I know you took that time to reply.

It's not all that complex. The short explanation is that any time the camera moves, it moves the GUI or GUIs equally in the opposite direction, so that they stay in the same position relative to the room. (Or, to put it a different way, it applies the on-screen movement of the room to the GUIs.)

To understand how it works, you just have to know that repeatedly_execute_always() is a function that runs each time the game updates, after all the other functions. And also that if you want a variable to keep its value even after a function ends, you need to declare it outside of the function. So in this case, what the function does is:

  • First (lines 6–7) it compares the current camera position to the last one (from the previous game update), subtracting the (X,Y) values to give the camera movement since the last frame, (deltaX,deltaY). ("Delta" is math jargon for "change", BTW)
  • Then (lines 9-12) it applies the opposite movement to the GUIs that you want to follow the room movement, just as in your code.
  • Finally (lines 14-15), it updates the "old" camera position to the current position. Because we declared these variables outside of the function (lines 1-2), these values will be used (in lines 6-7) when the function runs again on the next game update.

This method of storing some value from the last game update, comparing it to the current value to see if/how it has changed (and doing something that depends on the result), and finally updating the stored value with the current value so that you can do it all again on the next game loop, is a very common and useful pattern for detecting "events": code that needs to run when something changes/updates.
#264
The Rumpus Room / Re: *Guess the Movie Title*
Tue 17/01/2023 21:03:48
Quote from: LimpingFish on Tue 17/01/2023 20:24:55one critic cited the "preposterously happy ending" as a major fault, and it is quite an upbeat ending for such a dark story.

I'm guessing that critic wasn't a big bibliophile. :-\
#265
Yes, as the camera moves, you just move the GUIs in the opposite direction.

Code: ags
int oldCameraX;
int oldCameraY;

function late_repeatedly_execute_always()
{
  int deltaX = Game.Camera.X - oldCameraX;
  int deltaY = Game.Camera.Y - oldCameraY;

  // Nudge all the room-relative GUIs
  myGui1.X = myGui1.X - deltaX;
  myGui1.Y = myGui1.Y - deltaY;
  // etc.

  oldCameraX = Game.Camera.X;
  oldCameraY = Game.Camera.Y;
}

Note that GUIs don't like to be positioned outside of the screen. You may need to hide them if they go outside the screen edge.
#266
The Rumpus Room / Re: *Guess the Movie Title*
Tue 17/01/2023 13:02:51
Correct. It has (book and movie) directly inspired at least four adventure games: La abadía del crimen (1987), Il noma della rosa (1993), Murder in the Abbey (2008), and most recently Pentiment (2022).

Here's the next screencap I was going to share, just because I think the outfits are neat:


#267
The Rumpus Room / Re: *Guess the Movie Title*
Tue 17/01/2023 09:31:46
I expect this will give it away:



As a point of interest, I got this one from a list of movies recommended for adventure-game fans.
#268
(Used mod powers to unfix the first code block in @newwaveburritos's post so the problem appears.)
#269
Sorry to hear that, cat. It had me intrigued...

Wordle 576 2/6

🟨⬜🟨⬜⬜
🟩🟩🟩🟩🟩
#270
The Rumpus Room / Re: *Guess the Movie Title*
Mon 16/01/2023 07:18:31
Yeah, there was a certain Rutger Haurerishness about that last image... I haven't actually seen it; is it good? (I always think of Lady-Hawk and Lyndon-Bee Johnson from The Venture Bros.)

And was your hypothesis correct, @LimpingFish?

Staying with snowy mountains:

#271
The Rumpus Room / Re: *Guess the Movie Title*
Sun 15/01/2023 08:59:38
Ladyhawke?
#272
Expanding the question to another medium, are any of you familiar with the less-famous Golden Age authors (loosely construed), so that you can make any recommendations? I've been trying to explore beyond the top names (Christie, Sayers, Carr, Chesterton...), with mixed success.

My ventures so far include Freeman Wills Crofts, R. Austin Freeman, Josephine Tey, Erle Stanley Gardner, Q. Patrick/Patrick Quentin, Cyril Hare, Edmund Crispin, E.C.R. Lorac, Anthony Berkeley, Christianna Brand, E.C Bentley, J. Jefferson Farjeon, Baroness Orczy, Mavis Doriel Hay, John Bude, A.A. Milne, and Miles Burton (aka John Rhode). Out of these, the one I've liked best by far is Berkeley, along with Patrick Quentin. — Though I feel I ought to enjoy Brand in particular a lot more than I do. She is certainly a very clever puzzle-smith, up there with Carr and Christie, but I find her attitude to her characters so flippantly spiteful that I can't bring myself to care about their stories.

I'm thinking of next trying out Ronald Knox, Georges Simenon (whom I've only read a few short stories by), Berkeley's other alias Francis Iles, Henry Wade, H.C. Bailey, Nicholas Blake, Georgette Heyer, Gladys Mitchell, Rex Stout, Ellery Queen, S.S. Van Dine, Mary Roberts Rinehart, and G.D.H & Margaret Cole, as well as giving Allingham and Marsh another go. I would appreciate any tips!
#273
We've had paging bugs before where threads get lost between pages on a board, but I don't think I've ever before noticed posts going missing between pages of a thread. However, currently this post (from 25. December at 10:01:51 CET, where I talk about just having seen Glass Onion) does not appear for me either on page 2 or 3 of the thread.
#274
Yes, that was apparently added to the Ustinov adaptation; it's not in Christie's novel (and strikes me as a rather cheap kind of clue of the sort you've mentioned you don't like, Kyriakos). I think the Clue-reference is just to set up or underline how Janelle Monae spends the flashback basically playing Clue with all the suspects, crossing off motives and means on her list.

As for Bautista:

Spoiler
Don't actors stereotypically love to do death scenes, and compete fiercely for those parts? And since the film goes into flashback soon afterwards it's not like he has to sit out the rest of the movie or anything.
[close]
#275
I've edited the earlier posts to hide spoilers, since all this goes directly to the central mystery and identity of the killer.

Spoiler
This was an outing that happened roughly every year, and it had been planned long in advance. (It's basically this group's version of Mittens.) The island getaway had nothing to do with the death of Andi, and it would have been far more suspicious to cancel it before the news of her death came out, than to proceed as already arranged. No, the others would not have known, but he had involved a bunch of outsiders (some guy who studied with Ricky Jay to make the boxes, Gillian Flynn to write the mystery, etc.), and if there was ever an investigation, the fact that he changed his plans would easily have come to light.

If the news had broken as expected (and it's a bit unclear why it doesn't, since Helen only gets Benoit involved days after the death), Miles might have canceled, or he might have rebranded it as a sort of memorial or wake for her—I don't really agree that this group of people would have decided not to go. Remember that Andi's death was thought to be suicide, not murder.

The bit that is a little more difficult to swallow is that Miles would have invited Andi in the first place, given the extremely acrimonious court case and the fact that they all know he swindled her. I think we simply have to accept that his ego is just that enormous.
[close]

Quote from: KyriakosCH on Sat 07/01/2023 19:52:30
Spoiler
, why do that to Bautista? (who is actually great in his movies!)
[close]

Why do what?

Quote from: KyriakosCH on Sat 07/01/2023 19:52:30
Spoiler
Re Christie moments, when the scene first happened, I recalled that "my students"-related moment in a Poirot story (with the latin teacher or similar). But it was nothing - possibly not even meant as a red herring.
[close]

I have no idea what you're talking about. What scene? A little googling finds that there is a Latin teacher in Hallowe'en Party, but it's only a minor character, and a "my students"-related moment doesn't ring a bell either with Christie or this movie.
#276
The Rumpus Room / Re: *Guess the Movie Title*
Sun 08/01/2023 10:44:19
The Entity?
#277
In case my earlier post was missed, it would be great if the whitelisting could also cover use of the forum search feature. I can post, but not search, when behind VPN.
#278
(Got sniped by Khris, but posting anyway in case having it put a different way helps you grasp it more easily.)

Why do you think you need multiple separate buttons? If you're only displaying one image/button at any one time, you should just have one button, and change its graphic to the image you want to display whenever that changes. And that's pretty much what the original code by Khris does.

Analogies can sometimes be more confusing than helpful, but to me your question sounds like, having understood how to link a TV program to a particular TV channel, you now want to figure out how to link each TV channel to a separate TV, because you think that every time you want to watch a particular show you will need to disconnect the current TV, then look up which TV is tuned to the station you want, and plug that one in. And maybe that would be possible, but actually the right way is to just look up what channel the program you want to watch is on, and switch your one TV to that station.

I don't mean to imply that your question is stupid in any way. Just that I think you've got the mental model of what you need to do a bit wrong.
#279
Quote from: Crimson Wizard on Fri 06/01/2023 17:41:51Hmm. I have no idea why Snarky even mentioned "null" in this context, as the sprites in Overlays and other game objects are referenced not by a pointer, but by an integer (sprite ID).

Just that "null" literally means zero, and null pointers are typically implemented under the hood as a pointer with a value of zero. So while they apply to different types, there is a fundamental connection between null and 0. Setting references to nonexistent sprite IDs to 0 is therefore loosely analogous to setting a pointer to null (of course with the important difference that 0 is in fact a valid sprite ID for an existing sprite, unlike null pointers, which have no existing referent).

Quote from: eri0o on Fri 06/01/2023 18:33:04Also 0 was used in place of null in optional parameters - before some change in the compiler.

As of the current official release I'm fairly sure it still is, though that's not why I made the comment.
#280
As a sort of general programming tip (not just limited to AGS): when variables, fields or arguments are called "data," it often means that the values don't have any pre-defined meanings or uses, but that it's up to you to define and use it however you like.
SMF spam blocked by CleanTalk