Stacked commands for character

Hey guys, I’m looking for a little inspiration for an implementation of stacked commands.

Basically, I would like a player to give an AI a list of commands which will be carried out one after the other.

For example:


MovetoLocation : location
ChangeStance : Prone
ChangeWeapon : Primary
MovetoLocation : location

I’m currently experimenting with using a ‘command’ struct. The struct carries the command type and any parameters. The AI then has an array of commands. I imagine I would then have a behaviour tree run through those commands one after the other.

Any ideas of a better way to go about this?

Looking for C++ and/or Blueprint solutions.

Many thanks!

> Any ideas of a better way to go about this?

It’s called Behavior Trees

Yup just make an enum with all the commands and use them in the behaviour tree to drive the ai’s.