Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - D&D 5th Edition SRD
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Demontank
Junior Member
 
Join Date: Mar 2018
Posts: 2

Old March 25th, 2018, 11:53 AM
Been trying to learn how to use the Eval scripting a bit more effectively over the past few days and have been setting certain tasks for myself to slowly build up a foundation on how the functions and tags interact. I have reached a bit of a roadblock in using references and tutorials when I tried to make a class ability that increases the users size when the ability is activated. Anyone have advice or a method that works?
Demontank is offline   #1 Reply With Quote
smokeh
Junior Member
 
Join Date: Jun 2016
Posts: 23

Old March 26th, 2018, 01:05 PM
There is a size adjustment that calls the 5CSizeChg procedure. As written, that procedure will increase the size based on user input. I had to create an ability that once chosen would increase the size of a minion by 1 size category, and I was able to slightly modify that procedure code to do what I wanted. I've pasted my slightly modified code below, you would need to change the target from minion[Familiar] to the hero, but it should put you in the right area.

It's running for me at First (20000).

Code:
~ Sizemod is the +/- change to apply to the hero's size.
    var sizemod as number
    var iX as number

    sizemod = 1

    ~ Add to size - must come after race and template size set
    minion[Familiar].herofield[tSize].value += sizemod

    ~ Make sure the user didn't try to adjust size greater than Gargantuan (+3), or
    ~ smaller than Tiny (-2)

    minion[Familiar].herofield[tSize].value = maximum(minion[Familiar].herofield[tSize].value, -2)
    minion[Familiar].herofield[tSize].value = minimum(minion[Familiar].herofield[tSize].value, 3)

    ~ Set pointer to our base race    
    perform minion[Familiar].findchild[BaseRace].setfocus
    doneif (state.isfocus = 0)
  
    ~ Based on the races final size reset the hit dice size
  
    ~ Tiny
    If (minion[Familiar].herofield[tSize].value = -2) then
      focus.field[rHDSides].value = 4
    ~ Small
    ElseIf (minion[Familiar].herofield[tSize].value = -1) then
      focus.field[rHDSides].value = 6
    ~ Medium
    ElseIf (minion[Familiar].herofield[tSize].value = 0) then
      focus.field[rHDSides].value = 8
    ~ Large
    ElseIf (minion[Familiar].herofield[tSize].value = 1) then
      focus.field[rHDSides].value = 10
    ~ Huge
    ElseIf (minion[Familiar].herofield[tSize].value = 2) then
      focus.field[rHDSides].value = 12
    ~ Gargantuan
    ElseIf (minion[Familiar].herofield[tSize].value = 3) then
      focus.field[rHDSides].value = 20
    Endif

Last edited by smokeh; March 26th, 2018 at 01:07 PM.
smokeh is offline   #2 Reply With Quote
Demontank
Junior Member
 
Join Date: Mar 2018
Posts: 2

Old March 29th, 2018, 03:23 PM
Thanks, been busy with work so i haven't had the chance to modify and test it yet, but i already see some of the things i did wrong. Most blatantly I was trying to target the completely wrong fields and tags for size.
Demontank is offline   #3 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 06:14 PM.


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