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 thisarrow-up-right 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

chevron-rightSF Camera Componenthashtag

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.

chevron-rightAnim Inspect Dependencieshashtag

The Animation Inspectarrow-up-right system is a separate inspect mode that allows the player to rotate items around inside of the player characters hands. This inspect mode requires a few components and logic to be setup inside of your player character blueprint and player character Anim BP.

Firstly, we'd want to add the AnimInspectAnchor_SC scene component to our player character blueprint (ideally parented to your characters capsule component). Below you'll find an attached image of some default transform values to use for this scene component. You'd want this scene component to be positioned over the right shoulder of your character. If your characters proportions are different to the default UE Manny, then adjust the position of this scene component accordingly.

Next, we want to make some additions/changes to our custom characters Anim BP. Firstly, open up SF's demo character Anim BP (ABP_Manny) and copy the "Copy over to your own Anim BP" commented section from within the Event Graph, and paste this into your own Anim BP's Event Graph connected up to the BlueprintUpdateAnimation event (Hit "Compile" and create the InspectHandRotation missing variable).

Then into SF's demo Anim BP's Anim Graph (ABP_Manny), copy the "Copy over to your own Anim BP" commented section once again and paste it into your own characters Anim BP Anim Graph, connecting it up to any current nodes.

If you'd prefer to watch through a tutorial video explaining this, then you can find this exact process explained inside of the SF5.1 to 5.2 Upgrade Guidearrow-up-right tutorial from 11:15 to 13:53.

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

Next, we need to set our projects Game Instance Class to be SFGameInstance_BP inside of our Project Settings. This is so that we can reference the StoryFrameworkValues data asset and make full use of SF's save system.

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