playMaker

Author Topic: PlayMaker extension: new variable type  (Read 3957 times)

focus

  • Playmaker Newbie
  • *
  • Posts: 4
PlayMaker extension: new variable type
« on: November 05, 2014, 09:51:00 PM »
Hey guys!
Is it possible to extend PlayMaker and add few more variables types?
Maybe using reflection?..

focus

  • Playmaker Newbie
  • *
  • Posts: 4
Re: PlayMaker extension: new variable type
« Reply #1 on: November 06, 2014, 07:52:34 PM »
Anyone?  :-\
I'd glad to hear anything on this topic, even if there are no any good news.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: PlayMaker extension: new variable type
« Reply #2 on: November 06, 2014, 08:10:20 PM »
It depends on what you need to do?

Sometimes you can basically just put your code encapsulated in an action and trigger it through the interface, that lets you at least work with variables that are native in your project if you're using something unusual or custom. Through the use of other custom actions and a proxy object you could probably make something work. Arraymaker does this, essentially.

On the other hand if you mean that you want to use MyFancyVarType in the Variables tab alongside Int, Float, Etc.. then I'm not sure, you'll have to wait for Alex's response on that one I think.

There is a bit of custom editor stuff on the wiki, but doesn't sound like what you're looking for.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

focus

  • Playmaker Newbie
  • *
  • Posts: 4
Re: PlayMaker extension: new variable type
« Reply #3 on: November 06, 2014, 08:22:31 PM »
Thanks for your quick reply, Lane!
Yeah, I'm about adding new vars to the Variables tab in first place.

I have a bit customized types-replacers for basic types from my plugin. Like ObscuredInt. It actually implicitly converts to and from the int. Thus it usually able to replace usual int without any additional work from the user - they just change the int type to the ObscuredInt and all continues to work as usual (from the user sight, but there are some stuff happening under the hood to protect int variable from memory search).

I'd like to add ObscuredInt, etc. to the Variables to let Playmaker users make use of secure variables for money, etc. in their games.

I know it is possible to make proxy class, but it would be much more comfortable for user to just select ObscuredInt instead of Int.

That's why I'm looking for any possible way to do that, including any dirty hacks with reflection %)

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: PlayMaker extension: new variable type
« Reply #4 on: November 06, 2014, 08:40:06 PM »
I see.. Yeah I don't have the answer on that one, unfortunately. If the other guys don't chime in after a while just bump the thread, I'll ping them if it gets buried.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: PlayMaker extension: new variable type
« Reply #5 on: November 07, 2014, 12:55:52 AM »
Hi,

The only way I know of is to use FsmObject and wrap your variable in a Unity object.

Warning! Unity object are not subject to garbage collection you have to manually call Unity to clean up, and that's VERY costly, and you can end up with memory leak very quickly.

 I use this trick here and there but definitly not something to underestimate. Serialization will also be an issue, but with Unity 5 I hope it's going to be better.

 Bye,

 Jean

focus

  • Playmaker Newbie
  • *
  • Posts: 4
Re: PlayMaker extension: new variable type
« Reply #6 on: November 07, 2014, 05:46:39 AM »
Thanks, Jean. This is something I was afraid of  :(
Hope PlayMaker will have some flexible way to extend its variables collection in future, it could be really useful for many developers.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: PlayMaker extension: new variable type
« Reply #7 on: November 14, 2014, 02:17:54 PM »
Hi,

 yes, I would like this very much too. I would also very much like events to become classes we can extend and so on.

 Bye,

 Jean

Yulian

  • Playmaker Newbie
  • *
  • Posts: 1
Re: PlayMaker extension: new variable type
« Reply #8 on: July 02, 2021, 01:08:47 PM »
Dear PlayMaker devs,

PlayMaker already have variable like FsmEnum which represent custom Enums.
Please consider to add new types like FsmClass and FsmStruct to represent custom Classes and Structures. This will make PlayMaker more robust and developer-friendly.

I have given this idea to you for free. ;)

Regards,
Yulian