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

#81
Could you upload a single sprite that has this issue for us to try in both old and new versions?
#82
I would argue that, whenever possible, a cutscene should be wrapped in its own function.
(That does not mean that all the cutscene code should be inside same function, it may be split into multiple functions, but they all called from a "central" function).

Indeed, anything occuring during a blocking action will be coded in repeatedly_execute_always, but the action itself can be controlled from the "cutscene" function.


About room changes: If your cutscene is played across multiple rooms, then use "if (Game.SkippingCutscene())" condition to skip to the final room instantly. That will save engine from doing alot of redundant work loading and unloading rooms, and also will make the skipping much faster.

That is unless you follow a previous suggestion by Snarky and want to divide cutscene into multiple parts, each in its own room.
#83
Quote from: Vincent on Tue 27/05/2025 00:40:22If I attach a shader (eg. to Screen.Shader) then I can't assign another shader to it? I am passing the shader to null before assign it a new one but it doesn't seems to be working, i might be doing something wrong.

I tried this, and it works correctly when I switch Screen.Shader to another shader instance. Please post the code that you are using.
#84
Quote from: Vincent on Tue 27/05/2025 00:40:22If I attach a shader (eg. to Screen.Shader) then I can't assign another shader to it? I am passing the shader to null before assign it a new one but it doesn't seems to be working, i might be doing something wrong.

Maybe there's some mistake in the engine, i will double check that.

Quote from: Vincent on Tue 27/05/2025 00:40:22Also for some reason if i run the game from the exe i don't see any shaders at all but its working fine in the editor.

