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 - Baguettator

#41
Hi, I just tried to save/load with the new version, and I got a crash again. It seems something linked to the engine, and not something linked to my code.

An exception 0xC0000005 occurred in ACWIN.EXE at EIP = 0x00572656; program pointer is +6, engine version 4.0.0.15, gtags (0,0)

Here is the updated compiled game, with the crash log inside.

https://drive.google.com/file/d/174ekAxu5V3ci3FdxvMUdbWUBGJUOPODh/view?usp=drive_link

You can try the same Ctrl+N to make save called "try", and load it by clicking on the "CHARGER" button you can see in the menu.

The ONLY thing that has changed is that I used that at game_start :

SetGameOption(OPT_SAVECOMPONENTSIGNORE, eSaveCmp_Audio + eSaveCmp_Dialogs + eSaveCmp_GUI + eSaveCmp_DynamicSprites + eSaveCmp_Plugins + eSaveCmp_Cursors + eSaveCmp_Views);

If I disable this function, the loading doesn't crash.

Let me know if you find something !
#42
So, here it is. The message when the crash occurs :

**********************
An exception 0xC0000094 occurred in ACWIN.EXE at EIP = 0x004307E6; program pointer is +5, engine version 4.0.0.15, gtags (0,0)

**********************

And here the compiled game. I made it with the temp build you posted just before (with dynamicsprites fix). The CrashLog is inside. If you want to reproduce it quickly launch the game and when the menu appears, press Ctrl+N. The code is :

SaveGameSlot(1, "try");
Display("fait !");

The crash occurs after I click or press a key to exit the display function. Until that, the crash doesn't occur (don't know why, maybe because SaveGameSlot works at the end of the script..?).

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

Do you need anything else ? I hope it will help ! I had no issue when saving with 3.6.1 (and perhaps when I started using AGS 4.0, but I don't remember which version it was)
#43
OK, I will finish what I'm working on, will test again the savegameslot function in a newly compiled game, and if it crashes, I'll send you the compiled game with the crash dump ! I'm currently using the last build you sent me, the one with the fixes for buttons graphics and dynamicsprites problems.
#44
I just got crashes each time I use the SaveGameSlot. For testing, I just used SaveGameSlot(1, "try"), and it crashes.

Here is the crash log :

https://drive.google.com/file/d/12ITmPlSQgarTUPnB3DvXWBJcD2Bt6fxA/view?usp=drive_link

The error message displays :
Illegal exception
An exception 0xC0000094 occurred in ACWIN.EXE at EIP = 0x004307E6; program pointer is +5, engine version 4.0.0.15, gtags (0,0)
AGS cannot continue, this exception was fatal. Please note down the numbers above, remember what you were doing at the time and contact the game author for support or post these details on the AGS Technical Forum.

I don't know if it's a bug or something wrong in my game ? I got no issue before...
#45
Works perfectly for me ! Thanks !
#46
Quote from: Crimson Wizard on Tue 25/02/2025 13:55:14Are you asking if it's normal that you cannot delete sprite 0? If so, then yes it's normal, because sprite 0 is used as a safety placeholder when the engine is told to draw any non-existing sprite.

Yes, so no problem, I won't delete it :)

Quote from: Crimson Wizard on Tue 25/02/2025 13:55:14Is it possible to change something in the engine to avoid changing the size ?

That is a mistake and must be fixed.

Perfect !! So many hours I tried to find what wasn't working, I'm happy that it was from the engine. Thanks for helping ! I wait for the next update to see if anything is working !
#47
Double-post just to signal the result of my testing : at game start, buttons with 0 are grey squares, with their correct width and height. IF I change them after in the scripts, they become grey squares, but their size is changed to the sprite number 0's width and height ! For me, bluecup is width 10 and height 6. So very small !

Is it possible to change something in the engine to avoid changing the size ?
#48
OK, so there is a problem for me. I have, in my sprites, the original bluecup (the one from the game template) as the sprite number 0. I can't delete it (it's unclickable when I right-click on it). Is it normal ?
#49
Well something is confusing me.

If I create a button in the editor and let its graphic property to 0, it will have the grey color, even if I launch the game.

If in script, I make button.NormalGraphic=0, it will have the sprite 0 as its graphic, and for me, it's the blue cup from AGS. I can't delete that sprite, but the problem is that it will resize the button.

