Two way

Started by Flyman, Fri 03/02/2012 14:07:21

Previous topic - Next topic

Flyman

Hi,
I've a problem!!
I've decided that before player from room (0) enter in a room (1) start a cutscene. After  when player return in room (0) and he enter again in room (1) i'will that cutscene not start.
I've used "Game.DoOnceOnly", but don't work!!
What's wrong in code:
{
if (UsedAction (A_WALK_TO)) {
  if (MovePlayer (244, 90)) {
    if (Game.DoOnceOnly("cutsceneinside")) {
    FaceDirection (GetPlayerCharacter (), DIR_UP);
    Wait(5);
    EnterRoom (28, 354, 134, DIR_DOWN);
     }
 
}
    else {
    if (UsedAction (A_WALK_TO)) {
    if (MovePlayer (244, 90)) {
    EnterRoom (30, 59, 134, DIR_DOWN);
    FaceDirection (GetPlayerCharacter(), DIR_RIGHT);
    }
    }
}
}

Ghost

Since you want the cutscene to start when the player ENTERS A ROOM, use this instead:
Create a "After Fade-In" event for Room1 (or whatever room must trigger your cutscene, then:

Code: ags

function room_AfterFadeIn()
{
	if (Game.DoOnceOnly("Enter this room")
		//RUN CUTSCENE
}

Flyman

How can set for the object (in this case the door), a first time and a after fade in??
I don't know but I've see that is true only for player event...I ask me because the code I'm write not work, only the first event work but after the game block!

Khris

You need to get your code logic straight:

Code: ags

  if (UsedAction(A_WALK_TO)) {
    if (MovePlayer(244, 90)) {
      FaceDirection(player.ID, DIR_UP);
      Wait(5);
      if (Game.DoOnceOnly("cutsceneinside")) {
        EnterRoom (28, 354, 134, DIR_DOWN);
      }
      else {
        EnterRoom (30, 59, 134, DIR_DOWN);
      }
    }
  }


And your indentation.

Flyman

Great!! Thanks Chris  8)

SMF spam blocked by CleanTalk