• 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

Increasing Reach

furby076

Well-known member
Anyone know of a way to create a custom ability that increases reach by 5 feet? So when the class ability is active, the character reach increases by 5.

WHat i currently have, in class special:

foreach pick in hero from BaseWep where "wCategory.Melee"
eachpick.field[wReach].value = maximum(eachpick.field[wReach].value,5)
nexteach
 
foreach pick in hero from BaseWep where "wCategory.Melee"
eachpick.field[wReach].value = maximum(eachpick.field[wReach].value,5)
nexteach

Have you tried

Code:
 foreach pick in hero from BaseWep where "wCategory.Melee"
    eachpick.field[wReach].value += 5
  nexteach

I put this in as a feat at Pre-levels 10000 and all my weapons equipped gain 5 feet reach - should work the same as a class feature. I'm not sure why you're trying to set the reach to a maximum value
 
I created this, using pre-levels 10000

if (field[abilActive].value <> 0) then
foreach pick in hero from BaseWep where "wCategory.Melee"
eachpick.field[wReach].value += 5
nexteach
endif

Not working. 5e fyi.
It's a class special (GIant Growth).
 
TLDR:
Probably need to sacrifice something to a script god like ShadowChemosh to get the correct answer, I understand scripting but not enough for this one.

My Experience Long Read Version:
It works for me in 5e. I created a test class and gave it the custom ability as you have it coded at level 1.

When I activate the ability on the In-Play tab, the weapons all gain 5 feet reach when I look at the statblock. What doesn't update is the reach in the basics pane - but then again you're not changing the reach of the base race or any of the basic stats - you're changing the reach of each weapon with the script you're using and the only way to see weapon reach stats reliably is in the File -> Output statblock or the debug fields on the weapon, it doesn't show the reach stat anywhere else that I can tell, not even the tactical console.

Only other way to change the size/reach would be to manipulate the base race statistics somehow.

The debug info on the size/reach on the Abilities tab doesn't even show a global reach field or tag - it must be baked in the basic info somewhere and I'm not sure how to grab that information.
 
I assume you are trying to modify the value you see in the Summary tab "Basic" correct? These type of fields are stored on the "hero" level container which in HL is the highest most container.

In HL go to "Develop->Floating Info Windows->Show Hero Fields" and in the little search box type in "reach". You will now see two fields one with a value and one that holds text.

To access a Hero field you use this type of transition script:
Code:
herofield[FIELD_NAME].value += 5

Going to assume armed with this knowledge you can now write a script to affect the reach value. :)
 
Now why would you assume that armed with knowledge i can get this stuff done? :(

Pre-levels, 10000

if (field[abilActive].value <> 0) then

herofield[tReach].value += 5
endif

Did nothing for me.
 
Another way i tried (no go)
if (field[abilActive].value <> 0) then
hero.childfound[Reach].field[tReach].value += 5
endif
 
I had to fiddle a bit - seems like if the script is run in the early timing phases gets overwritten by the base race. When I was initially testing I was running the script without a base race selected yet so it would work until I selected a race....

So when I put the following in at Render 10000

if (field[abilActive].value <> 0) then
herofield[tReach].value += 5
endif

It seems to "work", the basic pane gets the 10' reach, but when you debug the individual weapons, they are stuck at 5' reach.
So as a hack I stuck the original weapon code after it and now both update. So final script running at Render 10000 (and it stays working after a client restart) is:
Code:
if (field[abilActive].value <> 0) then
  ~ adjust personal reach
  herofield[tReach].value += 5
  ~ adjust all the weapons
  foreach pick in hero from BaseWep where "wCategory.Melee"
    eachpick.field[wReach].value += 5
  nexteach
endif

It's always a PITA to figure out timing since there are so many moving parts. I'm pretty sure you could put the tReach code in somewhere earlier and you wouldn't have to use the weapon wReach code...
 
Thank you so much. I've added this to the ability Giant Growth and uploaded the latest version of Mystic v3. Only a few more items to go and the class is fully complete :)

Thanks Dungeon and thank you Shadow (again)
 
just tested with with a werebear template I've been working on. it increased the size and the reach

Code:
      ~if we've been replaced, get out now
      doneif (tagis[Helper.Disable] <> 0) 

     if (field[abilActive].value <> 0) then
         hero.findchild[BaseRace].field[rSizeMod].value + 1
      endif
 
Missed a piece

Code:
      ~if we've been replaced, get out now
      doneif (tagis[Helper.Disable] <> 0) 

     if (field[abilActive].value <> 0) then
         hero.findchild[BaseRace].field[rSizeMod].value = hero.findchild[BaseRace].field[rSizeMod].value + 1
      endif
 
Just FYI that increases size and reach. The OP wanted to just increase reach.

Also use += makes the script way shorter:
Code:
~if we've been replaced, get out now
doneif (tagis[Helper.Disable] <> 0) 
~ If not active get out now!
doneif (field[abilActive].value = 0)

~ Increase size by one step
hero.findchild[BaseRace].field[rSizeMod].value += 1

I like doneif for stop scripts instead of if/end statements. Just seems easier to read.
 
Back
Top