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

#1001
This happened before, was reported couple of times.

I was going to check this out, but did not find much at the time, maybe I might try again. I still have someones video which demonstrates the problem.

My suspicion was that AGS uses an old decoding library that cannot handle certain video properties, and thus gives video frames at the wrong rate, but idk if that's exactly so.
It's just that some videos play properly and others not.
#1002
Quote from: DiegoHolt on Fri 04/10/2024 18:32:11Smooth Scrolling & Parallax.asc(556): Error (line 556): '.ViewportWidth' is not a public member of 'System'. Are you sure you spelt it correctly (remember, capital letters are important)?

This is a similar problem.
https://adventuregamestudio.github.io/ags-manual/ObsoleteScriptAPI.html

System.ViewportHeight  --->   Screen.Height
System.ViewportWidth  --->   Screen.Width

Quote from: DiegoHolt on Fri 04/10/2024 18:32:11I haven't tried the script compatibility because I don't know where to do that.

It's in General Settings:
https://adventuregamestudio.github.io/ags-manual/GeneralSettings.html#backwards-compatibility
#1003
Quote from: DiegoHolt on Fri 04/10/2024 18:20:11Smooth Scrolling & Parallax.asc(305): Error (line 305): undefined symbol 'GetViewportX'

This are the code lines, and I'm guessing the next one will give an error as well:

int viewx = GetViewportX();

int viewy = GetViewportY();

Either:
1. Set "Script compatibility level" to 3.4.* (in General Settings)
2. Replace by Game.Camera.X, Game.Camera.Y respectively.

Where to find replacements for deprecated functions:
https://adventuregamestudio.github.io/ags-manual/ObsoleteScriptAPI.html
#1004
I created a separate PR for a feature that lets skip particular parts of game data when saving/loading:
https://github.com/adventuregamestudio/ags/pull/2543

This feature is complementary to the feature of loading saves with mismatching data, but also may have its own uses.

The idea is that there are "secondary" parts of game, that do not belong to the game story progress and/or can be reconfigured in script after save was loaded. These parts may be turned off from saves, and thus will let to load "old" saves more easily.

Another use for this feature is to reduce the size of the save in case it uses a lot of dynamic sprites.

Script-wise, this is achieved by setting a game option called OPT_SAVECOMPONENTSIGNORE with values taken from this enum:

Code: ags
enum SaveComponentSelection
{
    eSaveCmp_None           = 0,
    eSaveCmp_Audio          = 0x00000002,
    eSaveCmp_Dialogs        = 0x00000008,
    eSaveCmp_GUI            = 0x00000010,
    eSaveCmp_Cursors        = 0x00000040,
    eSaveCmp_Views          = 0x00000080,
    eSaveCmp_DynamicSprites = 0x00000100,
    eSaveCmp_Plugins        = 0x00002000
};

Example of use:

Code: ags
SetGameOption(OPT_SAVECOMPONENTSIGNORE, eSaveCmp_DynamicSprites | eSaveCmp_Views | eSaveCmp_Audio);
^ above will remove dynamic sprites (bitmaps), View frames and audio playback from the game saves.
Please note again that this affects both
   a) saves made after this option is set and
   b) any saves loaded back (even if they were made before this option was added).
#1005
Quote from: DiegoHolt on Thu 03/10/2024 18:15:58And sorry for not posting any code! I guess I assumed everyone would know that I'm a rookie and my scripting is absolutely basic.

In the video I've posted, I'm using the player walking with transparency = 100

Right, it's always essential to clarify how the behavior was achieved, because it cannot be obvious from the video: as visibly similar result may be achieved in a large number of ways.
For instance, I had no idea that you have a invisible player there, but I knew that it's potentially possible to make camera follow invisible character using a script, that's why I added a note about "late_repeatedly_execute.." (but since you are using builtin camera movement, that is not applicable, unless you script a custom one).
#1006
Quote from: Danvzare on Thu 03/10/2024 11:31:50As you can clearly see, setting it to false not only gives a much smoother scrolling effect

That is because camera is made to follow the character's position exactly in AGS by default, but that's not the perfect solution.
I suppose that If camera were scripted to move with the average character speed instead, then it would not depend on MovementLinkedToAnimation at all; as it should be.

EDIT: unfortunately, it may not be trivial to do in script in case of randomly walking character, as character "velocity" (or movement direction) is not exposed to script at the moment. The script would have to keep track on character positions and do projection.
#1007
It's unfortunate that no code is posted, and I dislike guessing.

But since this was not mentioned in the replies above: if you are scrolling camera yourself in script, and target some character's or object's position, then make certain that it's done in "late_repeatedly_execute_always", this way it will be done *after* character moves.
#1008
Quote from: rattusrattus on Tue 01/10/2024 16:46:103. Is it possible to make fonts bigger or smaller when you've already set font size?

Yes, simply reimport using a different size ("Import over this font" button).

Quote from: Eon_Star on Tue 01/10/2024 17:09:24at first you could check "font properties window" and look for the "multipler" option. You can change the size from there.

Don't do that if you are using TTF. Multiplier is meant for bitmap fonts (WFN). For TTFs you better reimport a font with wanted size. The reason is that TTFs actually look differently depending on their point size: they usually are more detailed at higher size and less detailed at lower size. This difference is neglected when you set "Size multiplier" property.

#1009
Quote from: Baguettator on Sun 29/09/2024 18:41:51Hi here,

I have Windows 10 64 bits installed, but I think I can't launch AGS on it (an error message pops up and AGS doesn't launch).

