• 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

Need Help with eval script: Increasing size with a class ability.

Demontank

New member
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?
 
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:
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.
 
Back
Top