Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Twood on March 09, 2014, 03:35:51 PM
-
Hi,
I'd like to be able to change some game variables of the Adventure Creator asset in PM, so I could use them together.
I'm having some trouble figuring if this is doable. The thing is the variables are in a run time list.
So to change them in code you'd do something like
// get reference to RuntimeVariables. don't do this in an Update loop
RuntimeVariables runtimeVariables = GameObject.FindWithTag(Tags.persistentEngine).GetComponent<RuntimeVariables>();
// set the 3rd variable in my variables list, which is an integer, to 12
runtimeVariables.SetValue(2, 12, AC.SetVarMethod.SetValue);
Is there a process to recreate that in Playmaker? Can't get it to happen with what I've tried.
Thanks
-
You would need a custom action, but you could probably also do it with Set Property, have you checked it out before?
-
The thing is I don't see properties I want, just generic stuff like enabled, name, useGUIlayout...
Also because it's a run-time type thing I can't even get that far without dragging the component I want from play mode. And that means from what I can tell I can't even save stuff to the FSM if I'm adding it in play mode?
I guess it just isn't going to work at this point.
-
You can get the component at runtime easily, but if the variables are not in the list it is either a partial script or the variables are not exposed as public. You should probably get in touch with the Author and see what he can do, does he have a forum or support thread?
-
I asked but I don't think Chris is well versed enough at Playmaker to get this figured out. And I have no clue so I guess I'll just scrap the idea of them sharing variables for anything.
-
Added to Trello for custom actions, you can upvote it there.
https://trello.com/c/qPJvdxuD/64-adventure-creator
-
Well that might save my bacon, thanks!