Indiana Jones and the seven cities of gold development team proudly presents :
AGS Breakpoints
(a.k.a. "DisplayGUI" module)(https://78.media.tumblr.com/b14f10504c258316c36ae927c6f37918/tumblr_oxkjc4iCKl1tsfksfo1_540.png) (https://www.youtube.com/watch?v=Ww0n18qlsKQ&feature=youtu.be)
Click on image to watch videoWhat does it do?In a nutshell :
- 100% blocking interactive GUI in any script (well, any script where you could normally use function "Display")
- Easily watch variables' values anywhere in your script, like a real breakpoint (and in future version : edit them)
In detail :
- Watch the video above (url : www.youtube.com/watch?v=Ww0n18qlsKQ&feature=youtu.be (https://www.youtube.com/watch?v=Ww0n18qlsKQ&feature=youtu.be) ) or read this :
- AGS is a very cool engine, but one of its downsides is that it has no real useful breakpoints. Breakpoints can pause the game (hurray!) but you can't watch the variables values, so the Breakpoints are mostly useful to check that your script goes nto a specific code branch (if...then...) but it won't help you debug a complex code with values changing everywhere.
- Until now, your only solution was to use the "Display" function, but it was really a pain in the neck when you want to display several variables at once (you'd need to write a different "String.Format..." for every occasion). You could use a GUI, but since the whole point of this is to entirely "pause" the game (GUIs included) then the GUIs would be disabled (therefore becoming non-interactive).
Well now you have a way to entirely pause the game anywhere in the script AND still be able to click around and benefit of useful features. This makes it much closer to a regular "watch" as seen in Visual Studio and others
How to setup:Basic use setup:1) import the
DisplayGUI module,
2) import the modified
Font0 provided in the demo game (you can simply swap the files in your game folder. Fear not! It only modifies the first 20-or-so characters in the font, which should be harmless since they are very rarely used by anyone. If you need those, you can modify the ascii codes in the module and you can quickmy edit the font using Rulaman's "
TtfWfnSci" tool (you can find a link here (http://www.adventuregamestudio.co.uk/wiki/Fonts#Making_bitmap_fonts_based_off_a_TTF_font)).
3) Import the sprite that represents a small 3x*3px red square, that you may export from the demo game in the "displayGUI" sprites folder
4) Make sure that mouse mode "userMode1" uses this sprite as cursor
5) Before you call any instructions of the module, call "DisplayGUI.Init(myFont)" where myFont is the font that you just swapped
Advanced use setup:1) Get the original
"UltraVariables" module by SSH (http://www.adventuregamestudio.co.uk/forums/index.php?topic=29409.0), or export the one present in the module's Demo Game.
2) Check the DisplayGUI's header to see what custom instructions you need to add to the Ultravariables module. There are only two : One export instruction, and one export instruction.
How to use:Basic usage: (no Ultravariables)1) Don't forget to call
DisplayGUI.Init(...) before anything
2) To display a Yes/No popup window, do as follows :
YesNoResult result = DisplayGUI.ShowYesNo("line of text 1", "line of text 2");
if (result==eDisplayGUI_Yes)
Display("player clicked YES");
else
Display("player clicked NO or exited the popup (by pressing ESCAPE or right-clicking)");
3) To display the Watch interface :
//Obviously, myVariable must exist. Oh, and it does "int" only, sorry!
BREAKPOINT("myVariable name", myVariable);
//You can watch up to 7 variables, and only 5 can be displayed simultaneously
//(but you can see the others if you enter their name in the interface)
BREAKPOINT("myVariable1 name", myVariable1, "myVariable2", myVariable2 /*, up to 7 */);
Advanced usage: (with Ultravariables)1) make sure you have followed the setup instructions above
2) Set and get the value of any variable like this :
SET("myVariable", 7);
int value = GET("myVariable");
3) Display them at will in your Watch interface by typing their name whenever you want.
4) Careful though! These variables are GLOBAL variables by design. In other words : There's only one ultraVariable with the same name in the entire game.
License:Free to use for any purpose whatsoever, provided you credit us in your game credits (if any ;) ). Don't forget to credit SSH too for his UltraVariables module.
=====================================================================
Version 1.1 : Added simple graphic theme (because prettier things are more attractive)
Pro : prettier
Con : makes the popup blink because AGS function "DisplayTopBar" doesn't behave the same way as "Display". I would suggest: use the theme for Yes/No popup, but not for the Watch interface.
(https://78.media.tumblr.com/e5f730a2d63282b6c524f68413d9a13d/tumblr_oxmcuyAFWO1tsfksfo1_540.png)
>> DOWNLOAD << (https://www.dropbox.com/s/pciz23xi52dqenh/AGS%20Breakpoints%201.1.zip?dl=0)