Hi guys!
I'm trying to create ActionLists for reusable objects in my game such as doors, collectable items, buttons etc. Unfortunately simple ActionLists can't be stored in a prefab. ActionList Assets seem to be an appropriate tool, but I can't find a way to pass it a parameter from my hotspot (wich is in a prefab). I didn't try to do it with a custom script yet, because I think there should be a way to do it using inbuilt Adventure Creator tools. Am I right?
And how do you, guys, call reusable ActionList Assets in your games?
Comments
More info can also be found in Section 5.13 of the Manual. To pass a Hotspot to an asset as a parameter, you'll want to define a GameObject parameter.
However, there are some other cases when parameters are set in other circumstances - such as the Trigger, which allows you to set the object which collides with it as its own parameter.
While calling an ActionList that uses parameters directly from a Hotspot doesn't allow you to set a parameter in the same way, that could be a worthwhile addition. Would something in the form of a "Set Hotspot as GameObject parameter?" checkbox be suitable for your needs?
@ChrisIceBox I'll try to write my own Parameter Keeper script, that would store a list of parameters and apply them to an ActionList on start. But if it's not possible, I'd like to use "Set Hotspot as GameObject parameter?" checkbox.
The only difference here is that we're talking of removing the need of an "interim" actionlist - i.e. the one that calls it in the first place. A parameterised ActionList is normally run with ActionList: Run, whereas the change I'm considering to the Hotspot Inspector would allow a GameObject parameter to be set to the Hotspot automatically. However, that would only affect that one parameter - if you wanted any others to be set (and most likely you would, for example a Marker for the player to stand, a Camera to cut to) you'll still want to ignore that and use the ActionList: Run Action in a dedicated single-Action Interaction as normal.
http://pastebin.com/cG0gGNd4
If an ActionList makes use of an Asset File for its Actions, and that Asset File contains parameters, would the ability to set "default" parameter values in the ActionList's Inspector be along the same lines as this?
Maybe setting values for other parameter types would be possible if we check parameterType value? I didn't try it myself yet.
http://pastebin.com/2FKsgQGW
http://pastebin.com/cG0gGNd4
That approach should work fine, but there have been some developments regarding parameters in the latest releases which may be of use: