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

#3421
Wanted to bump this, to note that there's a multi-VOX solution coming into AGS 3.6.0 soon (at the time of writing this), where editor supports building several speech voxes using subfolders inside a Speech folder, and engine can switch between multiple speech voxes freely using new script command.
#3422
I dont think that's the problem with popups themselves, but rather with designing a system that uses these popups (and *that* may not be easy, perhaps even regardless of the engine).

My advice would be to first chart your gui system on paper, defining how does it work in principle. Then it will be easier both to explain what do you need, and to find out how to make it in AGS (or anywhere else).
#3423
Something I have not tested myself:

1) Do GetTranslation() only on the final string result, after all the appends.
2) in TRS have the full line as long as it takes, because TRS/TRA files don't have these limits afaik.

I suppose this could work, because engine cares only which line is sent to GetTranslation, and which line is in TRA.

But even if this works, idk how more or less convenient this may be though.
#3424
Quote from: Stranga on Tue 23/11/2021 22:18:56When I export my translation files it seems to skip property strings (i.e item/hotspot/character ect. properties), is this a new thing? I can't exactly remember If it did before.

Does this work in the previous versions (3.5.1 and earlier)?
In any case, I think they should, as someone may want to translate them using GetTranslation function.

EDIT: yes, this is very strange, but string custom properties were never added to translation. I checked ancient AGS 3.2.1 with the same result.
I believe this should be fixed. Temporarily the 2 workarounds I see is to either add these strings in script in a random place, or place them in TRS by hand.
#3425
Do people read "tips of the day"? I did not even remember that AGS has this thing... how useful it is?

imho it might be best to have proper articles in the manual.
#3426
Quote from: manu_controvento on Mon 22/11/2021 14:55:54
and it is not easable using the GetTranslation every time, because of the huge amount of text

Could you elaborate on this, why GetTranslation is difficult to use?
#3427
Quote from: Mølck on Mon 22/11/2021 11:45:24It still requires some extra maintenance with those int parameters though. Maybe I'll add some global variables to hold these int values.

AGS has few of methods of defining global constants:

1) #define - creates a macro
Code: ags

#define MY_VAR 100

advantage: can be anything, even a line of code
disadvantage: type is guessed from the value, if used incorrectly error messages may be confusing.

2) enum - creates a list of values
Code: ags

enum CallRoomID
{
    eCallRoom_DoThis,
    eCallRoom_DoThat,
    eCallRoom_AnotherThing
};

advantage: groups constants together, can be used as a variable/argument type in your custom functions.
disadvantage: only integer.

3) Regular global variabes, that are initialized once and never changed.
advantage: can be any type;
disadvantage: there's no prevention from changing it.
#3428
I think the simpliest fix would be to go to the path displayed in this message and delete "user.config" file.
#3429
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.
#3431
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.
#3432
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.
#3433
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.
#3434
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
#3435
@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.
#3436
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.
#3437
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
#3438
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();
#3439
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).
#3440
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.
SMF spam blocked by CleanTalk