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

#741
To put it simply, not all of the blend modes were implemented correctly in all graphic renderers, and this has to be looked into before the final AGS 4 release.

BTW, there's a ticket that I wrote, about "reimplementing blend modes as shaders", but I wrote it just to have a formal reminder. It is quite possible that this cannot be done with shaders alone, since, as eri0o mentioned, for blending you have to combine pixels from current texture and pixels from already drawn textures below, and shaders cannot do that on their own afaik.
#742
Although the link on the FAQ has been fixed, the "legal" page is still present in AGS website, and people somehow may get there: https://www.adventuregamestudio.co.uk/site/ags/legal/

Not sure how, but maybe it's indexed in the search engines like Google.

This came up recently when a user PMed me asking if the MPEG license is still an issue.
#743
In AGS you cannot pause a script in the middle to receive GUI input or user input. Meaning you can wait in the middle using Wait command or a blocking action, but during that GUIs won't react to input, and events like "on_key_press" and "on_mouse_click" won't run.

The common way is to break the script into 2 parts, one run before the input and another after.

How to do that depends on whether this is a regular script or a dialog script.
For instance, if done in dialog script, you could implement 2 parts as 2 separate topics, and have dialog options with text input box shown in the middle (there's a setting in Dialog that allows to show input box in dialog options).

With regular script, you will have to finish the first part with displaying a GUI with text box (possibly the GUI with "Pause game when shown" style), and run the second part when that particular text box receives OnActivate event.
#744
Quote from: Rik_Vargard on Mon 09/12/2024 18:45:40Because when, after the update was done and I restarted AGS, ALL of my 3200+ sprites in AGS had disapeared from the AGS sprites tab.
All the sprites in the Views had also disappeared. In short, it was all gone.

Have you tried -
File -> Restore all sprites from sources
(also available from Sprite Manager context menu)
?

If you have sprite sources intact, you do not even need to backup the sprite file (which is probably one of the biggest files in game).

EDIT: however, why is this posted in "AGS Games in Production"?
#745
Quote from: Joacim Andersson on Sun 08/12/2024 21:51:10Thank you CW, I do realize that I can write my own code around this, and that's not really the problem. It's just that I kind of remember that I once used some built-in feature for this, something similar to SetRestartPoint except that would require that you've already played through the intro.

I see what you mean now.
You can create custom save slots for players that already passed certain stage, that may be used to restore later.
This is done simply using SaveGameSlot / RestoreGameSlot, but you use a slot number outside of a regular range that you let use in save/restore game menus.

But that won't help to skip if they haven't passed that yet.
Alternatively, you may even make one yourself and supply along with your game (except you'd probably need an installer to be able to place one in a savegames folder). Idk how convenient that would be though.
#746
Quote from: Joacim Andersson on Sun 08/12/2024 20:15:59The intro part ends in the same room as the game begins in, and the continuation is still within this room.

To clarify, the game starts within a room, the player has to leave and follow a path to another specific room where he gets some information. He then returns to the original room and on the way he meets another character that follows him inside the starting room and a conversation is had. The other character then leaves and this is the end of the intro.

Well, the solution is very straightforward, although amount of work varies from case to case:
- Make a list of changes that player actions do to the game state within the intro sequence.
- Apply them at once programmatically when skipping intro sequence.

This situation is similar to the one when you want to make a teleport to a game chapter - for testing purposes. You need to know how the game state changes between the chapters, and apply these changes in script.
Sometimes it's easy to know the state it should be in. Sometimes it may be more convenient to apply series of changes one by one (even if these are changes to the same object), mimicing player actions that would be made in previous chapter(s).

Global state is usually easy to modify.
Room states are more complicated, since you cannot change room state without loading a room. These are commonly solved by storing global variables that tell how a room should look like when visited next time. When a corresponding room loads, modify its state in "room load" event according to these global variables.
#747
Simply change to the room which comes after the intro part, and set global game state accordingly (meaning any changes to characters, inventory and variables that become modified during the course of the intro part).
#748
In AGS you cannot import functions from the room scripts, because they would depend on which room is loaded.
You will need to change how your code is organized.

I think the best way may be to script the combat system in a separate script module, use Characters instead of objects, and only setup and activate combat from the room script in which it takes place, by setting variables and calling functions imported from that module.

EDIT:
If you must use room objects, or anything from the room, in your combat module for any reason, then one approach would be to declare pointer variables (or attributes) in that module, which are then assigned in room script.

To give a simple pseudo example:
Code: ags
// in Combat.ash
import Object* HeroObject;
import Object* EnemyObject;

// in Combat.asc
Object* HeroObject;
Object* EnemyObject;
export HeroObject, EnemyObject;

// in roomX.asc
function Room_Load()
{
    // assign these Combat module pointers to local room objects
    HeroObject = oHero;
    EnemyObject = oEnemy;
}

Although I normally recommend using Characters for this kind of thing.
#750
Quote from: Snarky on Sun 08/12/2024 01:10:56Isn't it obvious? AGS is, primarily, an engine for making adventure games. Features that are commonly used in adventure games are well supported (e.g. inventories, dialog), while features that are not commonly used are not reliably supported

In contemporary engines all transformations are handled by matrixes, that covers both drawing and interacting with (click detection). Would the engine be written in a modern way, there's high chance that rotation would be supported from the start simply because it's a part of a standard transformation matrix, and it would not require much additional effort. There would be little reason to skip it, regardless of which game genre this engine prioritizes.
#751
I think the real honest answer is that AGS was designed in very old-fashioned way and relying on obsolete tech (software rendering), and engine code was ugly so adding more features properly was difficult. That's why it was not done earlier.

I am not sure if it matters that it's not used much in adventure games. This may be the case of people not using something because it's not easily available.

But in any case it's already available in AGS 4.0 for a while now (as well as some other things).
https://www.adventuregamestudio.co.uk/forums/ags-engine-editor-releases/ags-4-0-early-alpha-for-public-test/
#752
Quote from: eri0o on Fri 06/12/2024 12:32:25So I really would like to have a button on the room editor so one can just click and put the player character somewhere there - like it is done in rpg maker.

Such button may be a good thing, it's going to be pretty explicit too.
OTOH, what about drag & drop Character from the project explorer?
#753
Quote from: ThreeOhFour on Fri 06/12/2024 11:41:03I just switched AGS 4.0 to use the extended script compiler, and now rellax gives me this error:

rellax.asc(679): 'Rellax::set_TargetCharacter' has the qualifiers '' here but 'static' elsewhere. See rellax.ash line 89

I realise that AGS 4.0 is still in development, but figured it would be worth mentioning here!

That's a mistake in the module. The old compiler was more "relaxed" (accidental pun), and ignored some of them.
The TargetCharacter is declared as "static attribute", so it cannot have "this".

To fix this, change from
"void set_TargetCharacter(this Rellax*, Character* target)"
to
"void set_TargetCharacter(static Rellax, Character* target)"

For this, and all the similar functions.
Note that such change will work well with the old compiler too.
#754
Note that with the linked list you do not have to do recursion, you may do a classic loop over linked list; pseudo-code:

Code: ags
segment = firstSegment;
while (segment != null)
{
    DrawSegment(segment);
    segment = segment.nextSegment;
}

or same with the "for" loop:
Code: ags
for (LineSegment *segment = firstSegment; segment != null; segment = segment.nextSegment)
{
    DrawSegment(segment);
}
#755
Make sure you are using the new v4 script compiler. There's a Script compiler selection in General Settings -> Compiler.
#756
Wait, are you speaking about starting room? If so, then you must do that in the Editor.
Open the player Character, and set StartingRoom property in the Property Grid.
https://adventuregamestudio.github.io/ags-manual/EditorCharacter.html
#757
You don't have to use Room.Exists though, simply use player.ChangeRoom(N).
#758
Quote from: Danvzare on Thu 05/12/2024 17:55:50While I'm in agreement. Doesn't this same logic apply to modules and templates?

I don't think so. I believe there's a difference between inserting a code snippet in your program without understanding what it does, and using a separate module, or a library through its program interface. Modules are being a responsibility of someone who wrote them and maintains them. If they don't work you report that and their maintainers fix the problem while understanding what they are doing.
With a ai-generated code you are relying on a machine which has zero responsibility over what it did.

Quote from: Danvzare on Thu 05/12/2024 17:55:50I suppose pointing a beginner to a module to help them out with their problem, isn't actually helping them in the long term.

As a programmer I've been using libraries written by someone else without ever looking inside of them. That saves a lot of time, and lets me focus at the problems at hand. If I ever need to know how the library works, I can do that later when I can dedicate time and have a good reason to.
#759
Well, I disagree, and furthermore this is frustrating to me to the point when my head begins to hurt, so I'd rather just not continue this conversation.
I will try to restrain myself from posting in these discussions further.
#760
If a line with "min" looks too complicated to read, then it may be replaced with another helper function with speaking name.

For a quick example:
Code: ags
int takeMostToFill(int reserve, int currentLevel, int maxLevel);

int energyChange = takeMostToFill(playerEnergy, thisEnergy, thisMaxEnergy);

SMF spam blocked by CleanTalk