|
Post by dreamcastpast on Dec 30, 2016 19:00:07 GMT
Hi all,
I'm new here, I'm working on a game after following the video tutorials from Paul Jenkinson which I discovered this month. I have created the game in AGD 3.0 (I didn't realise there was any newer versions otherwise I would have created it in 4.6).
Basically, I want to bring up a message on certain screens only (to create my own tutorial for the game) which I only want displaying at designated rooms/screens.
So, I know how to display a message. For example, message 4 on screen/room 2;
IF SCREEN = 2 LET LINE = 0 LET COLUMN = 2 MESSAGE 4 ENDIF
All good so far. The text for message 4 is displayed at the top of the screen. BUT, when I leave screen 2 and move onto screen 3 or back to screen 1 the message remains. How do I only display message 4 on screen 2, stopping it from appearing on any other screen?
Thanks!
|
|
|
Post by alessandro on Dec 30, 2016 22:23:20 GMT
You must define an empty text message and overwrite the previous one. And because AGD seems to have trouble understanding the empty space as a character, it is advisable to define a symbol in the font editor, for instance #, as an empty space by blanking it out, so that a string like "##########" ends up being printed as a message made up of 10 blank spaces.
For example, if message 1 reads:
EVERYTHING IS OK
and message 2 reads (provided you have blanked the character '#' out in the font editor):
############################## (i.e. 30 blank spaces)
you can print message 1 at position 0,2 when the main sprite is in screen 2, and delete the message when the sprite enters, say, screen 3, with the following syntax:
IF SCREEN = 2
LET LINE 0
LET COLUMN 2
MESSAGE 1
ENDIF
IF SCREEN = 3
LET LINE 0
LET COLUMN 2
MESSAGE 2
ENDIF
If you want to display a different message take care to cover the whole length of the screen with blank spaces, otherwise portions of the previous message will stilly be displayed. Let's follow the example above and suppose that when entering screen 3 you should warn the player from an incoming danger. You will then define message 3 as follows:
BEWARE!#########
If you do not put those blank spaces after the text, the new message will partially overlap with the old one and this will be displayed:
BEWARE!ING IS OK
|
|
|
Post by dreamcastpast on Dec 31, 2016 11:28:42 GMT
My messages are now behaving as I wanted them to!! Thanks Allesandro for taking the time to help me out here, much appreciated
|
|
|
Post by alessandro on Dec 31, 2016 19:06:38 GMT
You are welcome mate Happy new year!
|
|