Forum rules - please read before posting.

I dont know how to make this puzzle

I have 3 objects that are being activated- manually by the player, one by one. When all 3 objects are activated I want to run an actionlist... I have set up everything but dont know how to tell the actionlist to run. 

Comments

  • edited July 2016
    It's 4:00am here, so I'm kinda tired, but I'll give you some ideas before I go to bed. First, every time you need the game to "remember" something, your best bet are Variables. If that data needs to be remembered only in one scene/Location, you are safe using Local variables. If the data needs to be remembered anywhere, no matter the scene, then you should use Global variables.

    In this case, you'd probably want to make 3 Local variables, one per object (or well, you could make only one which counts "successes" too, it's up to you). Then every time the player activates one of the items, go ahead and change the value of the corresponding variable. i.e.: when the player uses the hotspot on item 1 and activates that item, you use variable: Set to update the variable ItemOneActive. Once the 3 variables are set to true (or once you count successes to 3, if you are using a single var), then you go to the next part.     

    For activating the "Resulting" action list, you have two options: You can either have each the item's actionlist (or cutscene if it's in the hierarchy) verify if the player already activated the other two items (checking the data of the variable(s) you made). If all three checks result true, use the Actionlist: Run action. By the way, those would be actions you'd put right after "activating" an item (and updating the variable). 

    Your other options is to run a loop. have a cutscene/actionlist run from the start of the scene doing a variable: Check (or a chain of them if you are using 3 variables), which on fail, would simply return to itself (or the first item of the check list). That way the check would continue until it turns true, in which case you would run the Actionlist/cutscene you want (if you are using the 3 variables, that would be right on the last check, something like: If var 1 is true continue, if var 2 is true continue, if var 3 is true run action list/ but if any of them fails, return to the first check).
  • Yes, creating a local Boolean variables for each object would be the way to go.  You probably don't need to have a continuously-looping check for these values, however, as you will only need to check them once after each time the player activates one of the objects.

    Keep in mind that if you do implement an ActionList that loops back on itself, set it's When running field to Run In Background, so that it doesn't permanently block gameplay.
  • Thanks a lot guys
  • Hmm, I can't get it to work. What I have now is 3 local variables (booleans) set to false. I have 3 triggers in the scene. Each of them sets the boolean to be true when they are triggered. Im my scene I have an interaction that checks if the local variables are true. 

    Whats wrong? 
     
  • edited July 2016
    What do you mean in your scene? Like in the onstart cutscene? or in the same cutscene/Actionlist in the triggers? Or did you use the loop technique? A screenshot of your Cutscenes/Actionlists would help here. Still, if the variable check is not at the end of each trigger itself then make sure you are not firing the variable: check action only once. If you put the variable check in the Onstart, for example, and it's not a looping check, then the check will only run once when the scene starts and never happen again, and that will never trigger your "Result/completed" Actionlist.

    Edit: never mind I just saw the "Interaction" part in your message. Anyways, a screen shot of your action list would help here.

    Edit 2: Also, check the variables manager at runtime to see if the variables are actually updating properly.
  • I got it to run now :) Didn't get the part that I should add the variable check in the trigger itself
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.