PlayMaker News > General Discussion

Playmaker version of Inheritance?[SOLVED]

<< < (2/3) > >>

jeanfabre:
Hi,

you would have a state per template and each of these state would have a dedicated Global event "EXECUTE PATTERN / MOVEMENT 1" "EXECUTE PATTERN / ATTACK 3"

when the template has finish running you go back to a main state which responsible for launching the next execution in the sequence. and you use "Send Event By Name" to compose the global event to call base on the next sequence,

so you could even save the sequence in a simple FsmArray like

 "MOVEMENT 1",
 "ATTACK 3"


or in a text file where each line is the pattern to execute.

 does that make sense?

I also create a "RunTemplateFSM" custom actions on the ecosystem, but It's not 100% safe, at least you can experiment, it lets you save the template in a FsmVariable Object so you can actually load any template by code this way too ( but I recommand the first solution for safety)

Bye,

 Jean

Fat Pug Studio:
Thanks for the explanation, it's perfectly clear ;)

jeanfabre:
Hi,

 have go, if you can't get this anywhere, I'll do a sample ok?

 Bye,

 Jean

Fat Pug Studio:
Well, ok if you're insisting, give me a small sample, it still can be hard for me to think abstractively :)

jeanfabre:
Hi,

 ok, here's the basics ( attached to this post).

- your ennemy has two fsm, one that holds the pattern, on that can be turned into a template executing the patterns

- patterns are expressed in FsmArray, quite simply.

- each pattern has a dedicated Global event, so that it's simple to call them, yet doesn't require them to be featured where unecessary ( not all your ennemies need to have a pattern they won't use

- event are built as string and sent as string, so the combinations are endless and the sequencer is agnostic to the content of the patterns and the event to set, no hardcoding on the sequencer, which is critical for productivity.

- the ennemy has children, each children is an pattern or attack ( and so they can use templates, or be added at runtime, etc etc). This is not mandatory, one gameobject could hold several patterns, could be template, could be anything.

- the pattern execution is controlled by the ennemy and each pattern is responsible to tell the fsm who initialize the execution that it's done, then the sequencer can execute the next pattern.



 Let me know how it works for you. I'll beef this up over the next few days as I think this kind of problematic is interesting to study and understand where the complexity can be reduce for better workflow and productivity ( and avoid duplicates).

 bye,

 Jean

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version