Playmaker Forum

PlayMaker Help & Tips => iOS Help => Topic started by: davidosullivan on December 02, 2015, 09:24:48 PM

Title: Can Playmaker code be distributed in asset bundles? [SOLVED]
Post by: davidosullivan on December 02, 2015, 09:24:48 PM
Hi there,

I have tried asking this in another way in the general forum, but nobody seems to know the answer...

I know that with the AppStore, if you want to expand your game using Asset Bundles that the user downloads at some point after they have the original executable, you are not allowed to include any scripts in the AssetBundle, it can only be Data. So Scenes are ok but any extra C# scripts are apparently not allowed.

So what I want to know before I buy is, is Playmaker an interface for generating scripts, or is a component that generates code at runtime, based on its settings and data.

If its the second option, then a scene in an asset bundle, could in theory be completely coded in Playmaker and do almost anything possible in Unity, and the user would still only have to download the asset bundle, they would not have to re-install the app.

Is this the case? If so why is this not touted as a feature, thats pretty HUGE I'd say...
Title: Re: Can Playmaker code be distributed in asset bundles?
Post by: Alex Chouls on December 03, 2015, 12:07:55 AM
PlayMakerFSMs can indeed be included in asset bundles, allowing you to add new "scripts" to deployed apps. Yes this is a pretty huge feature that we should probably advertise more! :)

Note, you cannot use actions in asset bundles that weren't in the original build. But it's still a powerful way to add new behaviours to apps without having to submit an update etc.

Title: Re: Can Playmaker code be distributed in asset bundles? [SOLVED]
Post by: cper on March 08, 2016, 01:07:51 AM
Hi I don't really get it about adding new scripts into the asset bundles. So if the original build doesn't have the script or we have modified the playmaker action scripts, will it still load fine with the original build?

I am facing issue as my windows build (older version) trying to load the scene asset bundles that has modified script and they don't work. Is there a way not to update the whole build?
Title: Re: Can Playmaker code be distributed in asset bundles? [SOLVED]
Post by: memetic arts on March 30, 2016, 03:36:58 PM
I agree, PlayMaker is a great way to deliver scripted functionality via AssetBundles, and I'm using that quite extensively in an app I'm about to launch, in conjuction with ArrayMaker/DataMaker and XML.

The point that Alex is making, I believe, is that you can have instances of scripts attached to objects in your AssetBundles, as long as the script on which the instantiation is based is included in your "hosting" project.  So you can use the same script in AssetBundles, which may use variables to alter the bundled content, but the core script has to be present in the base file. 

And, in case your bundle contains an entire scene (as mine does), you'll need to instantiate the objects/components via prefabs.

Hope that helped.