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

#221
Excel is the wrong tool; just use any language that can read and output text.
However you should make sure your approach works first. Afaik you cannot have thousands of else ifs in a row. As for automating, I'd also automate the commands that are run if a match is found.

Scratch that; I'd separate the two things completely.
First, write code that finds which book, chapter and verse was typed. (I'd use a separate text file for each book, btw)

Once you have "Psalms", 1 and 5 stored in three variables, proceed from there. Anything else is madness, especially putting 31,000 else if lines directly in a script. That is the worst possible approach no matter how you slice it.
#222
When you changed the resolution, did you confirm the prompt to change the GUI sizes accordingly?

Anyway, it sounds like you need to increase the size of the label. IIRC the GUI is called gAction and only has a single label.
#223
This problem can be solved the same way that basically any other non-blocking sequence is solved: by using the repeatedly_execute / room_RepExec function to check whether the current non-blocking command has finished.

In your map room:

Code: ags
function room_RepExec() // this function has to be linked to the room event
{
  for (int i = 3; i <= 5; i++) {
    if (!character[i].Moving) {
      Point* p = PickRandomTarget(character[i]);
      character[i].Walk(p.x, p.y);
    }
  }
}

Now put this function further directly above in the same script:
Code: ags
Point* PickRandomTarget(Character* c) {
  // pick a random target
  int ri = Random(3) + 1; // 1-4
  Point* p = new Point;
  // determine coordinates
  switch(ri) {
  case 1: p.x = 123; p.y = 45; break; // 123,45 is first target
  case 2: p.x = 234; p.y = 56; break; // 234,56 is second target
  // case 3 and 4 here
  }
  return p;
}
#224
The only way a dialog disables a hotspot is by explicitly calling
Code: ags
  hotspot[1].Enabled = false;
inside its script.

Please do not believe weird things without good cause.

As for the actual reason, I'm going with the mouse.Mode for now. The function only gets called if you eModeInteract with the hotspot. Try adding an AnyClick handler that displays the cursor mode.

Something else you can do is add a small GUI with a label and set its text to "@OVERHOTSPOT@". The label will now show the hotspot's description if you mouse over it.
#225
You need something like this:

Code: ags
  else if (button == eMouseLeftInv) {
    InventoryItem* ii = inventory[game.inv_activated];
    if (ii == iTheItem && !hasRemarkedOnItem) {
      player.Say("something");
      hasRemarkedOnItem = true;
    }
    if (mouse.Mode == eModeInteract) player.ActiveInventory = ii;
    else ii.RunInteraction(mouse.Mode);
  }
#227
I'm still not sure how this is supposed to work exactly. Spending all this time entering thousands of words is something I'd only do if I'm absolutely sure it's part of a working solution.

Also, you say you're getting errors if you're parsing longer sentences. Can you give examples of what exactly is in your word list and relevant code?

As for the resolution thing, which version of AGS are you using, and what settings do you have in your configuration?
I tried to run a 640x400 game in a 1366x768 virtual machine and all of the fullscreen modes worked more or less. (Although this might be different on actual hardware).

As for adding commas to your word list, again, I'm not sure what exactly you're doing. Or why you're adding three words at a time. I can try to help you but I need more information.
#228
Please post questions like this in the Beginner's Technical Questions section. (Don't open a new topic, a mod will move this one there soon.)

As GooseKult says, you need to move the baseline down to the bottom of your walkbehind. This baseline determines the drawing order, so for your character to appear behind the walkbehind, the walkbehind base needs to be further down than the character's y position (their feet).

(Also, you posted two questions in 2022 but never got back to the threads. Giving some feedback when people helped you would be nice.)
#229
This sounds like you didn't extract the entire zip file first. If you just open it and double-click the exe, Windows will extract it to a temporary folder and run it from there, which means all the other files will be missing.

Right-click the zip, then pick "Extract all".

As for attaching images, I do this:
1) upload to https://imgur.com/
2) right-click the image and open it in a new tab
3) copy the URL (ending in .jpg, .gif, .png)
4) put this in your post
Code: ags
[img]URL_HERE[/img]
#230
First, the fullscreen thing. What is your game's resolution? What is your desktop resolution? "Cannot set video mode" probably happens if you try to run a 400x400 game on a widescreen monitor, so it really depends on the aspect ratio and the specific winsetup settings you used.

As for detecting bible verses, AGS supports:
a) comparing two string case-insensitive
b) parsing a string using the built-in parser
c) completely custom code

a) is self-explanatory, and the least lenient variant
b) requires adding tons of words to the parser but I don't think you can have words with spaces in them. You'll also basically doing a) because the player isn't typing commands but fixed sentences
c) probably the best approach, but requires careful thought

Let's take "Humble yourselves before the Lord, and he will lift you up.".
What's going to be valid input here? Can there be typos? Missing words?

This is a hard problem, and not one that is solved by using the AGS parser. You can try to implement an existing algorithm for string comparison. The idea is to walk through both input and verse and compare them character by character, then come up with a similarity score. The hard part is to not end up with a very low score if there's a missing letter in one string. This is one of these things that is very easy for a human but really convoluted and messy for a computer.
#231
I made this a while ago:
https://khris.ddns.net/agsparser/

Definitely make a backup of your game before using this though!

Still, I have to wonder why on earth you would need a parser that understands more than 30,000 words.

