Junior Member
Join Date: Feb 2016
Posts: 20
|
I am trying to implement a house rule subrace in 5e where the race sets your Dex score at 14 if it isn't there already. (We use reincarnation so dumping Dex and taking this race is not a concern). This means if you have an 8 Dex, it becomes 14 (post reincarnation) but if you have a 15 nothing happens. I cannot for the life of me figure out how to set a minimum like this and I could use a hand or direction.
Can someone help me out? I have: if (hero.child[aDEX].field[Bonus].value < 14) then hero.child[aDEX].field[Bonus].value = 14 endif This is adding 16 to all CHA scores period, and I don't see why... Last edited by Caedhros; February 3rd, 2016 at 05:35 PM. |
#1 |
Junior Member
Join Date: Feb 2016
Posts: 9
|
likely because you're adding 16 to the charisma bonus when the bonus is less than 16. If the character doesn't get a bonus of itself, it will add 16. If it does (Say Dragonborn) it will turn the bonus into 16.
|
#2 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
So like a minimum of 14? Couldn't you do something like:
hero.childfound[aDEX].field[aNormal].value = maximum(hero.childfound[aDEX].field[aNormal].value, 14) |
#3 |
Junior Member
Join Date: Feb 2016
Posts: 20
|
Well, I tried. I apparently was not born to program! I can't get the "<" to work at all and nothing happens at all when I use the [aNormal] tag instead of [Bonus]. I'll keep playing with it and I'll let you know if I get anywhere.
|
#4 |
Junior Member
Join Date: Feb 2016
Posts: 20
|
I think I got it mostly:
hero.child[aDEX].field[Minimum].value = maximum(hero.child[aDEX].field[Minimum].value,14) hero.child[aDEX].field[aMaxValue].value = maximum(hero.child[aDEX].field[aMaxValue].value,14) This does everything but doesn't make it part of the starting stat the way using [aStartMod] does, but I can't figure out how to use [aStatMod] in this equation, HL keeps rejecting it. oh well. Last edited by Caedhros; February 3rd, 2016 at 07:44 PM. |
#5 |
|
|