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

#141
Quote from: ironhide1975 on Sat 21/06/2025 13:17:18Upgraded to the latest version and got an error saying gControl_OnClick was missing from the gPanel?

Please post exact message that you get (you may right click on it and select "Copy" then paste here), and tell under which circumstances this happens.

I may guess you are referring to a warning (yellow icon) that is printed when compiling the game if some of the functions mentioned in the control's events is not present in script, or on contrary a function is present in script is not linked to the control's event.

You can double click on the message and that will bring you to the location in script or the GUI that has this mistake.
#142
Please tell when and under which circumstances did this happen?

Does this happen regularly, or happened once?
#143
Two common solutions are:

1. Make a separate walkable area (there are 15 per room), disable it at first and enable when the time comes:
https://adventuregamestudio.github.io/ags-manual/Globalfunctions_Room.html#restorewalkablearea

2. Make a Solid object covering the passage and turn it invisible by setting Transparency to 100.
When you need a passage turn Solid to false:
https://adventuregamestudio.github.io/ags-manual/Object.html#objectsolid
https://adventuregamestudio.github.io/ags-manual/Object.html#objecttransparency

#144
Since AGS does not provide any ready functions for this, then you have to script everything yourself from scratch, unless you find a script module written by someone (I don't recall any similar though). But then again, this is true for any generic engine out there, except if there's a engine specialized for turn-based strategy games.

From the performance perspective, I think that one issue that you may encounter in AGS is the lack of parallel execution support in script: you cannot explicitly ask some long calculation to be run in background (pathfinding or decision making). I've met this problem in another engine many years ago, and solved it by splitting long calculations into parts then running only one part per game tick.

Pathfinding on a tile-based map may be typically done using classic A* algorithm (read as  "A-star"). You may search for its explanation in the internet, there has to be numerous tutorials and code examples out there. I recall that it has a relatively compact code (but of course it may be not easy to understand at first, so just follow the tutorial). It may be written in any programming language, including AGS script. I believe that it may be easier to do in AGS 4 with its better scripting features, but possible to do in AGS 3 as well.

The enemy AI, on another hand, is such a broad topic that it's difficult to decide how to start discussing it... I think that typically it is based on factor "weights", where each kind of problem has its "weight" which defines priority. Tasks have to be divided on levels: a strategy level that declares big goals, then lower levels which declares goals for each group of units, then for an individual unit, and that unit must be appointed either a order that brings closer to a strategy goal, or an order that reacts to its immediate situation (like survival). Perhaps, think of it as a chain of command, where each sub-commander receives an order from above, and deals only with their surroundings.

If you did not do that before, then I might suggest starting small and make a simpler game or a series of games first.

For example:

1. Make a game without real terrain and movement at all, where player and AI choices are made only regarding spending resources, and the outcome depends on what was bought on these resources. This may be a economy or a management game, but also a sort of a jRPG-style combat scene, where actors don't move but choose which actions to use, and resources are their Health and Energy/Mana/Whatnot.

2. After that try one with pathfinding: make a turn based combat game where player and enemies are located on a small grid with obstacles and have to take better positions to attack.

3. An idea for learning to code an AI is a game where the human player is a leader, but units are controlled by computer (think old classics like "Settlers" for example). Human issues orders and units perform them as they see fit. That will narrow down work necessary for AI.

That's just some ideas for educational purposes.
#145
Quote from: Zrezal on Thu 19/06/2025 18:54:43Why has the thread been moved to another subforum?

This was done by a "GiP" moderator; I think the "Game in Production" thread has rules where you must already have a solid progress with your game and post at least 2 screenshots from different game scenes:
https://www.adventuregamestudio.co.uk/forums/ags-games-in-production/forum-rules-please-read-before-posting!/
#146
Quote from: AGA on Sat 14/06/2025 11:34:04The Microsoft site suggests that the new >= 2015 bundle is backwards compatible, but would be great if you could test to be sure!

I tested this and confirm that previous recent versions (3.6.0, 3.6.1) also work with this VC Redist.
#148
Quote from: edmundito on Thu 19/06/2025 02:28:401. When the fonts were imported, only one appeared on the font file list; the rest had to be removed and reimported

I was not able to reproduce this with a random project.
Please provide more information:
- which fonts were present in the old project
- which font files and font items appear in the upgraded project
- which files appear in the Fonts folder.


Quote from: edmundito on Thu 19/06/2025 02:28:402. Moving fonts into the Fonts\ folder causes all kinds of problems. It would be nice if the editor detected them and asked to see if you wanted to import them. This should be true for anything automatically added to the game that AGS recognized as valid format

Note that you can import from Fonts folder as well, editor is supposed to allow that.

About automated suggestion - please open a feature suggestion in github tracker.
There are a number of issues to discuss there. For instance, in regards to fonts, as fonts are separated into font files / fonts now, there's no direct match between a font file and a font. AGS can import font files, but will need some instruction about whether to create font items from them.
#149
Quote from: Zrezal on Wed 18/06/2025 19:05:50Logically some things could not be done, such as the characteristic text inside the box (which I could replicate, but it is impossible for me to manage conversations and mouse clicks due to engine limitations).

All of this can be done in AGS engine. If you would explain in detail how things are supposed to work we might be able to tell how it may be managed in AGS.
#150
Quote from: Ghostlady on Wed 18/06/2025 02:42:49I am speaking of a TRA file in my current compiled game with the latest version of AGS. Someone told me how to get a script of the whole game, but I can't find the post right now. Maybe it wasn't the tra file but a different file.

Have you tried checking the TRS file of the same name? I just do not understand the reason why are you looking into TRA. TRS file is the translation source. TRA file is the compiled translation.

When you speak of "whole script", are you referring to the acting script by a chance? There's a command that can create one in File menu.


Quote from: Ghostlady on Wed 18/06/2025 02:42:49I do know the keyword I am looking for. Is there a way to a run text search over all the files without going one room at a time?

I think AGS can search in all scripts including room scripts if you go to any script, do Edit -> Find All and select "Look Into: Current Project".
If that does not work, most file managers can search through files, Windows File Explorer can do that if you ask it to search the file contents AFAIK.
#151
Quote from: Ghostlady on Tue 17/06/2025 18:48:32In that past, I was able to use that tra file and be able to view it and able to search it.  This replaced the "filedump" that was in the very old version.  I need to find some speech in the game and I don't want to have to go through tons of rooms. 

From what I know, very old versions of AGS have kept the translation text as-is, but later versions, starting from 2.72 or so, encrypt the text in order to avoid players reading it to get hints.

Are you speaking of a TRA file that you compile right now in the project you are working on, or are you speaking of a TRA file coming from some old game to which you no longer have a source?

On another hand, do you know what key words the speech contains? If so you could just run a text search over all the script files and room files in the project.
#152
This task is best separated into parts:
1. Data, how the necessary animation sections and other properties are organized within existing items (views, loops etc).
2. Engine behavior, how the engine runs these animations.
3. Editor interface.


For example, there may be two options for making start/stop animations.

One is to define a entry and exit sections within a loop, where middle section will be treated as looping.
This, however, may be inconsistent if used with Animate command, because animation may be stopped instantly by a script command, and it won't be proper to play an ending sequence after it ordered to stop. So while entry segment might work with Animate command, the exit segment won't.
OTOH, I suppose that having entry segment in the loop may be useful for regular Animate command too. Alternatively, we might introduce new parameter to Animate that tells which part to play: entry, middle or exit.

Another option is to have a new dedicated loop for each enter/exist segment. The downside would be too many loops to set, as you need that for each walking direction, so for a single walking dir you'll have 3 loops, for 4 directions - 12 loops, and 24 loops in case of 8 directions. Or maybe that's not a big deal. I'm not an animator, so cannot tell.

The upside of this second approach is perhaps that it's more consistent with idea of "animation transition".
If we also have transitions between walk directions (for turning), these would be dedicated loops, and then the whole system is represented by loops with assigned roles (rather than parts of loops).


EDIT:
I remember that in sound design the starting/ending parts of the track are called "Roll In" and "Roll Out". Do you use similar terms in animation?


EDIT 2:
Speaking of workarounds, AGS 4 script has a new Pathfinder and MotionPath commands that let you calculate the walking path and use it for scripting custom walking.
#153
Translation source is called TRS, these files are in your project's root folder. TRA is a compiled translation prepared for the engine, which you should not read.

There is a folder called Compiled/Data, where editor puts all the game data, before copying further into Compiled/Windows and so on. If there are any old files, they will still be copied to Compiled/Windows. Double check that old translation files are not in Compiled/Data. OTOH you may simply delete whole Compiled folder and do Rebuild All in the Editor.
#154
Not the engine by itself, but there's a script module that does this:
https://www.adventuregamestudio.co.uk/forums/modules-plugins-tools/module-fancy-0-1-0/
#155
Quote from: Mehrdad on Mon 16/06/2025 13:44:06Thanks so much for adding XOffset and YOffset properties for the View Frames. It's really useful for me :P

Yes, these were asked for very long ago, and it appeared that AGS already have them for a long time but they were unused in the program, so I just wired them up.

Of course there's still no convenient way to set them up visually in the editor (rather than typing by hand for every frame). A View editor redesign is something that has to be done in the future.
#156
Anyway, the shaders feature is now a part of AGS 4 since Alpha 22 update:
https://www.adventuregamestudio.co.uk/forums/index.php?msg=636683993
#157
Updated to Alpha 22
(Please use download links in the first post)

This update contains all the new features and fixes from 3.6.2 release and 3.6.2 Patch 1 (except ones related to backwards compatibility).

Own changes:

Editor:
- Editor requires .NET Framework 4.7 to run.
- In General Settings added "GUI common controls handle only left mouse button" option that lets prevent RMB from activating gui controls, except those that have separate actions for left and right mouse buttons.
- Added XOffset and YOffset properties for the View Frames.
- Redesigned Color Finder panel, now it lets to specify alpha color component, and convert between several different color representations.
- Fixed error occuring when creating a new Font.
- Fixed error occuring when renaming a room.

Script API:
- Added ShaderProgram and ShaderInstance structs, meant for the custom shaders support.
- Added Character.Shader, GUI.Shader, GUIControl.Shader, Object.Shader, Overlay.Shader, Camera.Shader, Viewport.Shader, Mouse.CursorShader, Screen.Shader.
- Added Button.GraphicFlip property.
- Added GUIControl.Rotation.
- Added GUIControl.ScaleX and ScaleY properties, GUIControl.SetScale() function.
- ViewFrame.Flipped property is now settable and returns eFlipDirection instead of bool.
- ViewFrame.Speed property is now settable.
- Added ViewFrame.XOffset and YOffset properties.

Engine:
- Support custom shaders, initialized through script API. Shaders are loaded and compiled from GLSL (for OpenGL) or HLSL (for Direct3D) shader scripts, and may be attached to game objects, camera, or the whole game view. Shaders may have user-defined constants, and have up to 3 secondary textures on input.
- Support compressing game saves using Deflate algorithm. Added config option "compress_saves" in "misc" section, disabled by default.
- Always compress a screenshot in game save using Deflate algorithm.
- Consistent GUI translation: the values of textual properties will never be automatically translated on assignment or reading them, only the text displayed on screen will be translated.
- Fixed error occuring when either a screenshot is made, or Crossfade or Dissolve room transition is run.
- Fixed error which had a chance to occur when ordering a character to walk after recently restoring a save.
- Fixed character not making the first animation step before starting a move.



The shader support is a new big feature, and difficult to explain in few words, so I suggest reading more thorough explanation in the dedicated forum thread here:
https://www.adventuregamestudio.co.uk/forums/engine-development/experiment-ags-4-custom-shaders-support/
This will be added to the AGS 4 manual eventually.



#158
I have a small request, can someone download the demo game (linked in this thread's first post), enable "background" shader ("Bg" button), and tell how it looks like?

You should be seeing "ripple" effect, but does it look like smooth waves, or plain circles expanding from the center?

It worked well for me in the past, but when I test this now, I have a different result. I am in doubts whether there's something wrong with the game which I did not notice earlier, or something wrong with my video card (I had suspicions that it might be malfunctioning lately).

EDIT: okay, got this fixed by rebooting PC. No idea what caused this, either a random glitch or some other software put gfx card into a wrong state... :/
#159
The InventoryItem* parameter in this function is not the used item that player has in "hand", but the item which is being clicked on, so it's other way around.

For checking which item is being used use player.ActiveInventory instead:
https://adventuregamestudio.github.io/ags-manual/Character.html#characteractiveinventory

Code: ags
function iVetev_UseInv(InventoryItem *theItem, CursorMode mode)
{
  if (player.ActiveInventory == iGumicka)

Code: ags
function iGumicka_UseInv(InventoryItem *theItem, CursorMode mode)
{
  if (player.ActiveInventory == iVetev)

On another hand, when you combine items in any order, I may suggest to move the code into a separate function and call from both, in order to reduce code duplication. For example:

Code: ags
function Combine_iGumicka_iVetev()
{
  player.Say("I conennected a gumicka and a vetev. Now I have a prak.");
  player.InventoryQuantity[iVetev.ID]--;
  player.InventoryQuantity[iGumicka.ID]--;
  player.AddInventory(iPrak);
}

function iVetev_UseInv(InventoryItem *theItem, CursorMode mode)
{
  if (player.ActiveInventory == iGumicka)
  {
    Combine_iGumicka_iVetev();
  }
  else
  {
    player.Say("This cannot be combined.");
  }
}

function iGumicka_UseInv(InventoryItem *theItem, CursorMode mode)
{
  if (player.ActiveInventory == iVetev)
  {
    Combine_iGumicka_iVetev();
  }
  else
  {
    player.Say("This cannot be combined.");
  }
}
#160
AGS Engine & Editor Releases / Re: AGS 3.6.2
Sun 15/06/2025 00:59:14
3.6.2 Patch 1 is released with all the accumulated fixes so far:
https://www.adventuregamestudio.co.uk/forums/ags-engine-editor-releases/ags-3-6-2-patch-1/
SMF spam blocked by CleanTalk