Book Image

Building an RPG with Unreal 4.x

By : Steve Santello
Book Image

Building an RPG with Unreal 4.x

By: Steve Santello

Overview of this book

Now that Unreal Engine 4 has become one of the most cutting edge game engines in the world, developers are looking for the best ways of creating games of any genre in the engine. This book will lay out the foundation of creating a turn-based RPG in Unreal Engine 4.12. The book starts by walking you through creating a turn-based battle system that can hold commands for party members and enemies. You’ll get your hands dirty by creating NPCs such as shop owners, and important mechanics, that make up every RPG such as a currency system, inventory, dialogue, and character statistics. Although this book specifically focuses on the creation of a turn-based RPG, there are a variety of topics that can be utilized when creating many other types of genres. By the end of the book, you will be able to build upon core RPG framework elements to create your own game experience.
Table of Contents (17 chapters)
Building an RPG with Unreal 4.x
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Finishing the inventory screen


Navigate to the Pause_Inventory Event Graph. While Context Sensitive is off, bring in the Get Array Item from the Actions window by navigating to Class | Field Player:

Once done, connect the Target pin of Array Item to GET so that you can get every item that is sent to that array once we populate the array in the Items Blueprint:

Now that we have the array of items in the player's inventory, we will now loop through each element, and create an item from every element in the array. To do this, create a ForEachLoop by navigating to Utilities | Array. Link Array Item from your arrayItem variable to the Array tab in the ForEachLoop. Then, have SET Inventory Screen activate the ForEachLoop:

Just like what we did when populating the buttons for the shop, we would want this for loop to be responsible for adding buttons from the Items Widget Blueprint. So, in the body of the for loop, we need to create the Item widget by first navigating to User Interface | Create Widget...