You don’t actually need to create a
Mind class - that is probably too complicated for what you want to accomplish.
Mind classes are needed to update the coroutines for a bunch of objects though every game has a built-in mind object to do that for default updating. In more sophisticated situations you might have mind objects for specific levels, missions, ambient world behavior, or even more sophisticated individual characters. Again this is probably overkill for a simple minion and you can just use the default world mind object.
Just put the logic you want in your minion’s constructor
Though rather than calling it
_tick() you might want to call it
_behave() or something like that since it doesn’t actually tick.
I just tried it spawning a robot in the SkookumDemo project with the following code.
// Spawn robot one meter in front of player
xform.@translation += [player_pawn.actor_forward_vector *= 100]
!robo: GameLib.begin_spawning_actor_from_class(@@world Enemy.static_class xform)<>Enemy
println(robo.name " spawned at " xform.@translation)
However a call to
destroy_ actor() doesn’t seem to abort the SkookumScript coroutines running on it.
So objects can have a looping coroutine associated with them but you cannot remove them from the game runtime without a dangling script running.
I’ll look into this further and see if a solution can be found.