![]() |
Experience system...
I'm debating whether or not i want to start woring on an experience system. I pretty much know how I want it laid out, and how to go about doing it, but I have a few questions regarding "short cuts."
Okay, on GK for example, when get to a certain level, you need x amount of exp to level up. Does this have to be done by something like "if (theexperience>=thenumberblah) { the level goes up one; }" for every individual level, or could I use something mathematical? I don't want to have to go and add all of the codes manually, but I was wondering if there was a set or a few lines that I could make it with to determine when the player needs to level up. |
Well, if your numbers have some form of pattern, then yes its possible.
NPC Code://Example Only. You could also have all the ammounts stored in an array and then just look through it using thier current level as the index. NPC Code://Example Only. If the scripts are wrong well meh its late. They're just examples anyway. |
Quote:
I was going to store them in an array, but I've never really toyed with them before. you'd get them like this, right? experienceammounts = {0,100,300,600}; if (experience >= #I(experienceammounts,2)){ blah } right? I've never used string arrays before, if that's what I would use. |
Quote:
|
Quote:
The syntax for them is experienceammounts[portion#]? Does it start at 0,1,2,...etc or 1,2,3,...etc? |
Arrays start at 0
|
Quote:
You could always access them with somthing like 'ExperienceAmmounts[Level - 1]' instead, so that when you are Level 1, it looks at Position 0 (ie: the first position) in the array. |
| All times are GMT +2. The time now is 04:12 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.