Integrating SF into your project

Let's talk about integrating SF into your own project. You might have already started a project, but like the way SF handles the various different systems included. This guide will take you through migrating, and enabling all that SF has to offer.


1

Quick Navigation Tools (Optional)

Before jumping into migrating SF into your project, let's check out setting up SF's navigation toolbar. This is an optional extra and is not required, but is recommended. SF is all about fast iteration times, and the purpose of these Quick-Nav tools helps make iterating even faster by offering buttons to quickly open core SF components or other related assets.

To implement this toolbar into your project, we need to go ahead and insert a "Startup Py Script" inside of our project settings that executes on engine startup to create the toolbar mentioned above. To find your "Startup Py Scripts", open up your Project Settings > Plugins > Python and create a new entry under the Startup Scripts segment. From there, insert this segment of py into that new entry and restart your project. You should now see a "Story Framework" toolbar towards the top of your editor (Next to the PIE buttons).

2

Migrating SF into your project

With a fresh copy of Story Framework opened, right-click on the main Story Framework folder, and navigate over to the "Migrate" option. From here, select the directory of the "Content" folder inside your project.

3

Modifying your player controller

Story Framework utilizes a player controller blueprint for its functionality. So if your project does not have one yet, you would need to create one. If you already have this class, open it up and add and attach the following components shown here, (This our found by simply searching for them in the Components hierarchy)

Then, we need to implement the SFPlayerControllerData_BPI blueprint interface into our player controller by heading over to the "Class Settings" section towards the top of your blueprint, and adding said interface.

With this interface now implemented, open up the Get SF Components interface function in the bottom left of your blueprint, and add those previously added actor components to their respective references.

Then, we can add SF's Player Camera Manager class from inside the "Class Defaults" section towards the top of your blueprint.

Finally, we need to copy over all of SF's input actions from our Story Framework project, into your player controller blueprint inside your own project (You would remove the Generic Movement graph if you have your own character movement solution already setup).

4

Modifying your player character

Now that we have setup our player controller, we now need to make some slight adjustments inside your player character blueprint. Inside your player character blueprint, we need to replace your current camera component with the SFDefaultCamera_CC camera component (Should be attached to a spring arm component for smoother camera movement and extra control).

This is a common approach to handling a camera system, the only difference is SF's camera component includes a few neat functions that get utilized for certain camera actions.

5

On Begin Play logic

A few things must be defined on theBeginPlay event in any blueprint of your choice. For future reference, I would advise doing this in either the player controller, or player character blueprint. We need to add SF's input mapping to the player, which can be done by using the Update Input Mapping Context function. (If you already have an input mapping, you would either need to migrate over your current inputs to SF's SFGameplay_IMC input mapping context, or remove your own input mapping entirely).

Then, we can add the Auto-Save function from the SFSaveManager_AC actor component here too (This is optional).

6

Game Instance

Finally, if you'd like to utilize SF's save system, you will need to add SF's game instance to your project from within the project settings.

7

Character Restrictions (If not using SF's movement)

SF restricts things like movement and camera rotation at specific times. These restrictions should also be set up on your players Movement and Look inputs if you'd like some of SF's systems to work as intended. This restrictions use the SF Movement Condition function for movement limitations.

And finally, we can copy the SF Camera Look Conditon graph from SF, and connect it up off of your "Look" input.

Last updated