My script wants to automatically give a sprite for buttons that will have the same background, but not necessarily the same size. So I use dynamicsprites to create them, and give them to the buttons. To optimize my game, I just create the sprites I need (so not the same if I'm in room 1 or in room 2). And so I know that if I let a button without any graphic in the editor (grey square by default), it will be given a sprite when I launch the game. So I have a buttons array "A" to store the buttons that need a sprite if I'm in room 1, and another array "B" to store the buttons that need a sprite if I'm in room 2.

The problem is that I want to give button.NormalGraphic=0 for buttons that don't need a sprite (the array A when in room 2, or the array B in room 1). I thought it would be very useful to make them grey squares as they were when game_start, without changing their size. But the game always change their size because it gives them the bluecup sprite...

I'm sorry if it seems a bit like a "technical problem thread", but I'm just asking here because it could lead to something changing in the engine. I think it could be very good to be able to make buttons' graphics with the grey color as in the editor. At least, make the sprite number 0 something else than a real sprite. Like just a transparent surface with the same width and height than the button. It would make 1 sprite less to have in memory for the game... :D

Am I talking about something weird..? Let me know !
#50
Hmm OK, so it's not intended anymore that if I delete the dynamicsprite of a button, its graphic property will be reset to 0 ? It will remain like that for the future versions of AGS ?
#51
Yes but in the manual, it says that deleting a dynamicsprite that was given to an object (guicontrol etc...) resets its graphic to 0 to avoid problems. So it should be managed by the engine ?
#52
Oh, sorry, I posted the compiled game instead of the game project ! Here it is !

https://drive.google.com/file/d/14JS00QH53-ZVhzpP77eylpqVlzpkXXiN/view?usp=drive_link
#53
OK, so I think there is a problem in AGS 4.0 ! (last version available).

I just made this game, with a simple code : a GUI with 20 buttons, 2 dynamicsprites arrays with a size of 10 for each.

Ctrl+M creates the dynamicsprites for the two arrays (so 20 dynamicsprites).

Ctrl+N deletes the dynamicsprites of 1 array.

Then, clicking again Ctrl+M makes a weird thing : sometimes, seems random, just the first dynamicsprites is really created (or successfully assigned to the button it should be assigned). But sometimes, they are created as intended, and display correctly.

Let me know if it means something for anyone here ! :)

https://drive.google.com/file/d/1H3Zx3ogYxpGpZRk3VG0rZ7B53sI862RN/view?usp=drive_link
#54
Hi there, I need to know how dynamic sprites are managed in AGS 4.0. Because I can't figure out what's wrong in my code...

So, how are they managed ? Are they sorted in something like a dynamic array ?

If I create 10 dynamicsprites, then I delete the fourth and the sixth of them, do their graphic value changes (for the others remaining) ?

Because, I can't explain why, but it's almost what I am doing, using dynamic arrays of dynamic sprites, sometimes deleting the arrays to create them again from scratch, and when I delete an array and recreate the dynamicsprites for my buttons, they get dynamicsprites from other arrays of my game... For really no reason.

The situation could be :

DynamicSprite *a[];
DynamicSprite *b[];

I create 10 dynamicsprites for *a, then 20 dynamicsprites for *b. Then, I delete *a, recreate 10 dynamicsprites for it, and make them normalgraphic for some buttons. And it seems, some buttons get some graphics from *b instead of *a...

I'm trying to find what's wrong in my code, and if I see more details, I'll report them here.

EDIT : Well, I think I have a clue... What happens when I delete a dynamicsprite, if a button had it as its normalgraphic ? Which value the button gets for its graphic ? It seems they take a value that is not -1 as I expected.

EDIT2 : seriously, I think there is a problem in how dynamic sprites are managed. It seems that deleting them when they are assigned to a button gives the button another graphic that is from other dynamicsprites. Really weird... I can't give a code for now because it would need too much time that I haven't got tonight, but as soon as I can...
#55
I don't know anything in coding for engine, but it may be a color value "ERASER" that if we use it, it clears the pixels under the surface and gives transparent pixels instead ?

Like :

