Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Alatriste on April 24, 2018, 04:40:47 PM

Title: Listening events launched by other addons.[SOLVED]
Post by: Alatriste on April 24, 2018, 04: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!
Title: Re: Listening events launched by other addons.
Post by: tcmeric on April 25, 2018, 12:10:50 AM
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?
Title: Re: Listening events launched by other addons.
Post by: Alatriste on April 25, 2018, 04:22:55 AM
The addon is "Visual Novel Engine." (https://assetstore.unity.com/packages/templates/systems/visual-novel-engine-2d-cutscene-engine-54342 (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.
Title: Re: Listening events launched by other addons.
Post by: Uttpd on May 25, 2018, 11:41:17 AM
Whats your take on the "Visual Novel Engine"? workable with Playmaker?
Title: Re: Listening events launched by other addons.
Post by: Alatriste on September 27, 2018, 03:55:17 AM
Very limited.
I'm actually using Dialogue System (which includes a visual novel framework) with Playmaker.
Title: Re: Listening events launched by other addons.
Post by: Thore on September 27, 2018, 07: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 (https://www.youtube.com/watch?v=cnCq-OPuLRE).

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  :)
 
Title: Re: Listening events launched by other addons.
Post by: Alatriste on October 01, 2018, 03:55:48 PM
Thanks!
Title: Re: Listening events launched by other addons.
Post by: jeanfabre on October 02, 2018, 03: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
 
Title: Re: Listening events launched by other addons.
Post by: Alatriste on October 31, 2018, 07:43:11 AM
Thanks Jean!