The M2 Example Plugin
Last updated
Was this helpful?
Last updated
Was this helpful?
The M2 Example
plugin acts as an slightly more fleshed out starting point for MSquared projects, adding some example/reference features, which users can then learn from or build upon in their own projects. Features/functionality added in this plugin are not considered core MSquared functionality, but have been added to show how such features could be added in downstream projects, using a combination of core MSquared functionality, and native Unreal.
Some of the features added in the M2 Example plugin:
The ExampleMap
- a simple map designed to be the entry point for new projects, showcasing core MSquared features with simple examples.
An example Unreal text chat system (see Unreal Text Chat)
An example Nameplate component, that displays their profile names, and their recent text chat messages (see BPC_M2Example_NameplateComponent
)
A basic example UI setup (see UI)
Includes an example settings menu (WBP_M2Example_SettingsMenu
), showing how to modify things like your profile name, your avatar URL, and audio & graphics settings
We include an example "UI Mode" toggling system, to enable users to switch between a "game mode" (where the mouse is captured and used as camera rotation), and a "UI mode", where the mouse is released, and users are allowed to click on things.
Some example core classes, e.g. the BP_M2Example_GameMode
, and BP_M2Example_PlayerCharacter
.
Its own bot behavior store (BP_M2Example_BotBehaviorStore
), and custom bot behaviors (e.g. BT_M2Example_BotTextChat
), to test out the example plugin-specific functionality. (For more details on how bots work and are configured, see Bots)
Any functionality that you are interested in using in your project, please have a look, and copy whatever is useful for you!
The example classes, e.g. BP_M2Example_PlayerController
, have been set up based on a minimal base class, adding some example functionality. We believe these to be a reasonable starting-off point, but they are not the base-most classes that can be used, if you want to start from scratch. Please consider the following:
Game Mode
M2_GameMode
(C++)
The M2 base class adds essential functionality for operation with MSquared, such as the PlayerMorpheusActorClass
.
Player Controller
PlayerController
(C++)
All additions to the base player controller class are optional
Pawn / Character
M2_CharacterBase
(C++)
The M2 base class adds essential functionality for operation with MSquared, such as overriding the out-of-bounds behavior, which can only be done in C++.
As well as the C++ base class, we have added a barebones BP_M2_PlayerCharacter
, which adds some minimal input and the like to get started.
Morpheus Actor
M2M_CharacterBase
(C++)
The M2 base class adds essential functionality for operation with MSquared, such as enabling MML avatars, and supporting animations in the crowd.
The class above the M2M character is MorpheusPawn
, which is the true base class for any player controllable Morpheus Actor, but this does not support the above core MSquared functionality, which must be configured in C++.
The following documentation is for release v36 onwards
One limitation of MSquared only supporting modifying Unreal assets, and not code (see Differences from Unreal), is that the character's "out of bounds" behavior is hidden away, and cannot typically be overridden. The default behavior of an actor when out of bounds (e.g. hitting a kill plane) is to destroy the actor. This is not compatible with typical MSquared experiences, since we pool and reuse the characters (see Actor Pooling).
Therefore, we have surfaced Event Notify Outside World Bounds
, which is triggered when the character ends up out of bounds. This behavior can be overridden to implement whatever death/respawn logic etc. you want in your experience.
BP_M2_PlayerCharacter
is currently to just log a warning. We will write a fuller example behavior in future.