Code: ags
DrawingSurface *d=mydynamicsprite.GetDrawingSurface();
d.DrawingColor=ERASE;
d.drawrectangle(0, 0, 100, 100);
d.Release();

=> will erase the pixels included in a rectangle in the middle of the dynamicsprite.
#56
Hi !

I'm just testing the new color system in AGS 4.0. I'm using AGS 4.00.00.14, and I don't know how to draw something transparent on a drawing surface ? Before the new system, I used DrawingColor=COLOR_TRANSPARENT, but it doesn't work now.

What I did before :

I draw an image on a dynamicsprite
Then I draw a transparent rectangle in the middle of that dynamicsprite
So that I can see "behind" this dynamicsprite in this rectangle (this dynamicsprite is used for a GUI's background, this GUI is like a "mask" for another GUI that appears in the transparent rectangle).

Here's my code :

Code: ags
fondexpedition=DynamicSprite.CreateFromExistingSprite(176); // 176=image's slot
    fondexpedition.Crop(0, 0, 1920, gBoutonsExpedition.Height); // Just adjust the image for the GUI's background
    DrawingSurface *dess=fondexpedition.GetDrawingSurface();
    dess.DrawingColor=COLOR_TRANSPARENT;
    dess.DrawRectangle(this.x, this.y, this.x+750, this.y+750); // rectangle in the middle
    dess.Release();
    gBoutonsExpedition.BackgroundGraphic=fondexpedition.Graphic;

As it, the result is the GUI's background is fully covered by the image, and there isn't the transparent zone in the middle. I think the new system makes that the transparent rectangle no longer erases the pixel where it's drawn, it's just that I put something transparent on the image, so I see the image again... It seems it worked differently in the old AGS 4.0 versions.

So should I code it another way ? Like drawing each side of the image separately, so I don't draw anything where I would have the transparent zone ?
#57
Hi @Crimson Wizard , I encounter a crash when launching the new version (not my game, but the editor) of AGS 4.0 (I can't launch it, everytime the same crash), here's what's displayed :

https://drive.google.com/file/d/1iNk0P9ZIMU9-EgFXNHexVFDCIpjn6ZWu/view?usp=sharing

What I wanted to verify with the last version of AGS is a bug I found in the previous version : it seems overlays have a problem. I use an overlay when I right click on a button to make it "selected", it's a dynamic sprite where I draw colored lines on a transparent background. When I was on AGS 3.6, it worked perfectly, but since I'm in 4.0, it's a weird thing : the Overlay seems to take for its graphic the last sprite that was created by the game. I managed to see that the overlay takes its graphic as intended, and suddenly I create a dynamicsprite from a file and the overlay takes the same graphic whereas the graphic of the overlay doesn't use the same sprite. The funniest moment was when I wrote "display" functions at soime points to have a look of what's happening, just after the overlay is created I wrote "Display("Oh ?");", so it pauses the game with the message displayed, and I saw the overlay's graphic changed into the graphic of the message (a white square, with black borders, and "Oh ?" written inside !). Really strange...

I'm sorry, I can't develop furthermore nor give a project to test it with my code because I don't have any time right now, but I swear I don't manipulate the same dynamicsprites during the code, all I do is creating a Overlay.Graphical on which I draw something, and it suddenly changes to another sprite that was just created (just like the Display function does).

Take this as a report, I will look deepier in the code if anything is wrong, but I swear in 3.6.1 it was working perfectly, perhaps things changed in overlays in 4.0 and something's broken ?

EDIT : about my overlay problem : it seems things have changed in 4.0, so I added the "true" parameter to clone the overlay's dynamicsprite that's used to make it, because the dynamicsprite was not saved out of the function. By the way, I don't know why sprite 0 was the last dynamicsprite created in script, because sprite 0 is existing in the sprites saved in editor (it's a blank square for me). Perhaps the problem is that overlay's graphic doesn't properly resets to sprite 0 in engine ?
#58
Hi Snarky, do you plan to update your module with crossplatform compatibility and UTF-8 strings ? It would help me a lot... But I know it's need of time and will to do that, so don't worry :)
#59
Oh, you mean you are trying to implement the alpha value directly in the number of the color ?

I'll wait for a stable update, don't worry, I'm not in a hurry :)
#60
Does it include the rotation fix for dynamicsprite too ?
SMF spam blocked by CleanTalk