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

#101
The code snippet that I posted earlier was only for clamping the x coordinate to the screen, nothing else. It has to be combined with the previously existed code to achieve result.

But now I see that you practically had the same code already, except you used hardcoded sizes, but idea was the same. The *only* mistake was that instead of using results of x and y variables when setting gui position, you used mouse.x, mouse.y again, thus all the calculations were lost.

The correct code might look something like:
Code: ags
int x = mouse.x + 20;
int y = mouse.y + 20;

if (x < 0)
    x = 0;
if (x + gGui9.Width > Screen.Width)
    x = Screen.Width - gGui9.Width;
if (y < 0)
    y = 0;
if (y + gGui9.Height > Screen.Height)
    y = Screen.Height - gGui9.Height;

gGui9.SetPosition(x, y); // <---- notice how SetPosition is using previously calculated x and y
#102
Quote from: Ghostlady on Sun 13/07/2025 02:20:52When I use that code, it puts the text on the other side of the room.  See image. The cursor is on the doorknob on the bottom to leave the room but the text is on the far right at top.

It should not be happening. Please post the code that you have now.

EDIT: also, I noticed that the code that you posted earlier is strange. You are assigning x & y variables, but gGui9 is still set as "gGui9.SetPosition(mouse.x, mouse.y);". What were you using x and y for then?
#103
How to prevent GUI from going offscreen:

Code: ags
   if (x < 0)
      x = 0;
   if (x + gGui9.Width > Screen.Width)
      x = Screen.Width - gGui9.Width;

Other recommendations: don't use literal numbers for things like screen size, use available script properties (Screen.Width, Screen.Height, Room.Width, Room.Height etc). You may be reusing same code elsewhere, and if you use properties, then it will keep working without modifications. Also less chance to make a typo.

Name your guis according to their purpose. For example, instead of gGui9 you could name it gOverhotspot. Then you will never wonder what is "gui9" if you ever return back to your game after a while.
#104
Quote from: FortressCaulfield on Fri 11/07/2025 03:05:11It generates an unknown character error, as it can't find a char named after the pointer I used in the functions. That said, it doesn't seem to matter, since even if I delete the functions entirely, I get no error messages but get an empty file.

This may or not be a mistake in the Editor program, I'd like to double check, that's why I was asking for a real example that causes this.
#105
Please post the function's declaration or an example of how such function is called.
When you say "gags", what exactly happens? do you mean error, or that it skips one? If it's error, please post error message.

Frankly, I am not sure if "Create voice actor script" handles custom functions, I will have to double check that.

But AFAIK the best solution for anything related to voice scripts is SpeechCenter plugin:
https://www.adventuregamestudio.co.uk/forums/modules-plugins-tools/editor-plugin-speech-center-version-2-2-0/
#106
Yes, the old compiler cannot handle this case for some reason, which I forgot.
I think I tried to investigate once, but it's code is confusing me, so I failed at the time.

You have to call a real function instead:

Code: ags
parent.Children[0]
---->
Code: ags
parent.geti_Children(0)

You can still use the proper syntax when using structs and attributes declared in other script headers.
#107
Quote from: Snarky on Tue 08/07/2025 09:24:04Once AGS 4 is officially released we can hopefully put an end to this issue once and for all (as it produces warnings for unlinked event handlers).

Yes, this is already in 3.6.2, and I've been already getting questions about older templates/projects posting new warnings.
Of course there's a chance that something is not working right in that regard, especially since rooms are compiled separately from the game scripts.

@updoggg which version of AGS are you using?
#108
No, there should not be any difference in which room you start, the dialogs are unrelated.

Unless your script changes this dialog somehow, and changing to a room skips that.
#109
1. Dialog options do not appear because by default they are not shown if there's only single enabled one, and the game selects the only one available automatically. If you want to override that, set "game.show_single_dialog_option = 1" in game_start.

2. It loops endlessly, because you have "return" instead of "stop". "Return" without a return value returns back to dialog option selection, "stop" ends the dialog. (but @eri0o already mentioned that)
#110
I don't know how your speech is done (and I cannot see your screenshot, it does not load for me for some reason).
But if yours is a normal blocking speech, then I believe that the common approach is to set hotspot label as not visible when the blocking action is performed.

In a most primitive way this may be done like:
Code: ags
function repeatedly_execute_always()
{
    gHotspotDescription.Visible = IsInterfaceEnabled();
}

EDIT: There's a global settings that hides GUI when the interface is disabled, but unfortunately there is no per-GUI setting like that, so it has to be done in script...
#111
Quote from: Gal Shemesh on Sat 05/07/2025 18:24:48If you say that this shouldn't happen, I'll just go ahead and strikethrough that text.

Well, "should not" as in "not supposed to". But whether it does or not I cannot tell, because I've never had seen the report myself and don't know what to test exactly.

I know that Editor had this issue when it failed to close the splash screen in case some library did not load. I have finally fixed this only recently.
But I do not recall same happening in case of loading a unsupported project, or creating a new project from template.
#112
QuoteIf you ignore this warning and tried to use it in an older editor version than the build number mentioned above, it may make your AGS editor to crash and lock itself in your operating system processes. This of course could be solved either by killing the process manually or by restarting your computer.

