playMaker

Author Topic: Getting PlayMaker variables from Unity Script variables...[SOLVED]  (Read 11575 times)

markfrancombe

  • Sr. Member
  • ****
  • Posts: 338
Hi!

Can I somehow "get" a variable from a script in my game? and use it in Playmaker?
Specifically I am using some pre-made scripts for Photon Multi Player, and they work well for me. Now I would like to try to retrieve one thing. The Player name, that is entered upon login.

Then using Playmaker, I want to show that name next to the characters score.

Next up, I will want to send ALL charaters scores to all players, so that we can range them in an "In GAme "hihe score list.

As I know that PlayMaker can be used with Photon, I wonder, can I somehow "Hook into" the photo instantiation of the network variables, and read them... ? Or do I need to do everything photon "using" Playmaker...?

Mark
« Last Edit: October 18, 2012, 12:51:00 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Getting PlayMaker variables from Unity Script variables...
« Reply #1 on: October 15, 2012, 05:41:27 AM »
Hi,

If the variable is public, then it's accessible by playmaker using "Get property" or simply dragging the component in question onto the action stack quit simply.

You can mix playmaker and photon without having to do everything with playmaker, if you variables are private then you'll need to implement some playmaker api calls within your scripts to inject back values into Fsm variables, but that's trivial as well. If you need example. let me know, there are few on this forum already.
 
bye,

 Jean

markfrancombe

  • Sr. Member
  • ****
  • Posts: 338
Re: Getting PlayMaker variables from Unity Script variables...
« Reply #2 on: October 16, 2012, 06:38:23 PM »
Hi Jean,
Well thats all good to hear that it CAN be done...

Hi,

If the variable is public, then it's accessible by playmaker using "Get property" or simply dragging the component in question onto the action stack quit simply.

By that, you mean that I should make sure that the variables I want to use in the Photon scripts are created thus:
var Variable = 1;

and not thus:

private var Variable = 1;

Quote
You can mix playmaker and photon without having to do everything with playmaker,
GREAT! So I suppose that a connection made with my photon scripts, can be utilised using PlayMaker, specifically I need to send usernames and player scores to all players in order to show the in game scoreboard. I have no idea how to do this yet, but currently have a MyScore variable for yourself, this score I need to send to all players, attatch usernames to and range them in a first place to last place ordering...
Quote
if you variables are private then you'll need to implement some playmaker api calls within your scripts to inject back values into Fsm variables, but that's trivial as well. If you need example. let me know, there are few on this forum already.
 bye,
Jean

YES!! I would absolutely like these examples! If you wouldn't mind?
Thanks Jean, you are a star!

Mark

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Getting PlayMaker variables from Unity Script variables...
« Reply #3 on: October 17, 2012, 02:28:03 AM »
Hi,

have a look at them ones, the basic mechanism is there.

http://hutonggames.com/playmakerforum/index.php?topic=1143.0
 http://hutonggames.com/playmakerforum/index.php?topic=1759.0
http://hutonggames.com/playmakerforum/index.php?topic=1448.0

If that doesn't make sense, pm me and I'll look at your script and provide a working solution.

bye,

 Jean