Syncing Playmaker Variables

appminis

Member
So using the Variable Synchronizer, I can sync Playmaker and Behavior Designer variables. The problem is that the gameobject with the behavior tree is a prefab, and the Playmaker object is a scene object. So if I define this before runtime (and before the prefab is instantiated), it loses the connection.

I've tried to set things after instantiation, but the Variable Sync script is confusing because its calling code outside of itself, and being a pretty novice programmer, I'm not sure how to interface with that (since I primarily do all my scripting through Playmaker).

How can I sync a BD prefab object variables with a Scene-based Playmaker FSM variable?

Thanks!
 
Last edited:
You can use the Synchronize* task to do the actual synchronization within the tree. Alternatively when you start/stop the FSM it also has the option to sync the variables.
 
You can use the Synchronize* task to do the actual synchronization within the tree. Alternatively when you start/stop the FSM it also has the option to sync the variables.

Initially that's what I was trying - but it didn't seem to work in my structure.
I want to update the Hearing Radius variable in my Behavior Tree, from Playmaker, so that when I am sneaking (controlled via Playmaker), it reduces this value.

This my tree:
9ba431b632238b6826eadd494e823e69.png


This is a conditional abort sequence. Unless I'm doing something wrong, it looks like it is synchronizing the variable only once and I need the HearingRadius float to always be in sync, prior to checking if the AI can hear the Player.

Is this correct?
 
That is correct in that it would only synchronize once. What you could do is place it under a parallel that is closer at the root of the tree so it always executes.
 
That is correct in that it would only synchronize once. What you could do is place it under a parallel that is closer at the root of the tree so it always executes.

Is that preferable to using the Variable Synchronizer? If there was a way for me to easily set the Playmaker FSM scene object/variable in that script, that would make for a cleaner behavior tree.
 
I actually plan on deprecating the Variable Synchronizer soon. You can do almost everything with Property Mappings except sync Playmaker variables. I'll try to update the integration package soon with Playmaker Variable Property Mapping support so then you won't even need to use the synchronize tasks.
 
I actually plan on deprecating the Variable Synchronizer soon. You can do almost everything with Property Mappings except sync Playmaker variables. I'll try to update the integration package soon with Playmaker Variable Property Mapping support so then you won't even need to use the synchronize tasks.

Thanks Justin, look forward to it.
 
I actually plan on deprecating the Variable Synchronizer soon. You can do almost everything with Property Mappings except sync Playmaker variables. I'll try to update the integration package soon with Playmaker Variable Property Mapping support so then you won't even need to use the synchronize tasks.

Hi Justin - just wanted to see if you have an idea when youd be able to update the Playmaker integration? Thanks -
 
Top