Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: sinman on September 26, 2012, 11:21:02 PM

Title: How do I read a variable that is not written by PlayMaker
Post by: sinman on September 26, 2012, 11:21:02 PM
I have a programmer in my project who can write JS and C#. He is currently doing his part by writing code natively. I, on the other hand, am not a programmer but am relying on PM all the time.

The problem is that I need PlayMaker to read a variable (boolean, fyi) that is written by the programmer and to run it flawlessly, so that his part of work can be joined with mine.

I can think of:
a) have the programmer reverse engineer the PM script and create a new c# script
b) somehow have playmaker read an external global variable

How can I go about doing this?
Title: Re: How do I read a variable that is not written by PlayMaker
Post by: jeanfabre on September 27, 2012, 12:59:51 AM
Hi,

 PlayMaker has a an api so that your programmer can hook to from his own scripts.

 a PlayMaker Fsm attached to a gameObject is a component like any other, and therefore to start communicating with it, a simple reference will be needed, then you can access all its local variable to set and get them, you can fire events, and query for the current state and other goodies.

here is a list of few threads that will guide you:

http://hutonggames.com/playmakerforum/index.php?topic=2147.0 (http://hutonggames.com/playmakerforum/index.php?topic=2147.0)
http://hutonggames.com/playmakerforum/index.php?topic=1759.0 (http://hutonggames.com/playmakerforum/index.php?topic=1759.0)

 The best way to learn about more advanced technics and other features is to go on the wiki and download the various addons. In there you will find many many implementations and examples of how playmaker and scripts can work together.

https://hutonggames.fogbugz.com/default.asp?W961 (https://hutonggames.fogbugz.com/default.asp?W961)
https://hutonggames.fogbugz.com/default.asp?W993 (https://hutonggames.fogbugz.com/default.asp?W993)
https://hutonggames.fogbugz.com/default.asp?W928 (https://hutonggames.fogbugz.com/default.asp?W928)

bye,

 Jean




 Bye,

 Jean