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

Topics - Adasiek

#1
Hello Guys, I have a beginner question.

I'd like the player to interact with a door only once.
But whenever I do it, my character just does the actions in one big row,
ignoring the if conditions. Instead of two separate actions, the player character does it this way:
1.she knocks, 2.she has a little dialogue with Jin, 3.she says "I already did that".
And the point 3 should have happened only if the player tried for the second time

I have a global value Knocked, initial value is 0.

The funny thing is, I did very same set of conditions for other thing, and it worked.
Please guys, what am I doing wrong?

function Door_Interact()
{
  if (Knocked == 0)
  {
Knocked = 1;
player.Walk(405, 310,  eBlock);
aKnock.Play();
Display("Knock knock");
player.Say("Guess she is not there");
cJin.Say("I bet she's still asleep. You know she never leaves this place sis");
  }
  if (Knocked == 1) 
player.Walk(405, 310,  eBlock);
player.Think("I already did try that");
}

I tried as well this way, but with same effect:

function Door_Interact()
{
  if (Knocked == 0)
  {
Knocked = 1;
player.Walk(405, 310,  eBlock);
aKnock.Play();
Display("Knock knock");
player.Say("Guess she is not there");
cJin.Say("I bet she's still asleep. You know she never leaves this place sis");
  }
  if (Knocked == 1) 
{
player.Walk(405, 310,  eBlock);
player.Think("I already did try that");
}
}

Cheers
Adam
SMF spam blocked by CleanTalk