Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - dark1981

#1
Quote from: Khris on Mon 06/05/2019 12:52:39
You can also use  Game.DoOnceOnly(unique_string)  for this:

Code: ags
  if (HasPlayerBeenInRoom(3) && player.PreviousRoom == 4) {
    if (Game.DoOnceOnly("was in 3, entered from 4")) Display("The message to show.");
  }


Wow! It works and is more elegant! Thank you very much. There are a lot of "prefabricated" commands that I still do not know :)
#2
Ok, I tried this and it works!

Room1:
Code: ags

bool messagestage1 = true;

function room_AfterFadeIn()
{

if (HasPlayerBeenInRoom(3) && player.PreviousRoom == 4 && messagestage1 == true) 
{
  Display ("The message to show.");
  messagestage1 = false;
}
}


Because I need the message to not be displayed every time the player crosses from 4 to 1.

Thank you to everyone, your answers guided me good!
#3
I tried several ways to get this, but they didn't work:

I have the following rooms, starting at room 1:

3
|
2
|
1 - 4

I need a text to be displayed (Display format and only once) when you goes from the room 4 to the room 1 but only if you have visited room 3.

I know that it sholud be easy, but a don't get it. I deleted all the code related, so I can't not show what I'm trying, sorry  :-[

Any clue?
SMF spam blocked by CleanTalk