playMaker

Author Topic: Select Playmaker template based on string/name/path  (Read 1108 times)

lukew

  • Playmaker Newbie
  • *
  • Posts: 42
Select Playmaker template based on string/name/path
« on: September 17, 2015, 10:35:10 AM »
Hello,

My question is about 'Run FSM' action and other actions that use Playmaker templates.

Would it be possible to use specific Playmaker template without pointing to exact asset manually but just by converting a string like 'template1' or 'Resources/Templates/template1' so Playmaker would automatically get this template from the assets and use it?

I need to use a lot of different templates but it would be much easier to just point to the location with string instead of selecting them manually.

Imagine that every NPC uses same base prefab but needs dedicated template for daily behavior. In this case I need to select appropriate, dedicated template for daily behavior of every NPC, based on the NPC name (string).

It would be possible to make separate event and state for every NPC (100 NPCS = 100 events and 100 states in this case), so it would select the template manually (get npc name->send dedicated event based on name->dedicated state that would select specific template and run it) but it would be much easier and clean if FSM would just get the template from assets automatically.

I would use 'RUN FSM' action or 'Add FSM Template' action from the forums.

It would be perfect if It would allow me to use asset path from the string (foldername/templates/sometemplate.asset) or just a template name in the 'Template' field instead of direct reference from assets folder. At this moment it's only possible to select one, specific template from the assets in both actions (see the pic below).

Is it even possible to do it the way I need (use path/template name instead of reference)?

TLDR: Action gets a template from assets based on string (asset path or name) instead of using manually selected template.

I think that this would be useful for more people than just me and in much more cases.

Any help or suggestions would be much appreciated.


« Last Edit: September 17, 2015, 10:40:11 AM by lukew »