Page cover

Game Modules Actor

v4.0

Game Modules 4 introduces the GameModulesActor class, along with the GameModulesInventoryActor. These classes are set up to automate the Game Module systems.

You can inherit from these classes! The Party Based RPG demo game DemoActor inhertis from GameModulesInventoryActor.

If you're using the Inventory system, inherit from GameModulesInventoryActor. Otherwise, inherit from GameModulesActor.

Start Actions

Add the StartActions class to your object, and drag the object itself into the list. Any IHaveStartActions class (Monobehaviour or otherwise) can be added to this list. When the object is created, or when the gameplay starts, the StartActions() method will be automatically called by the StartActions class on each of the objects in the list.

The component has recently been updated, after the video below was made. It now will automatically cache the IHaveStartActions classes which it can find on the object it is attached to, whenever you view it in the Inspector.

Starting Stats

Game Modules 4 comes with a new StartingStats component. Add this to the object which holds your GameModulesActor, or any other field that implements IHaveStats.

Choose Stats you wish to add when the game starts. If the Stat already exists, nothing will happen (to avoid overwriting existing data).

This is a convenient way to specify the starting values for an actor.

Important Methods

Most of the Game Module actions are automatic, and already set up if you inherit from GameModulesActor. However, you should still run these to methods from your Actor class or monobehaviour.

In the Party Based RPG demo game, the DemoActor class inherits from GameModulesInventoryActor, but is not a monobehaviour.

Instead, the GameData class, which has a List<DemoActor> which holds the four players, is a monobehaviour, and calls the Tick() and StartActions() methods.

Tick() and LateTick()

Last updated

Was this helpful?