playMaker

Author Topic: Effective way to work with Prefab Variant and Templates?  (Read 1202 times)

rechronicle

  • Full Member
  • ***
  • Posts: 119
  • Mystvaldia
    • Indie RPG Creator
Effective way to work with Prefab Variant and Templates?
« on: July 07, 2019, 09:48:32 AM »
Hello,
I'm wondering what is the best way to organize/work with Prefab Variants and FSM Templates?
I mean, because editing the template will break the instance, and thus requires extra editing for every variation that I want to make.

Or it shouldn't be used like that?

If you know anything about it, please share.
Thank you!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Effective way to work with Prefab Variant and Templates?
« Reply #1 on: July 07, 2019, 06:21:48 PM »
Hi.
So far i think with variants its better with normal fsms than with templates directly.

on variants you 'can' change values on actions and variables.
But not add or remove actions/states.

What i mostly do is expose variables to the inspector to edit the values on the variants.

Then if the variants need different action/states, i will build that into a separate fsm on each variant.
Then on the main, i use a 'send fsm by name'. to activate whatever that fsm variant needs to do.
For the fsm name and the event name on the 'send fsm by name' i use exposed variables. so i can set them in the inspector.

You could also use some 'run fsm' with some templates on the main fsm and use a 'int switch' (use a exposed int variable on the 'int switch')

Then on the variant you can set the int to which run fsm it has to go.

rechronicle

  • Full Member
  • ***
  • Posts: 119
  • Mystvaldia
    • Indie RPG Creator
Re: Effective way to work with Prefab Variant and Templates?
« Reply #2 on: July 13, 2019, 09:14:05 AM »
Hello,
thank you for your answer.
How do you organize your events with 'send fsm by name'? So that you don't accidentally send a duplicated event/using the same name in a different place.

I tried to use '/' but it does nothing. Is there any example of how to write it correctly?

Thanks!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Effective way to work with Prefab Variant and Templates?
« Reply #3 on: July 13, 2019, 09:09:48 PM »
Hi.
I document a lot, with description.
also in the main fsm description.

So if i send a fsm from somewhere i will note that in the sender fsm and also in the Receiver fsm.

I also almost never use broadcast event.