In this video Jesse Freeman will teach you how to display monster stats during combat in an RPG. You’ll learn how to clone the monster actor class, reset it’s health and pass it along with the player into the battle window. Once you have access to the monster’s instance you can pull data such as it’s name and health off of the class and display it on the battle window.
- [Voiceover] Now that we have our player stats showing up,…it's time for us to show the monster stats…as well as passing a reference of the monster…and the player into the battle window.…Let's go ahead and open up our random map tester…and let's scroll down to the bottom of our code…to where we start our battle.…Before we open the battle window,…let's go ahead and create a new monster.…We'll do this as a local variable called,…var monsterActor and we'll make it equal…to the monsterTemplate.Clone and pass in the actor…as the class.…
We'll also want to call the monsterActors.ResetHealth…so that the monster starts out at full health.…Now in order for our battle system to work,…we're going to need to pass a reference of the player…and the monster into the start battle method.…Inside of the battle window.StartBattle,…let's add our playerActor, monsterActor…and let's save this.…Now we need to open up our battle window and modify…the StartBattle method.…
Here we'll create two new arguments.…The first will be type Actor called target1,…
- Preparing the user interface
- Creating game and message windows
- Building a battle window
- Adding a monster and action buttons
- Creating an actor class
- Adding player and monster attack actions
- Triggering battles from the map
- Ending a battle
- Cleaning up the battle and attack systems
- Rewarding the player
Skill Level Intermediate
1. Preparing the UI
2. Message Window
3. The Battle Window
4. Actor Classes
5. Battle Actions
6. Cleaning Up Combat
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.