Forum rules - please read before posting.

Using PlayMaker to trigger an AC action list

Does anyone know if there's any way to send a 'run' command to an AC action list using PlayMaker?

Thanks!

Comments

  • Any AC ActionList, asset or otherwise, can be invoked by calling its Interact function.  This can be done via sending a message through Playmaker.
  • Not sure exactly how am I supposed to set this up.
    The 'send message' action in PM requires a game object to send to. However an AC ActionList is not a game object. It does not even exist within the scene - so how do I send a message to it?
    I tried to just broadcast the message but that did not seem to work. What exactly should I write in the 'Method Name' field? The ActionList I'm trying to run is called 'catBlink'
    I tried broadcasting all the following options and none worked:
    virtual void AC.ActionList.Interact ()
    virtual void AC.catBlink.Interact ()
    virtual void AC.ActionList.Interact (catBlink)
    AC.ActionList.Interact (catBlink)
    AC.catBlink.Interact ()


    image

  • I also use PlayMaker. It's actually pretty easy.  :)

    Drag your action list from the Hierarchy and drop it in the State window in PM.

    Select 'Call Method'...:

    image

    Then select 'Interact'...:

    image

    image

    And that's it. It will run your action list from the start.
  • Are you referring to an ActionList asset, rather than a scene-based ActionList like a Cutscene?

    I'm not sure how to reference asset files by PM, but you can have a Cutscene reference an ActionList asset by placing a fresh one in your scene and setting its Actions source field to Asset File.  You can then have PM run that, which will in turn run the asset.
  • edited July 2017
    Thanks to both of you!
    Will check it out.

    Edit: Using both of your advice I got it working in no time. Thanks again!
  • Is it possible to create ActionList through Playmaker rather then ActionList editor? I like the Playmaker debug funtionality. If not, can it be done through c#. I am a seasoned programmer, coding is not the issue.

  • ActionLists are their own beast - you can trigger them from PlayMaker as described above, but they can't be generated that way.

    It is possible to script ActionLists - see the Manual's "Generating ActionLists through script" chapter, as well as the included "Scripted ActionList Example" script.

    Do note, however, that Actions themselves generally work by calling other script functions. If you're relying on script instead, it sometimes make more sense to just call those same functions directly instead.

    For example, instead of generating a Variable: Set Action through code, it would be easier to simply access the variable you wish to modify directly:

    GVar myVariable = GlobalVariables.GetVariable (2); // 2 is the variable's ID
    myVariable.IntegerValue = 10;
    

    See the Scripting Guide for full details on what functions and variables are publicly available.

  • Can I write AC action as a Playmaker action and then use it to write the flow of the game? . That way i can see the flow visually and if I need to debug it I can.I don't know if I am making sense.

  • AC and PlayMaker Actions aren't interchangeable, despite the similar naming convention. But if you want to write a PM Action that performs something similar to what an AC Action does, you may be able to - since, again, AC Actions are generally just used to call wider AC functions.

    The Actions Manager can be used to show all available AC Actions. Selecting one will tell you its script name which you can then open to reveal how it works. The bulk of the Action's effect is typically handled within its Run function.

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.