Since when this is happening? Normally the Editor should simply tell that it is incapable of loading the game and go back to the startup dialog.
#113
Quote from: bx83 on Sat 05/07/2025 09:32:29Mistake in my programming of code run by the engine; or an error in the engine? I don't quite understand.

It's a mistake in the engine which is triggered by too high "sprite cache size" number in config

Quote from: bx83 on Sat 05/07/2025 09:32:29Changed sprite cache size to 2048MB/2GB and Texture cache size as 1024MB/1GB

Do you really need a sprite cache so big? Usually texture cache is more important, because in the end Direct3D / OpenGL graphic drivers use textures. Sprite cache is used as a backup.

Do you encounter real issues if you make sprite cache smaller?

There is a "Old Skies" game released recently by Wadjet Eye company, their game resolution is 1920x1080, and their default settings are 1GB for both sprite cache and texture cache. Your game is 1366x768, so in theory may work with lower values (unless you have many long repeating animations).
#114
@bx83, I tried the game that you sent me.

So, there's definitely some mistake in the engine, but what appears to be triggering this is that you have a enormous "sprite cache size" in config set to 16 GB (!). You do not need a sprite cache that big ever, and especially since AGS 3.6.1 has a texture cache which is more important, and uses your video card's memory instead (VRAM). Also, since the engine is a 32-bit program and it can only load 3 GB in memory at once (and that includes not only sprites, but other things too).

I suggest changing cache sizes to some reasonable amount, like 500 MB or 1 GB tops for the texture cache, and maybe half of that for the sprite cache.

Meanwhile I'll investigate what is exactly happening. But I suspect that the engine gets confused by a big number and some math overflows...
#115
Quote from: bx83 on Fri 04/07/2025 23:08:14How do I get the dump file and EXE to you?

You can upload them to a file hosting such as google drive, dropbox, etc, and then PM me a download link.
I never distribute other peoples game files, only use them for the engine debugging.
#116
Hello, I am not suggesting myself for this, but I'd like to note this:

The contemporary version of AGS Editor can create a APK for Android itself (not iOS though), and there's Android port of the engine. While the latest 3.6.2 engine can still run old games (so in theory it's possible even to bundle old compiled game files with the new engine), ideally you should upgrade your game project to the latest AGS (to version 3.6.1 or 3.6.2): that will make it much easier to work with and port to other platforms.

The upgrade process may require tweaking some "backwards compatibility" options in the game settings, and maybe fix few things afterwards.
Also, if there are any issues if upgrading from 2.62 to 3.6.2 directly, then you may try upgrading in steps: 2.62 -> 2.72 -> 3.6.2
#117
Hello. The errors that display a "Illegal exception" text are caused by the mistakes in the engine, not script mistakes. They have to be fixed in the engine.

"program pointer is +32" is a secret code that tells that the error happens when trying to draw a room object.

I assume that there's something unusual in the View 345 that you are trying to animate.

1. Does the view exist?
2. How many loops does it have and do these loops have valid frames?
3. Do you have regular sprites in this view, or do you assign dynamic sprites to it?

If you have a crash dump, I will need both the dump and also your game's exe file in order to read it. Sometimes it's enough to understand the problem, but sometimes that will still require additional investigation.
#118
Quote from: eri0o on Tue 01/07/2025 16:35:47I don't have a target use for this now, but if there was a way to load a shader from a string, with somehow accounting for the different graphics driver, it would be possible to have shaders in script modules without packaging them separately.

I don't know yet, but as a workaround you may write files from script, and then create shaders from them.
#119
I was unsure what to reply...

For me, personally, today the situation is complicated, or maybe I should say "strange". I don't have a full-time job for a while now, and on another hand do not have any immediate financial issue (i have got savings). So it's not a lack of money or spare time that prevents me from working more. In the past there have been prolonged periods where I worked on AGS every day for months.

My problem today is that I have no real interest in continuing this work, and for some time have an increasing belief that it was not a good idea for me to participate in this project in the first place. The reasons why I'm still here are again complicated, but probably also nonsensical.

Given that, it's best to not assume my presence in the core dev group in the future.
#120
Quote from: Grundislav on Tue 01/07/2025 19:47:24I found some odd behavior, not sure if it's exclusive to 3.6.2 or has existed before:

When using goto-dialog in dialogue scripts, it doesn't register that a new dialogue is starting, so the on_event function for eEventDialogStart doesn't work. The workaround is to use eEventDialogOptionsOpen.

These dialogs events were introduced in 3.6.2, so all related behavior is new.

[REDACTED] (posted wrong explanation at first)

Regarding the issue, these events intend to work as explained here in this topic:
https://adventuregamestudio.github.io/ags-manual/Globalfunctions_Event.html#on_event

The eEventDialogStart is only ran once the game enters a dialog state. A "dialog state" goes from when the dialog is called from script to the point when it returned back to the normal game.
For any further change you should be using eEventDialogRun, it's triggered whenever any dialog entry is run, including "@S" entry of a new dialog. Which means that it should occur when you use goto-dialog as well.
The manual may be clarified for this bit.
SMF spam blocked by CleanTalk