Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: PERXEO on Fri 31/03/2023 06:48:09

Title: Where are Global Messages located? (SOLVED)
Post by: PERXEO on Fri 31/03/2023 06:48:09
Hello! I am analyzing and studying some open games line by line, which I have found in the list provided by Crimson Wizard (Thanks), and I am seeing, in the Quest demo, that the expressions DisplayMessage(NUMBER), where number is > 500, are repeated a lot. I have seen in the manual that numbers greater than 500 represent global messages, but I don't know where these global messages are stored and I can't find them throughout the game. Where are these global messages? Thank you!!
Title: Re: Where are Global Messages located?
Post by: Snarky on Fri 31/03/2023 07:17:27
Global Messages have not been supported ever since AGS 3.0, 15 years ago. (The functions to display them are still there, but there is no way to view or edit them.) See this thread: https://www.adventuregamestudio.co.uk/forums/beginners-technical-questions/global-message-solved
Title: Re: Where are Global Messages located?
Post by: Crimson Wizard on Fri 31/03/2023 07:38:15
We also have this list of obsolete script commands, with suggested replacements, it may also be useful when working with old projects:
https://adventuregamestudio.github.io/ags-manual/ObsoleteScriptAPI.html
Title: Re: Where are Global Messages located?
Post by: PERXEO on Fri 31/03/2023 07:59:49
I am a newbie in this and certain things still cost me, but I am gradually understanding it. Thank you!!
Title: Re: Where are Global Messages located?
Post by: PERXEO on Fri 31/03/2023 08:23:40
In order to solve this issue....
I have created a variable in the global variables editor. I have configured it like this:
Name > LookKey
Type > String
Initial Value > It's a red Key
Now, I would like to know how I replace this obsolete sentence
DisplayMessage(500);
by something like this:
Display("%d", LookKey);
to see the content or string of this variable and that "It's a red key" appears on the display. Thanks!!!
Title: Re: Where are Global Messages located?
Post by: Crimson Wizard on Fri 31/03/2023 08:37:28
In this particular case you don't need to use global variables at all, you may just do
Code (ags) Select
Display("It's a red key");
Title: Re: Where are Global Messages located?
Post by: PERXEO on Fri 31/03/2023 08:44:01
Quote from: Crimson Wizard on Fri 31/03/2023 08:37:28In this particular case you don't need to use global variables at all, you may just do
Code (ags) Select
Display("It's a red key");
THANKS!!
Title: Re: Where are Global Messages located?
Post by: Crimson Wizard on Fri 31/03/2023 09:09:39
But, since this also may be useful in other situations, the String variables may be printed like:

Code (ags) Select
Display(LookKey);

Or, using "formatting":
Code (ags) Select
Display("%s", LookKey);
notice the %s command, it means "put string there".

More about formatting:
https://adventuregamestudio.github.io/ags-manual/StringFormats.html
Title: Re: Where are Global Messages located?
Post by: Khris on Fri 31/03/2023 09:26:03
You should stop looking at the game that uses these old commands right now. It'll only confuse you and lead to a bunch of threads about obsolete stuff like this.

Also keep in mind that just because somebody has open-sourced their game does not mean they wrote code that is particularly good. They could've been using AGS for 20 years and use obsolete stuff a lot.

The best way to learn AGS imo is to 1) do the tutorial in the manual 2) read the scripting API section from top to bottom (multiple times) 3) browse the beginner's technical forum for interesting questions.
Title: Re: Where are Global Messages located?
Post by: PERXEO on Fri 31/03/2023 13:39:17
Thanks for all!!