Just to be clear: you don't need the AGS Parser to check user input. You can just do something like:
Code: ags
  if (password == "1234abc")

So let's make sure this isn't an xy problem first.
Which game mechanic are you trying to implement?
#232
You can also pause most* AGS games at any point by playing them in windowed mode with the Windows desktop in the background. Simply click outside the game window and the text will stay visible indefinitely. Switch focus back to the game by clicking inside the window, and it'll continue.


(*Afaik it's possible to keep the game running without focus but this is off by default.)
#233
You don't have to run the installer:
https://www.adventuregamestudio.co.uk/releases/finals/AGS-3.6.1P5/AGS-3.6.1.27-P5.zip

You do need the proper .NET Framework installed but in case you don't, Windows should offer to download it as soon as you try to run the editor.
#234
@Snarky The bubble will burst in the NFT sense. Those are still around, but the public doesn't care.

Sure, text and image generation is here to stay*, but OpenAI isn't heading for a self-aware computer program.
Everybody will realize that the people hyping AI are simply stupid and something else will be all the rage, like 8K monitors or whatever.


*It's (illegal) plagiarism on a massive scale, and the quality is getting worse and worse because it's already taking in its own slop. Companies also will have to start charging for image generation and the like, so MAYBE it will actually go away in the sense that it simply stops being useful.
#235
Here's another great facet of image generating algorithms:

Where Facebook's AI Slop Comes From

I'm also really looking forward to this bubble of diarrhea finally bursting, which can't take much longer. The energy cost is astronomical, meaning these fucking "AI" companies are destroying the planet at a much more rapid pace than ever before and the worst thing about this BS is that there's not even a payday at the end of this. Not even for the psychopathic CEOs.
#236
The Rumpus Room / Re: What grinds my gears!
Sat 03/08/2024 10:10:40
I got a phishing mail from a GMail account. Reporting the GMail user and domains for abuse turns out to be difficult / impossible though.

The abuse form on the domain provider's website has a mandatory checkmark where I'm supposed to authorize them to share my contact details with the domain owner. WTF. No.
I sent them an email instead with the subject "Phishing hosted on multiple of your domains" and listed the domains.
About a minute later I received an automated reply that said
QuoteYour message was not recognized as message about abuse.
Please add more information to your abuse report: domain name(s), type of abuse.

Reporting the Gmail address also turns out to be impossible: after clicking through various "help" pages on Google's website they tell me I'm supposed to open the mail on the Gmail website, then click on "Report this email" or whatever. There's just a slight problem: I received the phishing mail on a non-gmail address. Turns out there's no way to report malicious GMail accounts.
#237
A semi-transparent overlay will affect anything below it, whether it's an object or the room background.

Which means you basically need to paint a lighter version of the background so that darkening it via a shadow overlay will essentially darken it back to the lower lightness you want.

It's also possible to only darken the object but this requires using DynamicSprites and CopyTransparencyMask().
The idea is to create a dynamic sprite from the object sprite, draw the shadow on top using a Y offset based on the object's Y coordinate, then make the background transparent again by calling CopyTransparencyMask(OBJECT_SPRITE_SLOT).
Finally, you set the resulting DynamicSprite's .Graphic as the object's.
This has to be done inside repeatedly_execute, obviously, since the object is moving.

Code: ags
#define PIANO_SLOT 123

DynamicSprite* pianoSprite;

function room_Load() {
  pianoSprite = DynamicSprite.CreateFromExistingSprite(PIANO_SLOT);
  oPiano.Graphic = pianoSprite.Graphic;
}

function room_RepExec() {
  DrawingSurface* ds = pianoSprite.GetDrawingSurface();
  ds.Clear(COLOR_TRANSPARENT);
  ds.DrawImage(0, 0, PIANO_SLOT);
  bool mask_needed;
  if (oPiano.Y > 120 && oPiano < 170) {
    ds.DrawImage(0, 160 - oPiano.Y, SHADOW_SLOT);
    mask_needed = true;
  }
  ds.Release();
  if (mask_needed) oPiano.CopyTransparencyMask(PIANO_SLOT);
}

As the object moves down, the overlay is drawn further and further up, which causes it to remain static relative to the room.
#238
Quote from: lapsking on Thu 01/08/2024 15:21:52by the way, in the beginning I said there are different workarounds for each of these blocking/non blocking problems, I suggested a straightforward solution for general use if possible

And I tried to address specifically that by pointing out that there is no easy solve (= straightforward solution for general use) here.
In general you always have to do 1. start [thing] 2. check in repeatedly_execute if [thing] has ended.
And this is not going to change unless AGS Script starts supporting something like Promises.

#239
Yeah, there's a lot of really old, hard-coded behavior in AGS.

Especially the blocking thing can be frustrating, but there's no easy solution for that. You need blocking commands or basic beginner scripts are impossible. However blocking also blocks stuff, which can get in the way of other things.

The fading can be solved with custom code and a black GUI, this way you can make it non-blocking. However this means other commands might now run too soon.

In short: this is unlikely to be "solved" in AGS 4, because there's nothing to solve here. You simply need to learn how to write code for an event-based engine.
#240
@lapsking I saw you asking about non-blocking code in the AGS 4 thread.

The solution is indeed to simply append "_always" to the repeatedly_execute function's name.
This is basically a bug in my module and I've updated the download accordingly.
SMF spam blocked by CleanTalk