Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
BoomerET
Senior Member
 
Join Date: Apr 2012
Location: Livermore, CA
Posts: 492
Send a message via ICQ to BoomerET Send a message via Yahoo to BoomerET Send a message via Skype™ to BoomerET

Old May 1st, 2014, 07:52 PM
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?

Castles & Crusades Ruleset for Hero Lab
Hero Lab (5E D&D) -> Fantasy Grounds Character Converter

Last edited by BoomerET; May 1st, 2014 at 08:12 PM.
BoomerET is offline   #1 Reply With Quote
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633

Old May 1st, 2014, 08:53 PM
Quote:
Originally Posted by BoomerET View Post
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.

RavenX Pronouns: She/Her

Please do not PM me to inquire about datafiles I coded "for personal use" such as Exalted, World of Darkness, AD&D, or Warhammer 40K Roleplaying. I appreciate your interest, but I do not own the Intellectual Property rights to these game systems. Nor do I have permission from any of the Publishers to distribute the data files. As such, I cannot distribute the work I have done with community on these files. They are "for personal use" only. Thank you.

I am far too busy these days to answer emails. If you message me here there is no guarantee I will get back to you at all.
RavenX is offline   #2 Reply With Quote
BoomerET
Senior Member
 
Join Date: Apr 2012
Location: Livermore, CA
Posts: 492
Send a message via ICQ to BoomerET Send a message via Yahoo to BoomerET Send a message via Skype™ to BoomerET

Old May 1st, 2014, 09:25 PM
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

Castles & Crusades Ruleset for Hero Lab
Hero Lab (5E D&D) -> Fantasy Grounds Character Converter
BoomerET is offline   #3 Reply With Quote
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633

Old May 1st, 2014, 09:26 PM
It's always done that for me and I've been doing this for three years now with it.

RavenX Pronouns: She/Her

Please do not PM me to inquire about datafiles I coded "for personal use" such as Exalted, World of Darkness, AD&D, or Warhammer 40K Roleplaying. I appreciate your interest, but I do not own the Intellectual Property rights to these game systems. Nor do I have permission from any of the Publishers to distribute the data files. As such, I cannot distribute the work I have done with community on these files. They are "for personal use" only. Thank you.

I am far too busy these days to answer emails. If you message me here there is no guarantee I will get back to you at all.
RavenX is offline   #4 Reply With Quote
BoomerET
Senior Member
 
Join Date: Apr 2012
Location: Livermore, CA
Posts: 492
Send a message via ICQ to BoomerET Send a message via Yahoo to BoomerET Send a message via Skype™ to BoomerET

Old May 1st, 2014, 10:09 PM
Guess I just never noticed it before.

Guess I can stop w/ the CTRL-C

Castles & Crusades Ruleset for Hero Lab
Hero Lab (5E D&D) -> Fantasy Grounds Character Converter
BoomerET is offline   #5 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 07:15 AM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.