Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System

Notices

Reply
 
Thread Tools Display Modes
Illyahr
Senior Member
 
Join Date: Feb 2013
Posts: 250

Old March 23rd, 2019, 02:36 PM
Working on a template that reduces some stats, but not below 3. I think I have the right code, but it isn't working.

Code:
var intval as number
intval = minimum(hero.child[aINT].field[aNormal].value-3,6)
hero.child[aINT].field[aNormal].value -= intval
It should check what attribute-3 is and apply either that (making the score 3) or 6 as a penalty to the attribute. What am I doing wrong?
Illyahr is offline   #1 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 2,700

Old March 25th, 2019, 05:17 AM
Quote:
Originally Posted by Illyahr View Post
Working on a template that reduces some stats, but not below 3. I think I have the right code, but it isn't working.

Code:
var intval as number
intval = minimum(hero.child[aINT].field[aNormal].value-3,6)
hero.child[aINT].field[aNormal].value -= intval
It should check what attribute-3 is and apply either that (making the score 3) or 6 as a penalty to the attribute. What am I doing wrong?
Hard to say without knowing your results or doing some testing. I might suggest a different approach, though. Something like this, perhaps:

Code:
var intval as number
intval = hero.child[aINT].field[aNormal].value-6
hero.child[aINT].field[aNormal].value = maximum(intval,3)
Sendric is online now   #2 Reply With Quote
Illyahr
Senior Member
 
Join Date: Feb 2013
Posts: 250

Old March 25th, 2019, 06:07 AM
I'll give it a try
Illyahr is offline   #3 Reply With Quote
Illyahr
Senior Member
 
Join Date: Feb 2013
Posts: 250

Old March 30th, 2019, 12:42 PM
Ok, what I have is:

Code:
Phase=Preattributes, Priority=10000
var intval as number

intval = hero.child[aINT].field[aNormal].value-3
intval = minimum(intval,6)

hero.child[aINT].field[aNormMod].value -= intval
At this timing, it calculates Int as 0 and, consequently, comes back with -3. It then subtracts -3 from your score, adding 3. I've tried playing around with timing, but if I try it after the Pre-attributes phase, the code doesn't add or subtract anything. I'm at a loss here.
Illyahr is offline   #4 Reply With Quote
Lord Magus
Senior Member
 
Join Date: Jan 2011
Location: Quebec, QC, Canada
Posts: 350

Old March 31st, 2019, 04:21 AM
Quick pointers, i hope they help

If Phase is Pre-Attributes, attributes have not yet been determined, so you cannot manipulate them. Timing should be later (Post attributes?)

minimum(interval,6) would return the lowest value between int-3 and 6, which doesn't sound like what you're gunning for here. Use maximum (int-3,3) instead
Lord Magus is offline   #5 Reply With Quote
Illyahr
Senior Member
 
Join Date: Feb 2013
Posts: 250

Old March 31st, 2019, 06:35 AM
Quote:
Originally Posted by Lord Magus View Post
minimum(interval,6) would return the lowest value between int-3 and 6, which doesn't sound like what you're gunning for here. Use maximum (int-3,3) instead
It actually is. I was trying to find whichever was lower, int-3 or 6, and applying that as a modifier to the final score
Illyahr is offline   #6 Reply With Quote
Lord Magus
Senior Member
 
Join Date: Jan 2011
Location: Quebec, QC, Canada
Posts: 350

Old March 31st, 2019, 10:55 AM
Quote:
Originally Posted by Illyahr View Post
It actually is. I was trying to find whichever was lower, int-3 or 6, and applying that as a modifier to the final score
Sorry, stayed stuck on the initial "reduces some stats, but not below 3" request.
Lord Magus is offline   #7 Reply With Quote
Reply

Thread Tools
Display Modes

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 06:41 AM.


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