Forum rules - please read before posting.

Boolean Dilemma

Hi,

just wondering if anyone can help me out.

I have a doorman. You have to give him three items to pass. The items can be given in any order.

There is a dialogue option to ask him what he STILL needs.

Is there a quick method to determine what he requires and then give the answer?

Also, is there a way of playing an the same object animation anytime in any scene. Do i make the object prefab?

Apologies in advance
Martyn

Comments

  • Is there a quick method to determine what he requires and then give the answer?

    Best to use 3 booleans - one for each item - that are set to True when an item is given to him. So "Given fish to doorman" would be False by default, then True when given a fish.

    In the dialogue response, you can then use the Variable: Check Action to work out if he asks for a fish etc or not. Each needed item could either be asked for in a separate speech line, or you could combine these checking Actions to work out what combination of items he needs with just one line, i.e. "I need a fish and a potato" if your "Given fish" and "Given potato" bools are both False.

    Unless you need to update/query these variables in another scene, these Variables can be Local (set in the Variables Manager) or Component (set on a Variables component attached to the NPC GameObject).

    Also, is there a way of playing an the same object animation anytime in any scene. Do i make the object prefab?

    Yes, make it a prefab. You could then have an ActionList asset that spawns it in (Object: Add or remove), plays an animation (Object: Animate), and then removes it again (Object: Add or remove).

  • Chris,

    Thanks bro.

    I guess I was wondering if there was a Boolean operator I could just plug in. The actionlists editor gets pretty messy.

    m

  • While you're still best off with 3 separate Booleans defined, it's possible to write a custom Action that checks for all 3 values at once.

  • ah yes this was what i was after, thanks

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.