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 - Crimson Wizard

#3401
I think the simpliest fix would be to go to the path displayed in this message and delete "user.config" file.
#3402
Quote from: Peegee on Sat 20/11/2021 15:56:38
Yes I put this:    if (Region.GetAtRoomXY(player.228, player.173) == region[7])
But the program doesn't take it.

You seem to misunderstand, the proper way was to do literally
Code: ags
if (Region.GetAtRoomXY(player.x, player.y) == region[7])


The point is that you ask engine to check which coordinates player character is at. You don't have to know these coordinates yourself.
#3404
You also need to test whether globalBGM is null, because it will start as null:

Code: ags

if ((globalBGM == null) || !globalBGM.IsPlaying)

this is saying: do if globalBGM was not assigned OR was assigned but not playing anymore.
#3405
Quote from: kconan on Thu 18/11/2021 03:51:24
Quote from: Mandle on Wed 17/11/2021 15:59:04how the vaccine is a poison designed for population control.

Bill Burr has a great rebuttal for that idiotic conspiracy theory.  "Why would you kill off the obedient ones?"


I have an idea. It's all the other way around. This vaccine is not against covid, it's against another deadlier virus that is not here yet. What would be the most efficient way to separate obedient and rebellious people? The world government would fake the covid and spread vaccine, so only obedient people who easily believe in their lies would vaccinate and rebellious won't. Then they would release a real virus for which there's no other defense, and all who did not comply will die.
#3406
Quote from: newwaveburritos on Wed 17/11/2021 06:08:28
I'm not exactly sure what I can do with it.  Ideally I would be able to call best_friend like I call player as in

Code: ags

player.ChangeRoom(26);


Just like "player", "best_friend" is a pointer to Character, so you may use it like you use "player" or any explicit character's script name.

"character" in script is a global array of characters, each element of which may also be used same way, e.g. you may do "character[10].ChangeRoom" to move character #10 into another room.
#3407
The method to find the max/min of object's values is:
1) have 2 temp variables to store the max/min value found and another to store the object's index (or object's pointer, if this is more convenient);
2) iterate over all objects in a loop, checking their values;
3) on each check, if the object's value is greater/less than the one stored in the temp var, then save this value in a temp var; and also save the object's index or pointer;
4) after finishing iterating you will have max/min value and the corresponding object stored.

Example (assumes that you have Friendship Points in the character's custom property):
Code: ags

int max_fp = -1;
Character *best_friend;

for (int i = 0; i < Game.CharacterCount; i++) {
    if (character[i] == player) continue; // skip player character
    int fp = character[i].GetProperty("Friendship");
    if (fp > max_fp) {
        max_fp = fp;
        best_friend = character[i];
    }
}

// at this point you should have best_friend selected
#3408
@shaun9991, it seems simple, just replace
Code: ags

TypedText = Overlay.CreateTextual(10, 140, 300, eFontMunro2, 65535, displayedLine);

with
Code: ags

myLabel.Text = displayedLine;


Of course you'd also have to make gui visible before typewriter effect starts, and replace "TypedText.Remove();" with "gMyGui.Visible = false;" or similar.
#3409
Quote from: Rik_Vargard on Sat 13/11/2021 14:59:58
But then I went to the general settings and tested the speech options and the Lucasarts speech fixed the whole problem just like that!
Now the speech shows up nicely on top of the player.

Oh, I am guessing you had "Sierra with transparent background" on? In "Sierra" case you are supposed to provide character portraits to be displayed at the side of the text, this is also why the text is limited to the center of the screen.
#3410
Somehow it occured that there are still no constants for these special keys, so you got to use literal numbers as in Gilbert's example.

You may find them in this table (at the very bottom):
https://adventuregamestudio.github.io/ags-manual/ASCIIcodes.html
#3411
QuoteI have a huge array that I want to fill with values each time the game starts and I thought that I might just be able to read them pixel by pixel from the room background

If it's not a real room background, but the way for you to have data, you may also read image from a file or a sprite, using DynamicSprite.CreateFromFile/CreateFromExistingSprite. Then get pixels using its drawing surface, as in above example, and delete the image:

Code: ags

DynamicSprite *spr = DynamicSprite.CreateFromFile("myfile,bmp");
// or
DynamicSprite *spr = DynamicSprite.CreateFromExistingSprite(100);

DrawingSurface* ds = spr.GetDrawingSurcace();
int color = ds.GetPixel(x, y);
ds.Release();

spr.Delete();
#3412
Updated to Alpha 12
(use download links in the first post)

IMPORTANT: I remade one recently added property in General Settings, and unfortunately this conflicts with the previous build (Alpha 11). If you already used that build, here's what you need to do to make your project open in the current version again:
- Open Game.agf in a notepad;
- Search for the line starting as "<UseRealFontHeight>" and delete it. Save the file.

I apologize for this inconvenience.


TTF fonts setup

In this version I implemented a way to configure how TTF fonts are loaded and displayed in AGS. The problem was that AGS historically did some fixups to TTF looks for backward compatibility, but that made some fonts act worse and not position correctly when drawn in game. There are two new properties in the project that let to specify either new and old behavior.

1) "TTF font adjustment" - this property exists in Fonts and may be set individually for each of them; also similar property is in General Settings and sets default value for each new font you add to your game. This property lets you choose between "no changes" and backward compatible TTF fixup called "Resize ascender to the nominal font height".

