Junior Member
Join Date: Mar 2018
Posts: 2
|
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?
|
#1 |
Junior Member
Join Date: Jun 2016
Posts: 23
|
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. |
#2 |
Junior Member
Join Date: Mar 2018
Posts: 2
|
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.
|
#3 |
|
|