Higher resolution/more text in the 'gui debug' and a general debug question

Started by AndreasBlack, Mon 17/03/2025 07:53:37

Previous topic - Next topic

AndreasBlack

I'm trying to change the font size (searching in the manual) can't find it. There's no reason for AGS to give me two or three messages of display with coordinates of all objects when it could easily fit in one display message if only i knew how to change font size or perhaps change the font the basic 'AGS display' is using.

At least i've found how to get a "custom gui" in general settings, that's one step forward (laugh), but then again i can't seem to find Gui.font Gui.setfont, gui.changefont, seems like no such syntax exists. Most likely i'm just blind. :-D
 
Another question is. Let's pretend this doesn't work. How do i create the same function as the ctrl + d debug is using and displaying it on a custom windows instead. I can't seem to find how to display all objects positions in a room via the manual. I've searched object getobject, object.getposition, etc. All i've seen is get object where it's currently at.  Thanks!

Crimson Wizard

Quote from: AndreasBlack on Mon 17/03/2025 07:53:37I'm trying to change the font size (searching in the manual) can't find it. There's no reason for AGS to give me two or three messages of display with coordinates of all objects when it could easily fit in one display message if only i knew how to change font size or perhaps change the font the basic 'AGS display' is using.

AGS does not let change the existing font size, but it lets to import same font with the different size as another font. This refers to TTF fonts of course, as bitmap fonts don't have such ability, they may only be scaled up using "Size multiplier" property.

Basic Display message box uses Game.NormalFont. Speech uses Game.SpeechFont.
https://adventuregamestudio.github.io/ags-manual/Game.html#gamenormalfont
https://adventuregamestudio.github.io/ags-manual/Game.html#gamespeechfont

GUIs themselves don't have "font". Text window guis use the font associated with the type of message (standard message or speech). Normal GUIs can have Labels and other textual controls (buttons, list boxes) on them, which do have a font selection.

Another option is to use DrawingSurface, which can draw text on a sprite, and that sprite may then be used on any object, such as overlay image or gui background graphic.

At last, but not least, there's System.Log command that prints to the log rather than displaying text in game.
The log is written to the file (on Windows it's located in "%USERPROFILE%/Saved Games/Adventure Game Studio" for historical reasons), but may be also viewed during game testing in the Log Panel of the Editor (https://adventuregamestudio.github.io/ags-manual/EditorLogPanel.html). Log Panel is enabled in Window menu.


Quote from: AndreasBlack on Mon 17/03/2025 07:53:37How do i create the same function as the ctrl + d debug is using and displaying it on a custom windows instead. I can't seem to find how to display all objects positions in a room via the manual. I've searched object getobject, object.getposition, etc. All i've seen is get object where it's currently at.

There's a global array for each type of objects in AGS, except ones created dynamically.
https://adventuregamestudio.github.io/ags-manual/GlobalArrays.html

You may iterate all objects in a loop and print their information.
Code: ags
String all_info;
for (int i = 0; i < Room.ObjectCount; i++)
{
    all_info = all_info.Append("Object %d is at %d,%d\n", i, object[i].X, object[i].Y);
}

AndreasBlack

it's complaining about a parameter missing  ???
Tried it with Display instead tho and that worked, but would be nice to learn "new tricks" so please fill in the missing piece :-D While we're at it. I'm trying to get the values for the player tint now aswell. I've set up a basic gui where i change around the values. Would be nice to be able to push a button and see where the settings are at "now".


Crimson Wizard

Quote from: AndreasBlack on Tue 18/03/2025 12:28:59it's complaining about a parameter missing  ???

I skipped String.Format:

Code: ags
all_info = all_info.Append(String.Format("Object %d is at %d,%d\n", i, object[i].X, object[i].Y));

Quote from: AndreasBlack on Tue 18/03/2025 12:28:59I'm trying to get the values for the player tint now aswell. I've set up a basic gui where i change around the values. Would be nice to be able to push a button and see where the settings are at "now".

There is a group of Character properties related to its tint like TintBlue, TintRed, etc:
https://adventuregamestudio.github.io/ags-manual/Character.html#charactertintblue
they are used to read current tint values.

Khris

Please always (always) post the code you're using, not just the error message. A missing parameter is one of the easiest problems to solve by far, so why drag this out? Just post the command you're using in the post you're writing. Like when you describe the error, why not also put the line into the post that caused the error? Because if we can see the line, we can fix it in the reply, instead of having to ask for you to also post the command you used. Less wasted time for everybody who reads or posts here, if you simply copy and paste the command you've used in the post you're writing. It takes a few seconds but saves so much precious time.

AndreasBlack

Quote from: Khris on Tue 18/03/2025 12:36:23Please always (always) post the code you're using, not just the error message. It takes a few seconds but saves so much precious time.

I didn't write the code myself, so why should i repost it, but i get your point. He knew his own code already and i was certain he would reply again fast since he's a "Wizard" after all. ;)

I'll definately will make up for your wasted time tho in the future (nod) You will like the new version 100% sure. Unlimited colors and lots of special case animations with sound effects. I'll bet to say it's the most advanced AGS demo room of all time. So much things that could "go wrong" code wise, but i've finally nailed it.  Plus, your comment about how the game was pretty much impossible to you is now readable if you click the "Mushroom Toy" various times until it launches. I did end up having it as an "optional nightmare puzzle". Since it's the first room, why potentially frustrate the player instantly? Just stupid, so your playtesting was vital in that regard! Unless the player wants to get frustrated that is, he or she can engage in the nightmare freely. Thanks for your willingness to help as always!


AndreasBlack

Quote from: Khris on Tue 18/03/2025 12:36:23Please always (always) post the code you're using, not just the error message. It takes a few seconds but saves so much precious time.

I didn't write the code myself, so why should i repost it, but i get your point. He knew his own code already and i was certain he would reply again fast since he's a "Wizard" after all. ;)

I'll definately will make up for your wasted time tho in the future (nod) You will like the new version 100% sure. Unlimited colors and lots of special case animations with sound effects. I'll bet to say it's the most advanced AGS demo room of all time. So much things that could "go wrong" code wise, but i've finally nailed it.  Plus, your comment about how the game was pretty much impossible to you is now readable if you click the "Mushroom Toy" various times until it launches. I did end up having it as an "optional nightmare puzzle". Since it's the first room, why potentially frustrate the player instantly? Just stupid, so your playtesting was vital in that regard! Unless the player wants to get frustrated that is, he or she can engage in the nightmare freely. Thanks for your willingness to help as always!



SMF spam blocked by CleanTalk