There may be 2 reasons:
- you forgot to do Build EXE, and the exe in compiled folder remains an older version without shaders.
- somehow the exe uses a different config with another gfx driver set (that's unusual, but may happen in theory).
#85
There's no way to directly access other room. The usual way is to make a global variable, set it in room 2 and check in room 1's "before fade in" event, and setup the object accordingly.

Also, there's no need to use "object[1]", room objects can be given explicit script names and addressed using these names in script, like oPizza.Visible = true.
#86
AGS Engine & Editor Releases / Re: AGS 3.6.2
Mon 26/05/2025 09:48:32
Quote from: lafouine88 on Mon 26/05/2025 09:40:15About GUI's I have many on screen. All lifebars buttons etc. plus one that I just use for tests which is the yellow,red,blue,green and black lines to the right. I tried deactivating this one plus some others that could have interfered. But none of them seem to be the cause.

I'll try some more things tonight and let you know if I find something. Still, this whole thing is pretty weird, especially if I'm the only one getting this problem^^

If you could PM me the compiled game, then I would run this under debugger and see what's engine is doing there.
#87
AGS Engine & Editor Releases / Re: AGS 3.6.2
Mon 26/05/2025 08:29:33
In regards to the above problem, I got a PM from lafouine88 with more screenshots, it did not answer all the questions I had, but gave me an idea that this may be related to how GUIs are positioned on screen, and AGS trying to adjust the speech position because of GUI. Possibly something was broken in that logic. Unfortunately I was not able to reproduce this so far, it may require very specific combination of GUIs on screen. I'll keep looking.
#88
Quote from: arj0n on Sun 25/05/2025 15:10:44Issue: error when hitting Enter key in the open text parser window in the editor while no list item is selected:
  • Open Text Parser window from the project panel
  • Have no list item selected
  • Hit enter key
  • 'Object reference not set' Error

The error msg:

Error: Object reference not set to an instance of an object.


Looks like this bug is present at least since AGS 3.2.1.
#89
AGS has 2 commands:
1. File -> Autonumber speech lines
2. File -> Create voice acting script (should be run after speech lines are numbered)

Known editor plugin that further improve working with speech is a SpeechCenter plugin:
https://www.adventuregamestudio.co.uk/forums/modules-plugins-tools/editor-plugin-speech-center-version-2-2-0/
#90
AGS Engine & Editor Releases / Re: AGS 3.6.2
Sun 25/05/2025 13:48:51
Quote from: lafouine88 on Sun 25/05/2025 11:41:39I just have one quick question, on my rebuilt version of the game, the characters' speech are displaced to the far right of the screen for some reason. Is there some new option that has changed and I haven't seen?

No, there are no new options, and even if there were, AGS is supposed to keep old behavior when upgrading an older game.

I need to know how this speech was supposed to look like before, and how it's done in script.
#91
Quote from: Nine Toes on Sat 24/05/2025 07:06:35I have minimal understanding of C++; my background is mostly web languages. But by placing the asterisk immediately after the data type, I'm essentially saying "get the passed hotspot from the above function"?

There's no difference whether asterisk is right after data type or with a space in-between, AGS script (and also C and C++) treat these as the same thing. Where to place it in your code is only a matter of the code style.
In the above example this declaration sais "pass the hotspot INTO the function". If you would like to get the hotspot FROM the function, then that should be a return value instead, like:

Code: ags
Hotspot* getSomeHotspot()
#92
GetProperty and GetTextProperty work only with the custom properties, not standard ones. For standard ones there are explicit properties declared as a part of Hotspot type.

The property which is called "Description" in the Editor is actually called Name in script:
https://adventuregamestudio.github.io/ags-manual/Hotspot.html#hotspotname

So the code will be:
Code: ags
Display("You can't talk to the %s", theHotspot.Name);

EDIT:
Other than that, this function declaration misses a argument type
Code: ags
function youCantTalkToThe(hotspotRef){

It should be:
Code: ags
function youCantTalkToThe(Hotspot* hotspotRef){
#93
The first expansion of the Shaders feature, is the support for attaching textures, which allows you to mix multiple input textures in a shader (up to 4).

PR: https://github.com/adventuregamestudio/ags/pull/2733
Download test build here: https://cirrus-ci.com/task/4706533503664128

New script command:
Code: ags
/// Sets a secondary shader's input texture, using a sprite number. Only indexes 1-3 are supported.
void ShaderInstance.SetTexture(int index, int sprite);

Note that you can only use indexes 1..3. Index 0 means primary texture, so it's not allowed here.
The sprite can be any sprite number, either regular or dynamicsprite, there's no difference.

Use in shaders:

In GLSL you must use hardcoded 'sampler2D' uniforms "iTexture2", "iTexture3" and "iTexture4".
In HLSL names are not hardcoded per se (although you may use the same), but the registers matter: the 'sampler2D' variables has to be appointed to registers "s0", "s1" and so on.

GLSL example:
Spoiler
Code: ags
#version 130
uniform sampler2D iTexture;
uniform sampler2D iTexture2;
uniform vec2 iTextureDim;

varying vec2 vTexCoord;

void main()
{
    vec2 uv = vTexCoord.xy;
    if (floor(mod(uv.x * iTextureDim.x, 2)) == 0 && floor(mod(uv.y * iTextureDim.y, 2)) == 0)
        gl_FragColor = texture2D(iTexture, uv);
    else
        gl_FragColor = texture2D(iTexture2, uv);
}
[close]

HLSL example:
Spoiler
Code: ags
// Pixel shader input structure
struct PS_INPUT
{
    float2 Texture    : TEXCOORD0;
};

// Pixel shader output structure
struct PS_OUTPUT
{
    float4 Color   : COLOR0;
};

sampler2D iTexture : register( s0 );
sampler2D iTexture2 : register( s1 );

const float2 iTextureDim:   register( c2 );

PS_OUTPUT main( in PS_INPUT In )
{
    PS_OUTPUT Out;                             //create an output pixel

    float2 uv = In.Texture;
    float4 outpixel;
    if (floor(fmod(uv.x * iTextureDim.x, 2)) == 0 && floor(fmod(uv.y * iTextureDim.y, 2)) == 0)
        outpixel = tex2D(iTexture, uv);
    else
        outpixel = tex2D(iTexture2, uv);

    Out.Color = outpixel;
    return Out;                                //return output pixel
}
[close]

Above examples simply interleave 2 sprites together where odd pixels come from one sprite and even pixels come from another.
#94
Since this is resurrected, it's worth mentioning:

1. If you are using AGS 3.6.0 and later then you might consider adding "acsprset.spr" to .gitignore so to not have a huge compiled spritefile in a repository. But only do so if you have all sprite source file in the relative project subdir; in such case you will be able to restore sprites from sources when checking out the repo.
This is not a rule, but a recommendation, decide this for yourself and for each individual project.

2. If you are using AGS 4.0, then the "room*.crm" should be added to .gitignore, because these are now output files, and room sources are inside Rooms folder.
#95
Quote from: DiegoHolt on Wed 21/05/2025 17:07:47I'm using version 3.6, and I have downloaded 4 but still haven't tried it out. Can I just open my 3.6 project in the new version and work there without any problem? What do you all recommend? Do I keep working on the old one or should I change? My game is about half way progress.

I recommend trying DynamicSprite.Rotate first in 3.6, as it may give an acceptable result with the certain effort.
AGS 4.0 is not nearly as stable and consistent as 3.6 now.

Quote from: DiegoHolt on Wed 21/05/2025 17:07:47
Quote from: Crimson Wizard on Wed 21/05/2025 13:06:12AGS 4.0 does not support rotating gui controls yet, because there were some complications with them when I first added object rotation, and later I forgot to address this problem again.

This may be worked around by placing screenshots on multiple GUIs or Overlays, and rotating them instead.

So, in your last sentence are you talking about 3.x or 4?

I was talking about AGS 4.0.
#96
AGS 4.0 does not support rotating gui controls yet, because there were some complications with them when I first added object rotation, and later I forgot to address this problem again.

This may be worked around by placing screenshots on multiple GUIs or Overlays, and rotating them instead.
#97
Quote from: eri0o on Wed 21/05/2025 03:32:06Hey, I wanted to play with this and had some ideas, but currently the only texture a shader instance can have access to, is the one it is attached to. I think this is due to how AGS works that it works with sprites, which may or may not have a texture associated.

I had this in future plans. Did not think the implementation through yet.

But the general idea was to assign a sprite number as an extra "texture source" to the ShaderInstance. When this is done, the engine would create and lock a texture for that sprite in a texture cache, and assign to DDB as an extra sample texture. Then this extra texture is attached to a shader during render. Might try making an experiment in a few days.
#98
Quote from: Peegee on Tue 20/05/2025 08:19:09It's strange, when I removed the outline of the font, the text took more space in width...

That is unexpected. Could you tell which version of AGS are you using, which font, and how the outline was made (was it using another font, or automatic outline, etc)?

Quote from: Peegee on Tue 20/05/2025 08:19:09Sorry, I didn't want to send my picture so as not to reveal my game (GOBLiiNS6), and it was just a parchment (with an illustration).

Well, I understand, but you could make a screenshot in some mockup scene in such situation, with just the text shown.
#99
We've been asking for a game screenshot, because that will let us to clearly see the problem with your text. "Rough and contrasting" may have a number of reasons. Some reasons may be solved by easier means.

For example, have you tried turning "Anti-alias TTF fonts" on? This option is located in General Settings -> Text output. (Or do you have it turned on already?)
What is your game resolution? This option works better in high resolutions than in low resolutions.

Another option that you may try is making speech text's overlay slightly transparent (using Transparency property of a Speech.TextOverlay).

Spoiler
Example:
Code: ags
function repeatedly_execute_always()
{
    // test if there's a blocking speech overlay on screen
    if (Speech.TextOverlay != null)
    {
        Speech.TextOverlay.Transparency = 10; // this value may be experimented with
    }
}
[close]

I'd try the "GUI above the text" as a last option. It's not difficult to do, but seems like an unusual solution.
#100
Right click cycle is done in "handle_room_click" within the Sierra template, but it's done using standard function "Mouse.SelectNextMode", which automatically switches to the next enabled mode.

What you should do instead is disable all modes that you don't need. Open each unnecessary cursors in the editor and set "StandardMode" to False.
SMF spam blocked by CleanTalk