Forum rules - please read before posting.

ActionList help with NPC rejecting and accepting items

Hello, I’ve got an ActionList problem that’s been giving me trouble for 3 days. Any help is much appreciated!

I’ve got a scene where an NPC (named Poppa) is working on a machine. There are 2 gears on ground next to him. The sprites are labeled “Gear1_sprite_0” & “Gear2_sprite_0” but other than that they are identical. Both are named “Gear” in their hotspot labels.

When the player clicks on Poppa he says “hand me that gear, will you…?”

The player can pick up either Gear1 or Gear2, or both. It doesn’t matter. They get added to the inventory. So far I'm ok, but here's where I'm getting lost and what I'd like to happen next:

The player can give Poppa either Gear1 or Gear2. It doesn’t matter which one they try to give him, but I want him to reject the first gear with a dialogue of “no no no. The other one. The… round one.”

Then Poppa will accept the second gear and respond with a dialogue of “thanks, now hand me the other one…”

He’ll then accept the original gear that he rejected with a dialogue of something like “thanks for the gears!”

So to summarize, the flow is this:

Poppa asks for a gear “hand me a gear”

The player tries to hand him a gear (either Gear1 or Gear2, it doesn’t matter)

Poppa rejects the first offered gear “no no… the other one…”

Poppa accepts only the opposite gear (ex: Player offers Gear1 first, Poppa rejects it and accepts only Gear2. OR Player offers Gear2 first, Poppa rejects it and accepts only Gear1) responds with “Thanks, now hand me the other one…”

Poppa now accepts the first gear that he initially rejected. “Thank for the gears!”

I’ve tried setting this up with global variables and actionlists with parameters, but I’ve gotten lost and need a clear workflow.

Thanks so much!

Comments

  • Start by creating a Local PopUp variable to keep track of the puzzle's progress. Give it the values:

    • Not asked
    • Asked (Combine this with above if the Player can give gears before speaking to him)
    • Tried gear A
    • Given gear B
    • Given gear A

    Here, "Gear A" / "Gear B" represent the order of gears that he accepts - so which one is which will depend on which one the player attempts to give him first. To keep track of this, create another Local variable - this time Boolean - called "Gear 1 is A". These two variables should then be enough to keep track of the necessary logic.

    You can then create a pair of Inventory interactions on the NPC (one for each gear). Begin each with a Variable: Pop-up switch Action, referencing the one above, so that you can run different logic based on the state of the puzzle.

    For example, if the state is "Asked" (as set when Talking to him while "Not Asked"), set "Gear 1 is A" to True in the Gear 1 interaction, and False in Gear 2, then set the PopUp to "Tried gear A".

    The rest of the logic should flow from there. The two interactions would end up looking similar (just different variable values / inventory references), which you could conceivably combine into a single list using parameters. Stick with two separate lists for now, though, and consider that only once things work doing it "the long way".

  • Thank you so much! This is clear and helpful. I was getting lost in the circular logic of it and this is much appreciated!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.