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

#1
I want to make it so that cPlayer has to have had looked at an object, oHouse, before dKing2 happens.

I know what I would write if dKing2 was enabled by a dialogue option from another dialogue:
Code: ags

Function cKing_Interact
{
if (dTroll.HasOptionBeenChosen(1))
{dKing2.Start();
}
else {dKing1.Start();}
}


So for necessary dialogues, I would need
"dTroll.HasOptionBeenChosen(number)".

And for necessary inventory items, I would need
"Player.HasInventory(iFootball)".

But what do I need to write if I want dKing2 to happen after cPlayer has looked at an object?

I haven't been able to find the answer in the manual, unlike the other two "conditions" I've mentioned here.

I searched the forums and found someone writing "(UsedAction (A_LOOK_AT))" but it didn't work for me and it was only written once on this forum.
#2
I have bumped into a problem with enabling different dialogues depending on what the player has done before.

What I've written looks something like this:

Code: ags

function cMan_Interact()
{
  if (dWoman1.HasOptionBeenChosen(3))
  {
  dMan2.Start();
  }
    else if (dSnake1.HasOptionBeenChosen(1))
  {
    dMan3.Start();
    }
    else if (dSnake.HasOptionBeenChosen(2))
    {
      dMan4.Start();
    }
    else {dMan.Start();}
}


This script works well for having cMan change from dMan1 to dMan2 if the player has talked to cWoman.

However, while I can run the game without any error notification, the player is unable to get the dMan3 dialogue, which is the dialogue that I want to have activated after dSnake1.

I assume that the problem is that the script "thinks" something like this:

"The player has had dWoman1, therefore dMan2 will forever be the dialogue that the player has with cMan."

How do I change my script so that dSnake1 will enable dMan3 and disable dMan2?
SMF spam blocked by CleanTalk