playMaker

Author Topic: System for having access to playmaker's global variables in ordinary scripts  (Read 3788 times)

Razieln64

  • Playmaker Newbie
  • *
  • Posts: 21
    • View Profile
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.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Hi,

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

 Bye,

 Jean

Razieln64

  • Playmaker Newbie
  • *
  • Posts: 21
    • View Profile
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.
« Last Edit: November 30, 2011, 04:07:48 PM by Razieln64 »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
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

Razieln64

  • Playmaker Newbie
  • *
  • Posts: 21
    • View Profile
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.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Hi,

 No worries then :) NDA must be respected always.

 Bye,

 Jean