To clarify a little, what this "fixup" means: the font has ascender and descender parts separated by a baseline. Ascender is parts of letters above baseline, descender is parts below baseline.
In the past AGS forcefully resized ascender to match the font's size. This could lead to ascender becoming larger or smaller. Because AGS draws texts starting with top-left corner, such change would result in text appearing shifted up or down relative to what you'd normally expect.
Now you may disable this behavior. The ability to keep it for the chosen fonts is left because there's a number of TTF fonts around created specially for AGS, possibly taking this weird behavior into account. For these fonts it may be desired to retain this "fixup".

2) "TTF fonts height used in the game logic" - this property exists in "General Settings" and has a global effect on all fonts. It lets you select what value is used as a height of line of text in game: TTF's nominal size (in "points") or real size in pixels. "Nominal size" is a backward compatible choice.

Why there's a difference: TTF are vector fonts, which do not always scale 1:1 to pixels because they must keep letter proportions. So, when you tell AGS to import a font at size 10, the actual pixel size may end up equal to 10, bit less or larger. Historically AGS ignored that fact and always reported text height using the "nominal" size, but that was a "lie".
The best way to check this out is to put some common TTF font on a GUI, and set GUI's height exactly to the font's size. In many fonts you will notice that some letters (usually "q,j,g,y" and similar) will not fit in, sometimes by a noteable amount.

So, now there's a setting that lets you enable using real height. This means that if you do GetTextHeight or GetFontHeight and so on -- it will report correct pixel heights of a text. Also, default font's linespacing is set equal either to the nominal or real height depending on this setting. But linespacing may also always be customized using corresponding Font's property, in the editor ("LineSpacing").


Other changes:

Editor:
- Fonts now have a readonly Family Name field, that lets user see the original name of a font they've imported (if available).

Engine:
- Fixed potential crashes if a room-related API function has been called in "game_start"; this is achieved by having a dummy room placeholder object. Still results of such calls are undefined and should not be relied upon.
- Fixed some TTF fonts could be cut at the bottom when the speech is displayed.

Compatibility
- When running pre-3.4.1 games, anti-aliased TTF fonts display is now corrected (their vertical position was broken).
#3413
The only other thing that comes to mind is that some protection software prevents ags from launching, like antivirus or windows defender. If you're using one, perhaps try to add AGS into exceptions.
#3414
Please clarify what is the build version exactly are you trying to install ("most recent" could be 3.5.1, or 3.6.0).

AGS.Native.dll requires VC Redistributable 2015.
#3415
Quote from: greg on Sat 06/11/2021 23:31:45
I'd guess the change in behavior here is that 3.5.1 returns -1 for GetGlobalInt(foo) if foo hasn't been set, whereas 3.6 doesn't?  So in 3.5.1, even though I hadn't set the variable, it failed the condition at line 999 and never tried calling GetWalkableAreaAtRoom().

I never paid attention to this, but just tested in several versions including 3.5.1, and it always returns "0" if called before SetGlobalInt.

Although looking at the engine code, it seems like this global ints array is not properly initialized in program memory at the game start, which in theory means that these values could be anything and must not be relied upon. So, I'm not really sure how they may have any consistent values as shown by tests.
#3416
Quote from: greg on Sat 06/11/2021 16:55:26
Sure, I've appended the crash message below, and I've uploaded the CrashInfo file here: https://drive.google.com/file/d/1WNVKOHaYn9HYax55KrQxvRI79nyY3A82/view?usp=sharing

