Forum rules - please read before posting.

Menu/Playmaker Actions

I would like to activate NGUI events through AC's third party playmaker action (playmaker, once accessed, has ready access to NGUI).  Trouble is, I don't know how to get to playmaker from AC's menu (I can get to PM easily other ways, e.g. hotspots).  

I set up an empty game object (called Quest Log Manager) on which I put a PM FSM that activates the NGUI event (a Quest Log built with NGUI).  I also set up an AC interaction (called QuestLogPopup) that activates the Quest Log Manager (by adding AC's Interaction component script, selecting "In Scene" as Action source, "Third-Party Playmaker" as Action type, "Quest Log Manager" as Playmaker FSM, and Quest Log as Playmaker Event to call, which is the first event in the FSM and leads to the NGUI call.  That part works fine.  I tested it by putting a hotspot on an NPC and mouse-clicked the NPC to activate during game play.  The NGUI quest log pops up as it should.

But then which I try to activate it through a menu element I can't find a way to call the AC Interaction "QuestLogPopup" like I could with the hotspot on the NPC.  It seems like I should add the element as a button, but none of the button on click events has a way to call an interaction when clicked (as far as I can tell).  It's probably very easy and then I can use all of my NGUI work as well as my PlayMaker work in AC.  But what am I missing?  

Thanks.

Comments

  • Welcome to the forums, @kenuab.

    AC Menu Buttons can have their "click type" set to "Run ActionList", but the ActionList referred to here is actually an ActionList asset.  This is a special type of ActionList that lives in a prefab, and not in your scene - so that it can be accessed by the menu system no matter what scene you're in.

    So, rather than use an Interaction object to call your PM FSM, you'll have to use an asset instead.  This tutorial goes over the concept of calling a scene-based object (the FSM) from an asset.  But instead of that tutorial's Camera: Switch Action, just use the Third-party: PlayMaker Action.  Just be sure to add a ConstantID script to your FSM (as the tutorial explains), and it should work.
  • Solved!  Works great.  Thank you.  Re: ConstantID.  As I went to copy the ID etc., it looked to me like AC automatically added that component (to the QuestLogManager empty game object I created to hold the PlayMaker action call for the Quest Log) and recorded the ID when I selected QuestLogManager as the PlayMaker FSM in the action list.  

    This is going to be great as now I can see how to fully implement my NGUI work and also to constrain the player so there is no unwanted player movement when my NGUI buttons are clicked/touched. For me, this is big.  I think I'm really going to like AC!
  • One more thing: even though it is easy to get to PlayMaker in this way, it is not easy to get back to AC.  This becomes a problem if you run several playmaker actions that can't be done instantly or timed so that in that way you actually can stay in AC directing the PM actions from there.  My solution was to use an AC trigger as a bridge back.  Activating a trigger from PM (using itween) to invoke an AC action puts you back in AC.  In PM, I did all the things I wanted to do, then, as my last action, I set up an itween to move an invisible cube (you must have a rigid body on the cube), and I put an AC trigger in the path of the cube move.  I also added a reset so the itween could be rerun whenever I needed it.  I made both objects, trigger and cube, children of an empty game object, named Return_to_AC, and moved Return_to_AC below the ground of my SetGeometry to keep it out of the way.  Not very elegant, but it works.
  • Good tip.  You can also call any Cutscene's "Interact" message (using PM's ability to send messages) to run it.
  • Cool.  Actually, it seems to work with Interactions just as well as with Cutscenes.  I just set up a PM FSM with a "Send Message" action, specify the game object as either a specific cutscene or a specific interaction, leave Delivery to Send Message, Options to Dont Require Receiver, Method Name to "Interact" (from drop down menu) and Parameter to none.  This is far better than my makeshift way of firing an object through a trigger.  Couldn't be easier.  This seems to give full functionality to bridging back and forth between PM and AC.  Is there a simple way to cut and paste this forum dialogue over to a PM forum?  They need to hear this.  Last thing I saw over there was the conclusion that AC required one to be "all in" and it wasn't possible to go back and forth with PM.
  • No, but I'd appreciate it if you'd post a link there - don't know where that thread is.
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.