Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Twood on March 09, 2014, 03:35:51 PM

Title: Changing Adventure Creator variables in PM
Post 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

Code: [Select]
    // 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
Title: Re: Changing Adventure Creator variables in PM
Post by: Lane on March 10, 2014, 08:02:47 AM
You would need a custom action, but you could probably also do it with Set Property, have you checked it out before?

Title: Re: Changing Adventure Creator variables in PM
Post by: Twood on March 10, 2014, 11:08:39 AM
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.
Title: Re: Changing Adventure Creator variables in PM
Post by: Lane on March 10, 2014, 12:21:40 PM
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?
Title: Re: Changing Adventure Creator variables in PM
Post by: Twood on March 11, 2014, 06:31:52 PM
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.
Title: Re: Changing Adventure Creator variables in PM
Post by: Lane on March 11, 2014, 06:35:18 PM
Added to Trello for custom actions, you can upvote it there.

https://trello.com/c/qPJvdxuD/64-adventure-creator
Title: Re: Changing Adventure Creator variables in PM
Post by: Twood on March 11, 2014, 06:47:41 PM
Well that might save my bacon, thanks!