https://drive.google.com/file/d/1TdaPnWwrQPFRAsVC0lpVu8oot91zYuy4/view?usp=sharing

AGS Editor requires VC Redistributable 2015. Installer contains it, but if you are using zip archive, then you should install vc redist yourself. The link is found on the AGS download page here, in the list of requirements:
https://www.adventuregamestudio.co.uk/site/ags/
#1010
I suppose this should be obvious from the answers above, but to reinstate just in case: same object (character, etc) may be reused and play multiple roles in game. This is achieved by changing its looks and other properties.

Therefore, when you have a case when you need too many different variations of objects, create only number of objects that can be in play simultaneously, and configure them to represent different roles depending on situation.

Same object in 1 cell may display unlimited amount of items by changing its graphic.
Same character may play unlimited amount of random NPC variations passing by.
and so on.

Other than that, if you actually DO need a lot of objects on screen at once:
- AGS 3.6.1 and higher supports up to 256 objects per rooms
- Characters are unlimited and may serve as a workaround for objects, when you need them to have interactions. Also character may be moved to other rooms, so this prevents having to create same set of objects in all rooms, if you need to repeat certain things there.
- Overlays are unlimited and created right in script. They are a good choice when you need only visual representation (they do not detect clicks on them).

What else to say...
If the proposed way to detect the "role" or "meaning" of object by comparing its Graphic is not suitable or not convenient, there's also "Custom Properties" - these are values that may be "attached" to an object:
https://adventuregamestudio.github.io/ags-manual/CustomProperties.html
#1011
Quote from: Pax Animo on Sat 28/09/2024 18:44:30Heya, adding a new text line via *[* in strings no longer seems to work.

We no longer support "[" for newlines, now you should be using standard escaped sequence "\n" for this.
#1012
Quote from: ThreeOhFour on Fri 27/09/2024 15:12:13May I ask for an example of how to use the bitwise negation operator in syntax? Would it be something just like:

Code: ags
int FirstValue = 1101;
int SecondValue = ~FirstValue; //this sets SecondValue to 1011


Almost, but that code would make sense if ags script supported writing binary numbers, which it does not.
(and ~1101 = 0010)

Common use case would be something like:
Code: ags
enum PlantTypes
{
    Grass   = 1,     // this is binary 1
    Bushes  = 2,     // this is binary 10
    Trees   = 4,     // this is binary 100
    Flowers = 8,     // this is binary 1000
    Everything = 255  // this is binary 11111111
}

int plants1 = Grass | Trees;
int plants2 = ~Trees; // everything except trees
#1013
Quote from: Dave Gilbert on Fri 27/09/2024 15:06:14Oh my god I JUST encountered this bug yesterday and was going nuts thinking it was something I did that caused it. I fixed it by adding a Wait(1); command and I had no idea why it worked, it just did.

I suspect this is because cursor was changing to Wait cursor and back, and that forced the engine to update cursor's sprite on screen.
#1014
I might also mention that in AGS 4 there's a new compiler that provides more advanced syntax. There's "Use extended compiler" setting that enables it.
https://github.com/adventuregamestudio/ags/wiki/New-compiler%27s-end-user-cheat-sheet

We still call AGS 4 a "alpha" version, but it's generally usable, and I know that at least several people are actually making their games in it right now.
#1015
If anyone likes to test, here's a ready build:
https://cirrus-ci.com/task/5179752720367616

This lets select script module for individual:
* Characters
* Inventory Items
* GUIs (note that gui controls don't have this selection and use their parent GUI's module)

Rooms and room objects just display a room script there, but you cannot change that.

#1016
Here's a version with gui copy/paste fixed:
https://cirrus-ci.com/task/5132310821994496
#1017
Quote from: Pax Animo on Tue 24/09/2024 18:29:01Copying and pasting of labels on a GUI seems to be not working correctly, not sure what else this extends too but will update if any other problems.

Yes, copy/pasting gui controls appears broken in ags4 (it works in all other versions).
#1018
"user preferences file" is Game.agf.user, not editor preferences.

Second displayed error probably refers to Game.agf itself.

There's Game.agf.bak backup file created by AGS before saving a project each time. It may be used to restore previous game state by renaming Game.agf.bak to Game.agf.
#1019
Quote from: Dave Gilbert on Mon 23/09/2024 17:14:15Thanks CW! I tried your approach, but the dialog window doesn't disappear until I press the mouse button. When I unpause, the dialog window won't reappear unless I click the mouse button again. This could be due to the way I coded my pause function. I will look into that!

Dialog options are not redrawn every game tick, they are redrawn only when told to.

I suppose you may save last "paused" state in a variable and test it in "dialog_options_repexec" function. If it is different, then call DialogOptionsRenderingInfo.Update().

Code: ags
bool wasPaused;
function dialog_options_repexec(DialogOptionsRenderingInfo *info)
{
    if (wasPaused != IsGamePaused()) {
        info.Update();
        wasPaused = IsGamePaused();
    }

    <...>
}
#1020
Quote from: abstauber on Mon 23/09/2024 16:54:56Anyway a quick and dirty solution would be to wrap everything inside the function  dialog_options_render in a "isGamePaused" check.

It's generally recommended to use a inverse approach:

Code: ags
function dialog_options_render(DialogOptionsRenderingInfo *info)
{
  if (IsGamePaused()) {
    return;
  }

  // the rest of the code stays

This lets to avoid having all the function code nested inside a condition.


See also:
https://stackoverflow.com/questions/355670/is-returning-early-from-a-function-more-elegant-than-an-if-statement
SMF spam blocked by CleanTalk