[Gamemaker Studio 2 Turned Based RPG Tutorial] Part 5: Stats and the Encounter

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone this is sniper ninja and welcome back to my turn based RPG tutorial in game maker studio 2 in this part we'll be adding the stats for the player and enemy as well as the encounter we are first going to make our stat scripts for the player create a new script now what I actually want to do is I want to add a group name of Slayer we're going to add an e input face and move state we're going to add another script note another group and we're going to name the stats now create a new script and name this player stats I am going to explain a depreciated declaration called global Bart you can use the prefix global dot variable name to define a global variable but you need to take the global dot part every time call over using global bar will remove the need to type global dot every time the only issue with bolivars that is depreciated meaning this may not exist in the future their game area too so you'll have to use global dot instead another thing to mention is that you first define it then set the value after so you write it like this where's that global bar P level P level equals 1 just like that now we need to write this down for every other stat you now the reason why we have to use global variables is because that the way we're making this is that we'll need it so that the player and the and the battle object will both need these variables and I don't want to add a prefix to every single one now create a second stripped and we will name this enemy stats enemies that not enemy state only stats we don't need any of these global variables we made so we can just write down the actual variables the sprite we write this down because that we will have to define the sprite of the enemy because that we will put the spray of the enemy in the middle of the screen during the battle kind of like earthbound we will just set this to no one because that we don't want to sprite for this currently now it is finally time to create the battle but first we must have the background create a new sprite and name it BG battle I use BG at the as the prefix so that way it makes it easier to find now import a new image now the asset pack has been updated make sure you download the new version as there's new file called babel background import this and now create a new room and rename this RM battle open up the room now and set the dimensions to 320 by 240 zoom in go to background set the sprite to BG battle horizontal vertical tile and set both the horizontal and vertical speed to 1 after that click the play button here you should see it move like this so in just a few seconds we were able to create this neat little background for the battle room pretty nice now I have a cool or self-styled background now the encounter to create the encounter we are going to create a new variable called steps open up your object player and go the create event create a new variable and name this steps and edit to 1000 now go the step event and add this to the if statement if if groove is not equal are and add this and so it takes both of these arguments now go Detroit vent now select this code press tab and then that ends get room equals if room does not equal RM battle before we are done create a new event go to other room start event at desk record room this room does not equal our ml last room equals room now the reason why we sort this variable is so that way we go back to our original position once we win the bottle it is now time to create the encounter logic go to the move state and large and under the collisions we will go for check for battle and counter it blank e if length equals 1 our RNG e equals I R and then step it RNG equals steps and steps is less than or equal then 850 now the reason why we added that second argument is so that way if you like it really bad rng you end up like getting about immediately we don't want that that's evil also else steps - equals one so that way if you don't get an encounter your chances of getting an encounter will increase I found that this is like the most consistent is like the method of getting like most consistent encounters and then if we we do get the encounter then we fade out into be battles we actually see white and we fade slower XY because we don't want our position change and then steps equals 1000 so that way we step the steps counter now run your game now as you can see we slowly fade into the battle as we now have the encounter thank you very much for watching this video if you like this video please like subscribe and share and check out some of my other social media in the next part we will be adding text boxes to our game see you next time bye
Info
Channel: Aidan
Views: 29,587
Rating: undefined out of 5
Keywords: Games, RPG, Tutorial, Programming
Id: N_-OUQT0_VI
Channel Id: undefined
Length: 9min 19sec (559 seconds)
Published: Fri Aug 04 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.