• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Leveling code

BoomerET

Well-known member
My leveling code is a mess.

Here's an example:
Code:
if (field[resMax].value < 2101) then
  hero.child[resBtH].field[resMax].value = 0
  hero.child[resXP].field[resExtra].value = 2101
  hero.child[resLevel].field[resMax].value = 1
elseif (field[resMax].value < 4701) then
  hero.child[resBtH].field[resMax].value = 1
  hero.child[resXP].field[resExtra].value = 4701
  hero.child[resLevel].field[resMax].value = 2
elseif (field[resMax].value < 9401) then

resBtH is Base to Hit
resExtra of resXP is XP needed for next level.
resmax of resLevel is the current characters level.

That's for one class of 12, and only to check for the 1st and 2nd level.

So, there must be some other way to do it, in non-HL code, I'd try to use an array of some sort.

Anyone have advice, because the way I have it right now, I'm close to the max of if/then statements. (Found that out the hard way and had to recode some sections)


BoomerET

Edit: I see arrayrows and matrixcolumns, maybe that's the way to go?
 
Last edited:
My leveling code is a mess.

Here's an example:
Code:
if (field[resMax].value < 2101) then
  hero.child[resBtH].field[resMax].value = 0
  hero.child[resXP].field[resExtra].value = 2101
  hero.child[resLevel].field[resMax].value = 1
elseif (field[resMax].value < 4701) then
  hero.child[resBtH].field[resMax].value = 1
  hero.child[resXP].field[resExtra].value = 4701
  hero.child[resLevel].field[resMax].value = 2
elseif (field[resMax].value < 9401) then

resBtH is Base to Hit
resExtra of resXP is XP needed for next level.
resmax of resLevel is the current characters level.

That's for one class of 12, and only to check for the 1st and 2nd level.

So, there must be some other way to do it, in non-HL code, I'd try to use an array of some sort.

Anyone have advice, because the way I have it right now, I'm close to the max of if/then statements. (Found that out the hard way and had to recode some sections)


BoomerET

Edit: I see arrayrows and matrixcolumns, maybe that's the way to go?

Use an array or matrix. It will save you a lot of grief on this.
 
Another thing I've noticed.

I used to hit CTRL-C to compile, then CTRL-R to reload.

Now I'm seeing that CTRL-R does a compile and reload, when did that start?


BoomerET
 
Back
Top