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

#321
Just in case this matters: Windows Defender isn't too fond of AGS unfortunately.
You should
a) upgrade to AGS 3.6.1 if you haven't already
b) add your main AGS folder to the list of exclusions
#322
When you run a published game for the first time, AGS uses the acsetup.cfg in the game folder afaik.
So yes, you should be able to set a window size.

But like eri0o is hinting at, you should leave that up to the user.

Can you tell us what resolution your game has and what your end goal is here?
#323
The modified acsetup.cfg is in C:\Users\[username]\Saved Games\[gamename]\
#324
There's the "Create voice acting script" option from File menu. Or you can create a translation source.
How to answer this is unclear because you haven't told us what your actual goal is.

https://xyproblem.info/
#325
In the editor, press F7 to make sure the game is built, then choose "Run Game Setup" from the "Build" menu.
Check "Start in windowed mode", then pick an appropriate scale factor for "Windowed scale".
Now click "Save and Run".
#326
Is this for actual top-down graphics? Or was that just an illustration?

I'm asking because the method and feasibility greatly depend on the type of graphics.
#327
I was surprised this doesn't work as expected but apparently AGS only duplicates the position.
You can do this manually by adding lines like this in repeatedly_execute_always:

Code: ags
  cShirt.Loop = player.Loop;
  cShirt.Frame = player.Frame;

This obviously requires the following character to have a shirt version duplicate of the walk-cycle frames, but that's pretty much a given anyway I guess.
#328
Here's another way:

Code: ags
DynamicSprite* invBG;

function ShowInvGUI(InventoryItem* ii) {
  GUI* gui = gInvItem; // GUI name here
  invBG = DynamicSprite.Create(gui.Width, gui.Height, true);
  DrawingSurface* ds = invBG.GetDrawingSurface();
  ds.Clear(COLOR_TRANSPARENT);
  ds.DrawImage((invBG.Width - Game.SpriteWidth[ii.Graphic]) / 2, (invBG.Height - Game.SpriteHeight[ii.Graphic]) / 2, ii.Graphic);
  ds.Release();
  gui.BackgroundGraphic = invBG.Graphic;
  gui.Visible = true;
}

You can now call this function in on_event, passing the item.

Untested!
#329
On the topic of rechargeable batteries, I recently discovered that these exist:
https://www.amazon.com/Rechargeable-Batteries-Charging-Over-Charge-Protection/dp/B098QTZND6/
1.5V lithium ion batteries in the shape of a regular AAA or AA battery, perfect for gamepads and of course Gameboys :)

I also found my silver Gameboy Pocket and it's still working fine but the screen is so dim! Being used to bright phone screens it's kind of incredible how unreadable the screen is without a bright lamp close by.
#330
Afaik there's no "Learn how to program - with AGScript" resource out there. Understanding the basics about how variables and arrays work, how to use custom functions, etc. can be learned with any programming language though.

A reasonably similar one is JS, so maybe take a look at this:
https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/JavaScript_basics
#331
@Giacomo
Hi Giacomo,

I have updated the module accordingly. You can use a line like
Code: ags
  Dialogs.SetScrollArrowSlots(2172, 2173, 2170, 2171); // up, down, up highlighted, down highlighted
to set four sprites.
#332
You can write your own global click handler (edit on_mouse_click) and you own unhandled code, then base it on for instance GetLocationType() and mouse.Mode, if you want.
#333
Quote from: Zrezal on Sat 25/05/2024 16:56:10Doing it with Struct is impossible for me because it fails everywhere.

Show us your code, and we can fix it. This file-based approach is total nonsense, sorry.
#334
Talking to an object without a handler apparently calls unhandled_event(2, 2);

https://adventuregamestudio.github.io/ags-manual/Globalfunctions_Event.html#unhandled_event

Must be a quirk.
#335
A listbox is a global object, so it has to be filled with the room's objects each time a room is entered.
This means you need a data structure to store the objects. I'd use the engine's inventory items for that, they already have names and IDs.

Next you need a struct array like the one I posted.
rd[2].objectCount[3] = 1 means that room #2 contains one (1) of inventory item #3.

Now you need to fill the listbox:

Code: ags
int invID[20]; // store inv item IDs for listbox items

void UpdateObjectList(int room) {
  lbObjects.Clear(); // empty list box
  for (int i = 1; i <= Game.InventoryItemCount; i++) {
    if (rd[room].objectCount[i] > 0) {
      invID[lbObjects.ItemCount] = i;
      lbObjects.AddItem(inventory[i].Name);
    }
  }
}

function on_event(EventType event, int data) {
  if (event == eEventEnterRoomBeforeFadein) UpdateObjectList(data);
}

When the player selects a listbox item, you can use invID[lbObjects.SelectedIndex] to get the inv item ID.
When the player drops an item, call rd[player.Room].objectCount[invItem.ID]++; then UpdateObjectList();.

Also:
Spoiler
If your programming knowledge is very limited, why do you want to create an engine for text adventures...?
[close]
#336
Welcome :)

You didn't link the function to the event. Open the room and click the thunderbolt icon, then paste "room_AfterFadeIn" without quotes next to the corresponding event.
It's usually done the other way around, as explained here with hotspots: https://adventuregamestudio.github.io/ags-manual/acintro3.html
#337
Quote from: FortressCaulfield on Wed 22/05/2024 14:23:38So if I put import in global header I don't have to do it in each room script? That's what I have been doing.
Yes, because the global headers are put on top of the room scripts at compile time.
#338
This is probably a translation issue but what exactly do you mean by "lists"? Arrays?

One way is to use a struct:

Code: ags
// header
struct RoomData {
  int objectCount[100];
};

// main script
RoomData rd[50]; // 50 rooms

Dropping an object in a room:

Code: ags
  rd[player.Room].objectCount[object_number]++;
#339
I've made some small improvements, added a text window GUI and put a playable version online:

https://khris.ddns.net/myst/

Direct download:

https://khris.ddns.net/myst/Myst.agt
#340
Quote from: Snarky on Sat 18/05/2024 19:58:41
Quote from: zeta_san on Sat 18/05/2024 19:27:24it works but Crimson's works everywhere with all characters while Chris's only works when the character (player) speaks.

That is surprising. It should not be the case.

This sounded like an engine bug at first, so I tested my code. Turns out .Speaking is only true if the character has a SpeechView assigned. I guess I can see the reasoning behind that but it should also be true while they're the subject of a .Say() call imo.

Also, to clarify: zeta_san is not talking about the mouse cursor but the action text, which by default appears above the cursor even while the interface is disabled. Which in turn could be considered a bug in the template I guess, since the action text shouldn't be displayed while the player cannot actually perform an action.
SMF spam blocked by CleanTalk