Show Posts

You can view here all posts made by this member. Note that you can only see posts made in areas to which you currently have access.

Messages - Khris

Pages: [1] 2 3 ... 532
Please post the relevant code in full, and tell us exactly what you're doing and what the result is.

I'm still unable to understand why the if expression is skipped at run time
That's because it isn't. AGS doesn't randomly skip statements or blocks. There's an error in your code, and we should be able to point it out if we see the whole thing.

Hints & Tips / Re: Return of the Obra Dinn
« on: 07 Dec 2018, 13:03 »
1) I was stumped by this at first too,
Add spoiler tag for Hidden:
but you can in fact clearly see who the "killer" is. Look at the scene again. The guns, the victim's body.

Add spoiler tag for Hidden:
You can see the paths of the bullets from the guns, only one actually hits the guy

2) Not that I know.
Add spoiler tag for Hidden:
Later in the game it is mentioned that some memories are only reachable from other memories, which as far as I understand means you have to enter memory X first to enter memory Y

Add spoiler tag for Hidden:
one chapter takes place on open water, for instance

Beginners' Technical Questions / Re: Issue With Death GUI
« on: 26 Nov 2018, 18:03 »
You can simply keep the Death GUI open in the background; any of the three options will "close" it anyway (restore/restore will load a savegame which doesn't have the GUI open, and quitting the game will close the entire game).

You have

15 is white. Use 0 instead, or COLOR_TRANSPARENT.

Given that you want to use it for Dialogs, did you create it as TextWindow GUI? If so, have you assigned any images to the 4 corners / 4 edges / background?

Advanced Technical Forum / Re: Issue Testing Game
« on: 22 Nov 2018, 09:25 »
Try pressing F7 instead, then run the game from the Compiled/Windows folder. I assume that works fine?
Next, try disabling your Antivirus, then try F5 again.

(It seems that something external to AGS is preventing the exe from running by killing it, and the error you get is the AGS editor's reaction to that.)


I gave this a shot and noticed a few things:

Add spoiler tag for Hidden:
- The room isn't darkened for me in any way at the start of the game. When I turn on the light, the lamp changes slightly, but the rest of the room is the same. Probably just a small bug? I get an idea of the darkened room during a bolt of lightning, and on my 2nd attempt the turned on lamp looked differently. All in all this seems like a graphics glitch. Playing on Win 7, GTX 970, windowed. (edit: tried it in fullscreen and this time no issues)
Edit 2: that was fast; windowed works correctly now

- The cursor changes over active areas, but not when I have an active inventory item. Not a huge deal, but I'd prefer some visual indication of what I'm looking at, like the name of the hotspot appearing somewhere

- After I picked up the ice skates, I couldn't pick up anything else heavy but I also didn't find any way of dropping the ice skates or returning them to the closet. I got the feeling of being stuck without any indication of how to get out of this, and had to fight the urge to quit the game and never touch it again... :-[

Other than that I really like it so far, the graphics and animation style perfectly fits the "slightly creepy children's book" vibe.

Module Thread:


Before changing to the room, manually FadeOut(), then set the next screen transition to instant, then load the room.
In the room, use setTimeout to wait a bit, then FadeIn().

Looking at your reply, that's quite hard to believe, to be frank.
Properly linking the event via the room editor will append a function called room_Load at the end of your room script, and as long as the Overlay is declared in global scope and created in there, it should work.

So something like:
Code: Adventure Game Studio
  1. Overlay *someFloatingText;
  3. function room_Load() {
  4.   someFloatingText = Overlay.CreateTextual(...);
  5. }

Even if it did work for you but you merely wrote this post from memory, keep in mind that other newbies might find this thread and end up severly mislead.

It's possible, and you'd do it in the "player enters room before fadein" event. It's an event that is triggered each time the room is visited.

Please always state what you've tried (including the code you've used and where you placed it) and how it failed.

Definitely. How big are your inventory item sprites? Item width / item height is the grid size of the inventory window, in pixels. You likely have sprites that are much bigger than 30x20 pixels, I guess?

1) In General Settings -> Inventory -> "Override built-in inventory handling" (should be True in your case);

Should it though? Because afaik the default mechanism will pick up the item when the player interacts with it. The more pertinent question here is how the game differs from the Default Game so that interacting with inventory items doesn't work. It could be the infamous item size issue:
The first thing I would do is check the inventory window's ItemWidth and ItemHeight. If you haven't added a second inventory item yet, you probably haven't noticed that the item size is set way too small. Which means the items will overlap, and only react to clicks in their top left corner.

And one doesn't need function iRatSkull_Interact() either; it should just work. (Besides, adding a function like that for each item individually is not only really tedious, it also almost always means you're going the wrong way about implementing some mechanism. AGS is easily powerful enough to let you implement UI behavior globally. The proper way to do this, if you decided to implement custom inv handling, is to use player.ActiveInventory = inventory[game.inv_activated]; in the eMouseLeftInv block.)

