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

#1
Hi,

Small issue concerning TextProperties : for hotspots, if I use the 'é' letter, after closing the editor and relaunch it, the letter is not normally displayed in game (nor in the editor in fact). Seems to be a formating issue.

#2
Quote from: Crimson Wizard on Tue 05/08/2025 16:58:51On another hand, the Button's rectangle is not defined by the image. It's defined by Width and Height properties. When you assign an image to the button, the button will resize itself to match the Image. But if you later modify Width or Height, then the button's rectangle will not match its image anymore, and it may look like you are clicking through the sprite.

Understood, and it should not be this the problem, because they are set at 40*40 pixels in the editor, and they get a new sprite during the game that is 40*40 too.

I just send you my game's project by MP. That way you can test it properly and see. I give you instructions in MP to "meet" the bug :)


Quote from: Crimson Wizard on Tue 05/08/2025 16:58:51The function prototype that you cite looks wrong. You have "MouseButton *button", but it should be "MouseButton button" with no asteriks. Is that a typo in your script, or in your post?

Sorry it was a typo in my post...
#3
OK So I just encounter the "mouseclick goes under the control to click the control paced under it" bug randomly again. I think it's because of "Perfect Click" option (that is enabled in my game). I can't explain why it could be another reason.

The fact is this bug appeared in AGS 4.0 (wasn't there when using 3.6.1).

So here the sprite of the first button (the one I want to click on, but when the bug occurs, the click goes on another control placed under this one).

https://drive.google.com/file/d/1CVkZ3_x0qJwlQDqlx74Gf2Hh2xRUyqwQ/view?usp=drive_link

Perhaps there are invisible pixels there ? But it shouldn't, because it's a full grey square on which I placed the blue skull. But as it has been resized very small... Perhaps something happenned. Or Perfect Click option is a bit broken in AGS 4.0 (or too perfect ?!).

Here is the sprite of the control paced under :

https://drive.google.com/file/d/1ovEXNm_itsCPR-4qGJ0qtlc3g5-Fshvs/view?usp=drive_link

If @Crimson Wizard you could test it on your side and tell me if you encounter the same thing, it could be great !

Also I encounter the same problem with other buttons, sometimes the click doesn't proceed, and if I move the mouse a bit, it works. I have to mention that the bug occurs not every time, it seems to depend on mouse's position.

Example of a button that sometimes I can't click on (depending on where the mouse is) :

https://drive.google.com/file/d/1HGtP-GpAy11YceXJHGpZ5lgpGitU91M1/view?usp=drive_link

Not sure, but for now, it only occurs on small buttons.

EDIT :
Also I have to mention a small issue in editor : some controls have their On_Click function called "FonctionFouille(GUIControl *control, MouseButton *button)". If I double click on one of these controls, the editor doesn't find the function in the global script, and creates a new one at the end. Even if the function already exists with the same name. Perhaps because there is no "On_Click" on the name ? I wanted to remove it to have it shorter, I don't know if it's a problem.
#4
Found a bug : when changing the sprite of several buttons at the same time within the GUI Editor, only the "selected" one (the one with the red squares) got its height and width adjusted. The  others change their graphic but keep their old width and height.

Last AGS 4.0 build
#5
OK, just to be sure :

- I just set a CustomProperty for GUIControls, as a text type, called "Description".

- in script I use
Code: ags
GUIControl *bouton=GUICOntrol.GetAtScreen(mouse.x, mouse.y);
String s=bouton.GetProperty(Description);

The editor doesn't launch the game, saying "Cannot assign a type 'int' value to a type 'String' variable".

Is it a problem in AGS 4.0 ?

EDIT : nevermind, sorry, I didn't use the right function... Need to use GetTextPRoperty instead.
#6
My apologizes, I didn't know Custom properties were added to GUICOntrols !! That's a great thing :)

About the cursor, it disappears just before transition (in my code) but don't reappear after the transition (even if in my script the cursor is set to visible).

If I don't spam a Display function after transition, the cursor becomes visible. If I put a Display Function, the cursor stays non-visible until I re-set it to visible after. I will test again that thing to give you more informations, but something is wrong here, and it doesn't seem to be my code.
#7
OK, I will try some debugging and if I don't find the problem I will send you my game and instructions to find the bug.

"Why is this an issue to make one in script, and which "fps loss" are you speaking of?"
=> It's not an issue, I can make it by script, just I wanted to ask if it was going to be done in AGS :)

"I cannot reproduce this. Tried with default Sierra template, and "show usage" for sprite lists buttons that use that sprite. Please clarify the situation: which buttons is this sprite used on, and which exactly button properties is it assigned to?"
=> It was for a normal graphic of a button. Perhaps I'm pretty sure it happenned ! Will have a look if it happen again :)

New issue I encountered : if I use Display function during a Room Transition, the mouse disappears (is not visible but usable). Room Transition is set to CrossFade wen it happens.
#8
Hi there !

A few things :

