playMaker

Author Topic: Listening events launched by other addons.[SOLVED]  (Read 1429 times)

Alatriste

  • Full Member
  • ***
  • Posts: 179
    • View Profile
Listening events launched by other addons.[SOLVED]
« on: April 24, 2018, 01:40:47 PM »
Hi, I'm using an addon in Unity that doesn't support Playmaker. I'd like to know if there is a way I can listen or somehow interact with this addon through the inspector. Can I listen to the scripts this addon is running? Or can I add a component to the GO so I can get some control from Playmaker? I know with the proxy we can have certain control over some events but I'm not sure how far I can go.

Thanks!
« Last Edit: November 01, 2018, 02:06:42 AM by jeanfabre »

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 694
    • View Profile
Re: Listening events launched by other addons.
« Reply #1 on: April 24, 2018, 09:10:50 PM »
As far as I know, you can either change the third party code to trigger a playmaker event.

You can make a proxy to listen for third party code event and then it will trigger playmaker event.

Or you can write a playmaker action that subscribes and listens for that event (in everyframe), and will trigger a playmaker event when heard.

Whats the addon you are using?

Alatriste

  • Full Member
  • ***
  • Posts: 179
    • View Profile
Re: Listening events launched by other addons.
« Reply #2 on: April 25, 2018, 01:22:55 AM »
The addon is "Visual Novel Engine." (https://assetstore.unity.com/packages/templates/systems/visual-novel-engine-2d-cutscene-engine-54342)
I'm just testing it at the moment. Not sure if it can do all the things I'm planning for my project though.

Uttpd

  • Junior Playmaker
  • **
  • Posts: 67
    • View Profile
Re: Listening events launched by other addons.
« Reply #3 on: May 25, 2018, 08:41:17 AM »
Whats your take on the "Visual Novel Engine"? workable with Playmaker?

Alatriste

  • Full Member
  • ***
  • Posts: 179
    • View Profile
Re: Listening events launched by other addons.
« Reply #4 on: September 27, 2018, 12:55:17 AM »
Very limited.
I'm actually using Dialogue System (which includes a visual novel framework) with Playmaker.

Thore

  • Full Member
  • ***
  • Posts: 232
    • View Profile
Re: Listening events launched by other addons.
« Reply #5 on: September 27, 2018, 04:55:48 AM »
Hi, I'm using an addon in Unity that doesn't support Playmaker. I'd like to know if there is a way I can listen or somehow interact with this addon through the inspector. Can I listen to the scripts this addon is running? Or can I add a component to the GO so I can get some control from Playmaker? I know with the proxy we can have certain control over some events but I'm not sure how far I can go.

Thanks!

One way to access any component is to drag and drop that very script to the state panel (where you place actions). It should then ask you if you want to get or set something. This creates the get/set action. Next, you have to find the right property in the dropdown, and configure it.

You can also create an object variable in variables pane, configure it (navigate a few dropdown list), and then use this. It’s a bit counter-intuitive how these things work, at first, but not for long (try the drag and drop first). Think of objects as blueprints, a variable that stores the blueprint of a house, and the concrete house (using that blueprint). Code is very picky about that. After all, you can’t open the door in the blueprint, only in the actual house.

Any approach that relies on dragging and dropping relationships around across the scene is prone to break once the object is removed from scene. To fix this, Jean touts a tool called Linker Wizard.

When you need to set/get something often, or you’re about to pepper all your FSMs with it, I recommend to write a custom action. It’s not as intimidating as it seems, and setting or fetching stuff from scripts is doable. There’s a tool to get you started (playmaker > tools > Custom Action Wizard), and e.g. MDotStrange made several posts (and videos) about this, which are very beginner friendly. I also see other videos on YouTube (search for “custom scripts” playmaker).

Good luck  :)
 

Alatriste

  • Full Member
  • ***
  • Posts: 179
    • View Profile
Re: Listening events launched by other addons.
« Reply #6 on: October 01, 2018, 12:55:48 PM »
Thanks!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14126
  • Official Playmaker Support
    • View Profile
Re: Listening events launched by other addons.
« Reply #7 on: October 02, 2018, 12:49:31 AM »
Hi,

 you can also use the PlayMakerEventProxy wizard to create a component ( you need the PlayMakerUtils package from the Ecosystem to get that wizard)

 it creates a bridge between a regular script method and a PlayMaker event, so you can use that to have your thirdparty event calling that method and it will end up as a playmaker event.


all infos: http://hutonggames.com/playmakerforum/index.php?topic=11172.msg52732#msg52732

 Bye,

 Jean
 

Alatriste

  • Full Member
  • ***
  • Posts: 179
    • View Profile
Re: Listening events launched by other addons.
« Reply #8 on: October 31, 2018, 04:43:11 AM »
Thanks Jean!