Where are Global Messages located? (SOLVED)

Started by PERXEO, Fri 31/03/2023 06:48:09

Previous topic - Next topic

PERXEO

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

Snarky

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

Crimson Wizard

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

PERXEO

I am a newbie in this and certain things still cost me, but I am gradually understanding it. Thank you!!

PERXEO

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

Crimson Wizard

In this particular case you don't need to use global variables at all, you may just do
Code: ags
Display("It's a red key");

PERXEO

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
Display("It's a red key");
THANKS!!

Crimson Wizard

But, since this also may be useful in other situations, the String variables may be printed like:

Code: ags
Display(LookKey);

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

More about formatting:
https://adventuregamestudio.github.io/ags-manual/StringFormats.html

Khris

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.


SMF spam blocked by CleanTalk