PNMS Interaction Systems

Intro

Every interaction system is different in video games and they are unique to each game.  For this reason the mounting system does not assume you will be using any particular style of interaction systems.  The system has distilled the 3 basic operations that it performs (Mounting, Dismounting, Seat Change) into single function calls on the controller component.  So ultimately you need the Controller.


Mounting

In this section we will go over how to trigger the mounting process through interactions with objects in a game.

Core Functions

There are two core functions that trigger the mounting system that can be directly called if needed that exist on the RiderControllerComponent. 

Get Rider Controller Component
Fig 1.0 Get Rider Controller Component

You can always fetch the RiderControllerComponent from a controller with the IRiderController Interface function "GetRiderControllerComponent"

Perform Mount Actor

Perform Mount Actor
Fig 2.0 Perform Mount Actor

The first is "PerformMountActor" which is a function on the RiderControllerComponent.  This function takes in two parameters.  The "New Mount Actor" is the main mount you want to mount to.  The "New Linked Actor" is an optional pawn that is attached to the main mount that the player can take control of, you can think of these as turrets or gunner positions players can use.  Using this Mounting function assumes you want to mount based on a relative position you are standing to the mount.  For instance a horse may be mounted on either the left or the right side of the drivers seat, the system has several built in functions designed to figure out where you are standing relative to the mount and find the best mounting location.

Perform Mount Actor To Seat

Perform Mount Actor To Seat
Fig 3.0 Perform Mount Actor To Seat

The second function that triggers the mounting process is "Perform Mount Actor To Seat".  This function takes in similar parameters to the "PerformMountActor" function but has a new parameter "Seat ID" this is the identifier of the seat you want the pawn to directly mount to.  Using this mounting function assumes you want the player to choose what seat they can mount to.

Interface Functions

As of version 2.3 of the plugin which is on UE 4.25 and UE 4.26 explicit interface functions have been designed to help start the mounting process and reduce some confusion.

Begin Mounting Actor

Begin Mount Actor
Fig 4.0 Begin Mount Actor

Because it is an interface function you can call this with out having to perform casting.  It has identical parameters to the "PerformMountActor".  The function specifically is meant to wrap "PerformMountActor" and allow you to call it from anywhere in the system with little overhead.

Begin Mounting Actor To Seat

Begin Mount Actor
Fig 5.0 Begin Mount Actor To Seat

This function is simillar and acts as a wrapper to "PerformMountactorToSeat".  As you can see it provides the same parameters and outputs.

Prepare to Mount - UE 4.24 and older

 On Older implementations the mounting system (v2.1 and older), It did not have a defined method to mount besides directly calling the controller component's "PerformMountActor" function.  That is why we tended to use the Controllers verison of the Unified Controller Pawn interface function "Prepare to Mount" to start mounting.  However that proved to be simply confusing and is why new functions have been defined on the IRiderController Interface

Prepare To Mount
Fig 6.0 Prepare To Mount

I keep this here because on engine versions 4.24 and older this is the one way to trigger the mounting system without having to define your own interface for it.


Dismounting

In this section we will go over how to trigger the dismounting process through interactions with objects in a game.

Core Functions

These core functions are found on the RiderControllerComponent and can be directly called from that component.

Perform Dismount Actor

Perform Dismount Actor
Fig 7.0 Perform Dismount Actor

Dismounting from the mount is very simple and just requires you to call "PerformDismountActor" which is a function on the RiderControllerComponent.  This function takes in one parameter.  The "Dismount Actor" paraemter is the main mount you want to dismount from.  The parameter is required as it is checked and validated against what is in the component.  There are plenty of methods of retrieving the pawn to pass in to this function.

Interface Functions

Just like Mounting, the Dismount has it's own functions to start and trigger dismounting.

Begin Dismounting Actor

Begin Dismounting Actor
Fig 8.0 Begin Dismounting Actor

Because it is an interface function you can call this with out having to perform casting.  It has no input parameters as the implementation of this function simply gets the current mount from the RiderControllerComponent.  The function specifically is meant to wrap "PerformDismountActor" and allow you to call it from anywhere in the system with little overhead.

Prepare to Dismount - UE 4.24 and older

On Older implementations the mounting system (v2.1 and older), It did not have a defined method to dismount besides directly calling the controller component's "PerformDisountActor" function.  That is why we tended to use the Controllers version of the "Unified Controller Pawn" interface function "Prepare to Dismount" to start dismounting process.  However that proved to be simply confusing and is why new functions have been defined on the IRiderController Interface

Prepare to Dismount
Fig 9.0 Prepare To Dismount

Changing Seats

In this section we go over how to trigger the change seats functionality.

Core Functions - Rider Controller Component

These core functions can be found on the RiderControllerComponent which is on the Controller.  You have your options to how you want to change seats, you can specify either a Seat Identifier which is a unique number you can give your seat or the index of the seat within the mount's seat array.

Perform Change Seats By ID

Perform Change Seats By Id
Fig 10.0 Perform Change Seats By Id

This function allows you to change seats by specifying the seat ID you want to move to

Perform Change Seats To Index

Perform Change Seats To Index
Fig 11.0 Perform Change Seats To Index

 This function allows you to change seats by specifying the seat index you want to move to, the index must correspond to a seat index on the mount.

Core Functions - Mount Rider Component

These core functions can be found on the MountRiderComponent which is on the Pawn or Character.  For consistency I would suggest using the ones on the RiderControllerComponent.

Change Seat by ID

Change Seats By Id
Fig 12.0 Change Seats By Id

This function allows you to change seats by specifying the seat ID you want to move to

Change Seat To Index

Change Seats To Index
Fig 13.0 Change Seats To Index

 This function allows you to change seats by specifying the seat index you want to move to, the index must correspond to a seat index on the mount.

Interface Functions

The IRiderController interface provides the functions for changing seats on the Controller.

Begin Changing Seat by Id

Begin Changing Seats By Id
Fig 13.0 Change Seats By Id

Is meant to be a wrapper to the RiderControllerComponent function "PerformChangeSeatById".  Because this is an interface function you can call it without having to cast to a specific controller type.

Begin Changing Seat To Index

Begin Changing Seats To Index
Fig 15.0 Begin Changing Seats To Index

Is meant to be a wrapper to the RiderControllerComponent function "PerformChangeSeatToIndex".  Because this is an interface function you can call it without having to cast to a specific controller type.