- I can't explain why, but in some cases, I encounter a weird thing : when several buttons (2 or three in my case) are one on another, the mouse click doesn't seem to apply to the upper one (the one with the higher ZOrder). I'm using the last AGS 4.0 build, and it was not doing this in 3.6 that I used before. It is something similar that I reported before, with OnCLick functions switching between HotSpots/Buttons with no reason, but this last thing I don't encounter anymore.

- Is it planned to have a natively built-in system of "description" for GUIControls ? Like, the mouse goes over the control, and a text (usually the description of what it's going to do) appear near the mouse. Just like in windows. It could be very practical, and if built-in, it could be without fps loss.

- I tried the "show usage" function by right clicking in a sprite in the sprite tab, I knew it was used for a button in a GUI but it said that it wasn't used by anything. Is there something broken in AGS 4.0 regarding that ?
#9
OK I understand ! I thought Fonts were scaled according to their size, the glyphs being vectorized. I was wrong !

So perhaps I can try something in my script as a workaround :

- create an enum with all iteration of one font (so TimeNewRomans 10, TimeNewRomans 15, TimeNewRomans 20 etc... for example), from the smallest to the biggest

- change the translation

- verify each button/label/whatever that has text inside : while text.Width > object's size, object.font-- (using the enum) OR while text.Width < my_minimum_I_defined, object.font++

It could take some time to proceed, but could work I presume.

Another thing I just thought about : possibility for buttons having their text displayed on several lines (same way as labels) ?
#10
Quote from: Crimson Wizard on Thu 17/07/2025 17:45:51In the latest AGS 4 you can import only 1 font file and create any number of fonts from it, each with different settings. Is that what you are referring to?

Well I was thinking about :

- importing a font file
- create a button
- give this button the font you just imported
- choose the size of the font for THIS button (and eventually its style if possible)
- allow to manipulate font's property for each button or things using texts (labels etc...), such as the font's size, dynamically in scripts. My best example for it is about translations : if you have a button with the text "ABCD" inside, and when you change translation the texts becomes "ABCDEFGHIJ", the button could be too small to have the text properly inside, so you could just change the font's size to fit the text there.
#11
Encountered something that seems a problem : while running my game through the editor, I double clicked on a listbox that had no onclick function related, and while editor was displaying an error message saying "you can't modify the script while the game is running", a new onclick function appeared in my global script, related to that listbox.

Not a BIG problem, even if then, when I closed the game, and tried to save my project, it said "the global script has been modified externally, do you want to reload it ?". It didn't damage anything. Perhaps it's just a thing that should be reworked so the script is really locked while the editor launches the game ?

Last thing, about fonts : is it planned to be able to just import 1 font, and manipulate that font in the editor and in the game too using scripts ? Like changing its size, perhaps its style too (bold, italic etc...). It could be so convenient... But perhaps it's too complicate for now to have things working like that.

EDIT : sorry I forgot to say I'm using the last build (4.00.00.18)
#12
Hi Crimson,

Thanks a lot for your long answer !

I better understand how it could work. And perhaps it's going to be very long and hard to do.

By the way, it's not impossible. I just wander if AGS is strong enough to make that kind of thing working nicely, because it should be CPU intensive ?
#13
Hi,

I would like to ask how it would be difficult to (re)make a game in the mood of the Heroes of Might and Magic, using AGS ?

The two things I think about would be :

- create the IA : how the bot thinks, acts etc... for solo vs computer games. I believe IA is a lot of conditions leading to a choice (if/else priority leading to the best choice). I presume it could be very long and hard to code it in AGS ? It would require some knowledge...

- calculate the path for a character when he is moving. I want him to go there, there is the terrain grid, somewhere it needs more cost for movement, somewhere it costs less, but how calculate these kind of things smoothly and "instantly" ?

So, I'm not asking for volunteers to make it for me, just for interest to how these kind of things works (and perhaps, for motivation to make it !)
#14
I didn't encounter the buttons' bug with your last build ! Do you really need my game so ?
#15
So, I just tried with the last link you sent me, and now, it seems working with the buttons !

I will test deeper soon, but I didn't encounter the problem for the 2 minutes I just tested.
#16
So should I try your last build first ?
#17
Is there anything that changed regarding mouse clicks ? It seems it doesn't click very well where my mouse points...

EDIT : because, now, I have to click upper from some buttons (not all !!!) to call their OnClick function. Weird !!

EDIT 2 : OK, it seems this temp build you sent me messes up with call functions. What happened is that clicking on some buttons that DON't HAVE onclick functions in editor calls the onclick functions of OTHER BUTTONS which don't react when I click on them.
#18
Oh yeah, I was using a Crossfade !
#19
Thanks for the answer !

But I didn't make any screenshot... From what I investigated, it happenned during a player.ChangeRoom function.

Let me know if it's an already known bug ? Will try your last build !
#20
Understood ;)

I encounter a crash with no idea what's the problem. I'm using the last version of AGS4 downloaded on the first page of this thread.

The message says :
(Engine version 4.0.0.17)
Error : GetRenderTargetData failed

Any idea ?
SMF spam blocked by CleanTalk