Playmaker Forum

PlayMaker Help & Tips => PlayMaker Tips & Tricks => Topic started by: Razieln64 on November 29, 2011, 02:30:44 PM

Title: System for having access to playmaker's global variables in ordinary scripts
Post by: Razieln64 on November 29, 2011, 02:30:44 PM
I've coded an Editor script that will display popups based on the types of variables that a script will need to access from Playmaker's global variables. The script is able to modify a Playmaker's global variable value directly(in the inspector) without having to go in the global variable screen.

This is based on Attributes, Reflection and LINQ. It works great. Now we're using Playmaker's global variables as a repository for game wide data.

I've also done this for scripts that need to call an FSM's events. This reduces errors when choosing the event to fire.

We're not coding our own specific scripts for every FSM state but depending on the speed of our game on iOS we may have to do it at some point if our game is too slow.
Title: Re: System for having access to playmaker's global variables in ordinary scripts
Post by: jeanfabre on November 30, 2011, 07:28:11 AM
Hi,

 Great! any chance for some code sharing? or are you planning on selling it?

 Bye,

 Jean
Title: Re: System for having access to playmaker's global variables in ordinary scripts
Post by: Razieln64 on November 30, 2011, 02:49:25 PM
I will not sell it, but I could share it. The only problem I see is that I use some specific names for my classes and generics containers that are related to my current project. I'd have to change that if I share it.

The only thing is that you still have to make an editor class for the popups to appear in the inspector view. You also have to instantiate the class that will display the popups (in the OnEnable) and call its display method in the OnInspectorGUI override. It's basically 2 lines of code. Other than that I could share if there is demand, but only when I'm done with my current project.

Also, pretty much every method is documented. It is all in C# and I don't know if this works with JS scripts.
Title: Re: System for having access to playmaker's global variables in ordinary scripts
Post by: jeanfabre on December 01, 2011, 01:51:45 AM
Hi,

 If you can't be bothered spending time on this, send this to me: I will gladly modify your code to make it generic and make it available on the user wiki. else it can wait if you wanna take care of this yourself of course :)

 Bye,

 Jean
Title: Re: System for having access to playmaker's global variables in ordinary scripts
Post by: Razieln64 on December 01, 2011, 07:51:51 PM
For the moment, I cannot do anything since I've been reminded by my business partner that I'm bound by a NDA, but when I'm done with my project I will do something about it.

I just posted this to let people know that it is possible to do some interesting stuff with Playmaker.
Title: Re: System for having access to playmaker's global variables in ordinary scripts
Post by: jeanfabre on December 02, 2011, 12:37:37 AM
Hi,

 No worries then :) NDA must be respected always.

 Bye,

 Jean