Comment on page
Game Modules Actor
Game Modules 4 introduces the
GameModulesActorclass, 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
StartActionsclass to your object, and drag the object itself into the list. Any
Monobehaviouror 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
StartActionsclass 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
IHaveStartActionsclasses which it can find on the object it is attached to, whenever you view it in the Inspector.
Game Modules 4 comes with a new
StartingStatscomponent. Add this to the object which holds your
GameModulesActor, or any other field that implements
This is a convenient way to specify the starting values for an
The component will automatically cache the fields at edit time, minimizing the resources required at runtime. Simply adding the component or viewing it in the Inspector will trigger the script to find
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
DemoActorclass inherits from
GameModulesInventoryActor, but is not a monobehaviour.
GameDataclass, which has a
List<DemoActor>which holds the four players, is a monobehaviour, and calls the
In 4.0.3, this has been automated. The
GameModulesActorwill automatically register itself with the
ModulesHelperif it has Quests, or when a Quest is added.
ModulesHelperwill now call
Tick(), so you no longer have to remember this!
There are many helpful methods on these classes. Please read the scripts to familiarize yourself with them. The scripts are well documented.