Rpg Level System Tutorial V1.2, Simple GML, Very Detailed, 3500+ Downloads and counting! |
This forum is for clear and concise tutorials and well documented examples. Tutorials and examples posted here must follow the format in the pinned Rules and Guidelines.
All new topics must be approved by a moderator before they appear. Don't post twice!
![]() ![]() |
Rpg Level System Tutorial V1.2, Simple GML, Very Detailed, 3500+ Downloads and counting! |
Dec 19 2007, 04:23 PM
Post
#1
|
|
|
Katamari Devotee Group: GMC Member Posts: 1226 Joined: 14-June 07 From: Missouri, USA Member No.: 81132 |
QUOTE (Local Moderators) Replies to topics in this forum are held to a high standard. Reviews must have a critique or suggestion for use to be approved. Read the rules here. Title: Level_System_Tutorial version 1.2 Size: .94 KB File Type: .gmk Version: Made for GM 7 but includes instructions for GM 6 up Overview: VERSION 1.2 HAS FINALLY ARRIVED! This level system tutorial shows you how to use global variables to make a leveling system for RPG's, or for other games that leveling could be useful in. Please read the complete list of things you will learn as well as the updates in the list below! Direct Link: http://host-a.net/jsmithlmsl/Level_System_Tutorial_v1_2.gmk The tutorial is typed in the games information screen. (F1 in game) Updates in v1.1: 1) Higher goals; you will now need to reach 100 exp to move to the next level. 2) Status bars; you will learn how to draw variables on screen, as well as show thier status using GM's built in healthbars. 3) More GML; v1.0 featured mostly GML, but drawing the variables in Drag and Drop; We will now code everything. 4) Health and an enemy; Hey... Why not? What's a game without being able to die? 5) New HUD; Create a new, nicer hud to place variable information and status bars. 6) Improved 8 directional movement; you'll see... it's better for sure! 7) Rolling over EXP; In v1.0, if you gained over the current exp goal to level up, you would lose that extra exp that was over the goal. That is now corrected in v1.1. If the exp goal is 100 and you have 75 exp at level one and gain 50 more, you will move up to level 2 and that extra 25 exp past 100 you just gained WILL be added to your level 2 exp. Updates in v1.2: 1) All values are now relatively added to their designated variables making coding this a lot easier, shorter, and more accurate, also opening the possibilities of more more levels if you the user chooses to add them... 2) I introduced a skill level to the player which is inaccessible until level 5 is reached, but once it is accessible, the player can launch an attack on his enemy objects 3) There is now an attack system for the player which will in turn, update the players skill level (also inaccessible until level 5 is reached) 4) There is now a defense system for the player which changes the amount of damage the player may receive based off of its value (also inaccessible until level 5 is reached) 5) As the player levels up, he now receives an updated sprite (every 5 levels) 6) Per request, I have once again re-typed this entire example. This took me the good part of a day to do, but it is extremely thorough. THIS EXAMPLE IS THOROUGHLY EXPLAINED, FROM EVERY ACTION, TO A DEFINITION FOR EVERY SINGLE EXPRESSION AND STATEMENT USED IN ALL OF THE CODES 7/1/2009 - LOL... thought I'd see if this was still out there in GMC land. Between this version and the first, we're over 4000 dowloads! BUT, for this guy, 3500 and counting! I'm lazy and will not be updating this anymore. Enjoy and if the link is dead, PM me and I would be glad to re-host it! jsmithlmsl // Joshua Smith This post has been edited by jsmithLMSL: Jul 1 2009, 10:20 PM |
|
|
|
Dec 22 2007, 04:42 AM
Post
#2
|
|
|
GMC Member Group: GMC Member Posts: 792 Joined: 3-July 07 Member No.: 82650 |
Its nice but it cancels out XP gained if you get more than you should at the end of the level, its good 4 nubs
|
|
|
|
Dec 24 2007, 12:15 AM
Post
#3
|
|
|
Katamari Devotee Group: GMC Member Posts: 1226 Joined: 14-June 07 From: Missouri, USA Member No.: 81132 |
That's a good point... I'll update and turn a 1.1. Thanks for the feedback! =)
|
|
|
|
Dec 25 2007, 03:37 AM
Post
#4
|
|
|
Blasterman's Army Leader Group: GMC Member Posts: 280 Joined: 17-May 06 From: Faloin, Andomeda Galaxy Member No.: 50179 |
jon, I agree, it's good for the n00bs. But it has limitations that a few modifications would fix.
Good example, though. |
|
|
|
Dec 25 2007, 05:08 AM
Post
#5
|
|
|
GMC Member Group: GMC Member Posts: 792 Joined: 3-July 07 Member No.: 82650 |
OK, if you need help (I doubt you do cause its simple) but, I suggest that you make into HP bars. But with the exp bar, instead of when on contact it minus's the variable, it adds to it, and that it variable "current_hp" or something is on 0 in the create event. If you have absolutely no idea what im smoking (no-one does
Again, great example, Jon |
|
|
|
Dec 30 2007, 04:55 AM
Post
#6
|
|
|
GMC Member Group: GMC Member Posts: 510 Joined: 11-September 07 Member No.: 88208 |
Nice example, but I suggest (for slightly more experienced users) adding set amounts relative to the current amount, as opposed to saying
CODE if level=1 {defense=5} or something like that, for every single level. NOTE: I actually got this from another example, but I can't remember whose. CODE //This works out whether or not the player is over the xp for the next level if global.xp >= global.nextlevel { global.level += 1 // Add 1 to level global.strength += 1// Add 1 to strength level global.accuracy += 1// Add 1 to defense level global.nextlevel += 10 // adds 10 to the amount of experience needed global.xp = 0 // resets the xp to 0 global.hp = global.level + 9 + global.armor } This is just a copy-paste from my game, I didn't really try to make this special to your situation. |
|
|
|
Dec 30 2007, 03:08 PM
Post
#7
|
|
|
Katamari Devotee Group: GMC Member Posts: 1226 Joined: 14-June 07 From: Missouri, USA Member No.: 81132 |
Astrosapien,
That is a good idea, and actually a real simple fix. I can just start n with a value and add to it through each level. I'll go ahead and slap that in there for v1.2. I will also show speed on screen with another status bar. Another extention: I will be adding a shield variable that say adds 10 relative to it's current value every level we go up, and takes 20 away every time you collide with a comet BUT, for a twist, when the player has some defense/shield (=<20), comet collisions will only take away 1/2 of the normal player damage... Great suggestion adding relative to the current value and thank you for your reply. (Also, the snippet from your game is informative, but if I were to reset exp to 0 every time I level up, I would lose the rollover exp. If I just subtract the relative amount that was needed to level up, the remainder stays "appearing" to roll over. I guess in the case that a game goes 1 point at a time, this would be sufficient though.) Keep the great idea's coming everyone! Josh // jsmithlmsl This post has been edited by jsmithLMSL: Dec 30 2007, 04:59 PM |
|
|
|
Dec 30 2007, 04:36 PM
Post
#8
|
|
|
GMC Member Group: GMC Member Posts: 707 Joined: 31-July 06 From: Canada Member No.: 56008 |
why don't you just use a quadratic or linear formula?
something like global.nextlevel=sqr(global.level)*10 |
|
|
|
Jan 1 2008, 07:35 PM
Post
#9
|
|
|
GMC Member Group: GMC Member Posts: 511 Joined: 18-November 07 Member No.: 93267 |
can i make 3 seperate exp bars using featured codes in this?
|
|
|
|
Jan 2 2008, 03:27 AM
Post
#10
|
|
|
Blasterman's Army Leader Group: GMC Member Posts: 280 Joined: 17-May 06 From: Faloin, Andomeda Galaxy Member No.: 50179 |
I like the new version way better. So, if I use it, who should I credit to?
|
|
|
|
Jan 2 2008, 11:20 PM
Post
#11
|
|
|
Katamari Devotee Group: GMC Member Posts: 1226 Joined: 14-June 07 From: Missouri, USA Member No.: 81132 |
blasterman_95: This would be just fine and thank you.
Credit to jsmithlmsl from the GMC meziathol: Yes. I have sent you a PM with a quick fix to do this, but I will include this in the new version. Astrosapien: You are correct so here is the list of updates I have for the next version of this example that is in the making: V1.2 so far: 1) I am changing the game concept and sprites to represent a more classic style RPG; Though this has no effect on bettering the example itself, I feel that some people may relate more to this in oppose to the planets and stars theme. 2) I will be adding more skills to aquire and build; a great suggestion was pm'd to me that I should add an attack level and a defence level. 3)Astrosapien's post of adding to relative value's in oppose to predetermined values to make for easier coding is on the money and the new version1.2 example will be converted to that method. 4)I will create one single skill that until a certain level is reached, is inaccessible to the player Thank you all for your creative suggestions and please keep them coming! -J |
|
|
|
Jan 3 2008, 09:10 PM
Post
#12
|
|
|
Fail Group: GMC Member Posts: 1591 Joined: 13-August 06 From: My house... Member No.: 57103 |
It's pretty good except i recommend that you add sprite changing and enemy ai and stuff like that then just make it into a RPG Engine.
The only thing i don't understand is that you comment on all of the thing that is easy for anyone to understand like setting the fonts and other drawing options, but you don't comment on the things that can be difficult for new users of GML... |
|
|
|
Jan 4 2008, 06:04 PM
Post
#13
|
|
|
Katamari Devotee Group: GMC Member Posts: 1226 Joined: 14-June 07 From: Missouri, USA Member No.: 81132 |
heyufool_1: Please post or PM me on what I have not explained thoroughly and I would be happy to add more documentation. You are the only person that has brought this to my attention.
As far as the future of this example, I am going to leave this as just a level system, but I have been talking to jon_sploder on including this as well as some other examples I have made and making a full on RPG example fully documented A to Z. I don't want to list details yet because the idea is only in the works, but it would be a zip with .gmks of all the examples and one .gmk of everything combined and working together. Thank you for the feedback and I am looking forward to your reply so I can update ""'s documentation to better this example. -J This post has been edited by jsmithLMSL: Jan 4 2008, 10:04 PM |
|
|
|
Jan 5 2008, 04:48 AM
Post
#14
|
|
|
GMC Member Group: GMC Member Posts: 534 Joined: 15-November 06 Member No.: 63805 |
This is a great, simple, engine which still does the job. I will put this in my game (with modifications).
Cant wait for new version =D 10/10 |
|
|
|
Jan 7 2008, 05:45 PM
Post
#15
|
|
|
Katamari Devotee Group: GMC Member Posts: 1226 Joined: 14-June 07 From: Missouri, USA Member No.: 81132 |
jengajam: Thanks! I'm glad you like it and happy to see it in action. Please PM we when your game is complete; I'd love to see how you utilized this.
-J This post has been edited by jsmithLMSL: Jan 9 2008, 05:55 PM |
|
|
|
Jan 13 2008, 07:06 PM
Post
#16
|
|
|
Katamari Devotee Group: GMC Member Posts: 1226 Joined: 14-June 07 From: Missouri, USA Member No.: 81132 |
Everyone: As promised, I have just released Version 1.2 of my Level Example. I have added as many requests as I could (see my head post) of things that I found to be positive ideas. Check it out if you will and please feel free to post some feed back as I'm curious if there are any other great ideas out there from all of you! Thank you to everyone for the fantastic suggestions and please keep them coming!
jsmithlmsl // Josh |
|
|
|
Jan 31 2008, 12:02 PM
Post
#17
|
|
|
GMC Member Group: GMC Member Posts: 9 Joined: 31-January 08 Member No.: 98798 |
QUOTE (jengajam @ Jan 4 2008, 10:48 PM) This is a great, simple, engine which still does the job. I will put this in my game (with modifications). Cant wait for new version =D 10/10 Ditto - This is an incredible system that you've devised. I'd like to admit, it was difficult sitting here reading through your huge explination without groaning slightly, but some coffee fixed that. This is certainly the best exp system I've ever seen - If you added in more complex features such as other skills other than fighting, I'd be greatly impressed.. who knows? Maybe it'll be become the top download here. I will fully credit you for this in my game, and I hope to see more of your work. |
|
|
|
Feb 1 2008, 03:45 PM
Post
#18
|
|
|
Katamari Devotee Group: GMC Member Posts: 1226 Joined: 14-June 07 From: Missouri, USA Member No.: 81132 |
QUOTE (RPG Gamer @ Jan 31 2008, 06:02 AM) I'd like to admit, it was difficult sitting here reading through your huge explination without groaning slightly, but some coffee fixed that. That is so very true: When I wrote the tutorial, I wanted to explain everything in the simplest terms that I possibly could and not miss a thing, hence, my own converted definition of every function we use in the example. When I finished and stepped back and proof read the tutorial, I myself sighed too. It is extremely long and seems to go forever, but, I wanted to make sure that everyone, even the newest user of Game Maker, could understand how this works and operates, and learn some GML in the process with thorough explanations. QUOTE (RPG Gamer @ Jan 31 2008, 06:02 AM) This is certainly the best exp system I've ever seen - If you added in more complex features such as other skills other than fighting, I'd be greatly impressed.. who knows? Maybe it'll be become the top download here. That is a very nice thing of you to say and I'm very much obliged by your responce. It's nearing the 1000 mark and growing... I'd like to know a little more about what kind of skills you think would make this tutorial better. If you would, please send me a PM with some of your suggestions and perhaps we can get version 1.3 up and moving. QUOTE (RPG Gamer @ Jan 31 2008, 06:02 AM) I will fully credit you for this in my game I appreciate that and please PM me with a link to your game when you are finished or have made a demo. I would love to see how you incorporated and utilized this system. QUOTE (RPG Gamer @ Jan 31 2008, 06:02 AM) I hope to see more of your work. Same to you! |
|
|
|
Apr 3 2008, 12:04 PM
Post
#19
|
|
|
GMC Member Group: GMC Member Posts: 3 Joined: 3-April 08 Member No.: 103680 |
Ey everybody, well, you asked someone else which skills should be added, i was thinking of:
-Home Building -Removed for own use -Cooking -Fishing -Farming -Removed for own use -Removed for own use -Removed for own use -Woodcutting -Firemaking -Removed for own use -Thieving -Agility (the higher, the faster you move) If you wanna know some more, just send me a PM and i'll have a look Reward for you: Credits in my coming game, and if possible, you become a Moderator. Greetings, anasky This post has been edited by anasky: Apr 9 2008, 05:26 AM |
|
|
|
Apr 4 2008, 02:38 PM
Post
#20
|
|
|
Katamari Devotee Group: GMC Member Posts: 1226 Joined: 14-June 07 From: Missouri, USA Member No.: 81132 |
Good ol' Rune Scape Re-Creations... Many projects heard of and started, but never seen again...
Hello Anasky! First, thank you for downloading the example and I hope you enjoyed and learned from it. You suggested quite a few new skills, and to that request, this is my reply: If I were to actually add all of those skils to this tutorial, the scene would have to change to fit to fit the skills (new sprites, new backgrounds, lot's of changes). Now that I'm thinking about it, if I were to add those Sprites and animations and tiles and skills and more attacks, I'm a text box and 50 missions shy of creating a game by itself. I do appreciate your suggestions and I did ask for new Idea's, but this is a little far fetched as to bettering the general idea of this tutorial. I wanted to show a simple, easily implemented level system that anyone could add, use, or just read to learn a little GML. As for your suggestions, you could easily add those into your game. Go back over the tutorial until you have a good understanding on why we do what we do, where we do it, and what for, and you should have no problem creating your own skills, for example: Wood Cutting: You create a global variable called global.wood_cutting=0;. In your game, you allow the player to achieve an axe. If the player is within a distance of a tree, and presses a button © that acts as the "swinging" of the axe, you could test the value of global.wood_cutting and determiine how many swings it will take to cut down the tree. Within the tree, you create a variable called tree_strength. You set this to a number that goes against global.wood_cutting. You now have a basis of swings to cut down the tree: the power of wood_cutting versus the power of the tree_strength. Every swing, you deduct the value of global.wood_cutting from the varable tree_strength. Once tree_strength is depleated, you change the tree sprite to a stump and add some points to global.tree_cutting, making the player's swing stronger. Coded example: Tree object's create event: CODE tree_strength=25; Tree object's collision event with obj_player: CODE if obj_player.sprite_index=spr_cutting and tree_strength>0 { tree_strength-=global.wood_cutting; if tree_strength<=0 { global.wood_cutting+=1; sprite_index=spr_stump; } } Obj_player's create event: CODE cutting=false; Obj_player's step step event: CODE if (cutting=true) exit; if keyboard_check(ord('C')) and cutting=false { sprite_index=spr_player_swing_axe; cutting=true; alarm[0]=10; exit; } Obj_player's Alarm 0 Event: CODE cutting=false; sprite_index=spr_player_stand; That's just off of the top of my head and that code would probably need some work, but I wrote it so you could compare. There is very little difference between that code and the example itself. You can add your own variables and skills easily. As for my example, I'm going to leave it as is for now, but if you would like me to make a small personlized example and work with you a little to help you understand how to implement new skills, go ahead and PM me and I would be glad to try and help you get started. Cheers, Josh |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 9th February 2010 - 01:45 PM |