Initial post: Just disable all other modes in the editor, then call mouse.EnableMode(eModeUseinv); when the user gains the item.

I've just realized that this is about multiple items; how many are there going to be? You can use additional cursor modes and "any click" events, but I'm not sure about the UX.

Yes, you need something like this:

Code: Adventure Game Studio
  1. DynamicSprite *buttonSprite[5];
  3. function SaveGame()
  4. {
  5.   for (int i = 0; i < 5; i++)
  6.   {
  7.     buttonSprite[i] = DynamicSprite.CreateFromSaveGame(i + 1, 214, 120); // Reads the screenshot of the current savegame slot loop (1-5)
  8.     if (buttonSprite[i] == null) buttonSprite[i] = DynamicSprite.CreateFromExistingSprite(507); // If savegame doesn't exists, the image is a default empty box
  9.     GUIControl *gc = gSavegames.Controls[i]; // assuming the buttons are controls 0 to 4
  10.     Button *b = gc.AsButton;
  11.     b.NormalGraphic = buttonSprite[i].Graphic;
  12.   }
  13. }

Beginners' Technical Questions / Re: No background music
« on: 13 Nov 2018, 13:33 »
Writing in the code directly didn't seem to work for some reason.
Yeah, with some exceptions like "on_mouse_click" in room scripts, all functions have to be linked to events or AGS won't ever call them.

Beginners' Technical Questions / Re: No background music
« on: 12 Nov 2018, 16:20 »
In other words, you have

Code: Adventure Game Studio
  1. function Room_AfterFadeIn ()
  2. {
  3.   aMusic1.Play(1);
  4.   Display("Music should be playing now");
  5. }

and the Display text shows up but no music?

Beginners' Technical Questions / Re: basic if statement
« on: 09 Nov 2018, 12:08 »
Here's the shortest version:

Code: Adventure Game Studio
  1. function oCar_Look()
  2. {
  3.   if (caropen) player.Say("It's unlocked!");
  4.   else player.Say("That's my car, it's locked");
  5. }

The Rumpus Room / Re: What grinds my gears!
« on: 09 Nov 2018, 12:06 »
What annoys me way more than it should is how people when asking for computer/programming help keep saying "every time I do X, Y happens", when they simply mean "when I do X, Y happens". The first version sounds like they are surprised that the outcome doesn't change. I'm sure it's just a colloquialism but it sounds absolutely moronic to my ears.

If that solution is enough, you can position the 2nd labels behind the 1st using GetTextWidth().

Advanced Technical Forum / [Tool] WFN creator (outlines!)
« on: 06 Nov 2018, 12:52 »
Not sure where to put this, so I'll put it here.

Have you created a game with a relatively high resolution and are unsatisfied with the puny black outline AGS draws around your letters?
Look no further. Just go to and create your own set of bitmap font + outline font, based on a TTF or OTF.

It's quite straightforward. Just select a font file and check the preview. Then adjust the values, best from top to bottom. The size is in pixels, but that's "font pixels", not necessarily pixel pixels. Check the x1 zoom preview to see the font at its actual size. Alpha threshold needs to be lowered if the thin lines in your letters are broken up, just experiment with the setting until it looks good. The final three settings apply to the outline.

I recommend using the short preview while playing with the settings. Then switch to the full letter sets to check for issues.
When you're satisfied, just click the download button beneath either font to grab them.

To use a font in AGS, open your game, then add a font in the Project tree (right-click the Font node). After AGS has created the font file, overwrite it with the downloaded one (renaming it in the process, obviously). If AGS created a ttf, just use its number but keep the *.wfn ending, then delete the .ttf with the same number.
To set up the outline font, import both fonts as just described, then set the base font's OutlineType to "UseOutlineFont" and enter the other font's number.
You'll probably also want to make sure "Fonts designed for high resolution" in General Settings / Text output is active.

DISCLAIMER: the usual WFN limitations apply: no anti-aliasing, no special characters unless you add them to the font and use substitutes in your strings. If in doubt, don't use this. It's a beta version anyway; if you encounter any errors or issues, please contact me and state what you did, which browser you're using and whether are any errors in the browser's console (press F12 to view it).

In-game preview:
Add spoiler tag for Hidden:

Comic Sans with heavy outline

PS: there's no pixel-perfect editing. While you can do that with Radiant's FontEdit, you'd have to replicate the edit for the outline font. Thus I might add the possibility to generate the outline based on an existing WFN font at some time in the future.

Pages: [1] 2 3 ... 532