The functions that called GetGlobalInt(foo) before SetGlobalInt(foo, bar) were called in game_start().

From thois crash dump it seems that the last called function was GetWalkableAreaAtRoom. But maybe there was something wrong with either engine or the dump.

Could you post the code around "Interface.asc", line 1001 ?

EDIT: I can confirm that calling GetWalkableAreaAtRoom in game_start will crash the engine. No room is loaded at the time when game_start was called, but it seems this time engine was not able to handle that properly and display a regular error.
#3417
Watching "Joker" I think i might have chuckled at the scene where Gary was not able to open the locked door (right after the murder in the Joker's appartement), but it was not a "funny" kind of chuckle, but rather an aknowledgement of a dark irony and awkwardness of the situation. Maybe couple of times more somewhere, but I cannot remember now.
EDIT: oh, remember now, it was when the Joker's famous dance was interrupted by the detectives and he started running away, instantly turning from an energetic and confident character into the silly and scared one.

I found that i am not a "physically" laughing person, I rarely actually laugh when watching the movies, regardless of whether I'm in a company or alone, but I tend to "laugh" inside or smile. In movie theatres I'm always sitting silent, maybe smile a little when other people are laughing.
That said, I haven't been awfully alot in the movie theaters in my life, but from what experience I have, the audience here is mostly silent, except for some climactic episodes. Watching with a small company at home is of course a different thing.

In regards to dark or horror genres, I definitely tend to find funny moments in unexpected situations. I recall laughing alot on Steven King's short stories, as I found most of them whimsically funny rather than scary. But tbh I never liked slasher movies, and rarely found them funny, but rather stupid and obnoxious.
#3418
Note that you may use existing constants instead of bare numbers, they correspond to the walking loop values:
Code: ags

enum CharacterDirection {
  eDirectionDown,
  eDirectionLeft,
  eDirectionRight,
  eDirectionUp,
  eDirectionDownRight,
  eDirectionUpRight,
  eDirectionDownLeft,
  eDirectionUpLeft,
  eDirectionNone
};


So, like
Code: ags

if ((cJIm.Loop==eDirectionLeft) && (cEgo.x<=cJIm.x))

and so on.
It's more text, but may be easier to understand what it means.
#3419
@greg
Quote from: greg on Fri 05/11/2021 12:40:59
2. Calling GetGlobalInt before SetGlobalInt results in a crash.  As my game was loading, I was calling GetGlobalInt(foo) before I’d called SetGlobalInt(foo, bar).  In 3.5.1, there was no error or crash.  In 3.6, there was a crash.  I addressed this by updating my script to set the variable before getting it.  I wanted to report it, though, as it’s a different behavior from 3.5.1.

I tried this, and I cannot reproduce a crash, nor see how exactly it may happen.

Could you give more information, like post the exact script, tell what function do you call the GetGlobalInt from, what kind of crash (were there error messages)?
#3420
Quote from: greg on Fri 05/11/2021 12:40:59
1. Text within buttons is placed differently in the editor than in the game.  Here’s some text with alignment eAlignMiddleCenter.  (The font is LinLibertine_aBS.ttf, imported at 20 pt.)

I am currently experimenting with changing something in how TTF fonts work, and latest build unfortunately may contain mistakes. I realized this too late, when it was already posted. In any case it's better to not rely on the font looks right away and wait until the next update, which hopefully will be ready soon enough.

Quote
the font had a VerticalOffset of -2, which appeared as -2 in the editor and -4 in the game

This sounds weird though. But I will look at this as soon as I fix other obvious mistakes.

Quote from: greg on Fri 05/11/2021 12:40:59
2. Calling GetGlobalInt before SetGlobalInt results in a crash.  As my game was loading, I was calling GetGlobalInt(foo) before I’d called SetGlobalInt(foo, bar).  In 3.5.1, there was no error or crash.  In 3.6, there was a crash.  I addressed this by updating my script to set the variable before getting it.  I wanted to report it, though, as it’s a different behavior from 3.5.1.

I will look into this, but just wanted to mention that these functions were deprecated many years ago, today it's recommended to use normal variables in script.
SMF spam blocked by CleanTalk