+-+-

+-User

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+-Stats ezBlock

Members
Total Members: 177
Latest: Tdotku1911
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 755
Total Topics: 366
Most Online Today: 6
Most Online Ever: 55
(May 13, 2020, 03:23:39 AM)
Users Online
Members: 0
Guests: 4
Total: 4

Script to assign the highest attribute for a power

Started by Cryptoknight, December 19, 2012, 10:19:58 PM

Previous topic - Next topic

Cryptoknight

Priority: 5000
Timing: After (Calc attrBonus)


var bonus as number
var attidstr as string

~ Use Int as default - this might not be necessary
bonus = #attrbonus[attrInt]
attidstr = "attrInt"

~ Find highest bonus
foreach pick in hero from Attribute
  if (eachpick.field[attrBonus].value > bonus) then
    bonus = eachpick.field[attrBonus].value
    attidstr = eachpick.idstring
  endif
nexteach

~ Use that as the damage and attack attributes
perform assignstr["DamageAttr." & attidstr]
perform assignstr["Attack." & attidstr]

Bleak Midwinter

Firstly, thanks so much for preserving 4E for those of us who are unimpressed by Next.

Completely new to Hero Lab. How do I use this to let a Warlock pick "Constitution" as the basis for their Eldritch Strike power? I have tried to Google and look at the main Hero Lab forum, but I'm none the wiser ...

Fox Lee

Bleak Midwinter, I believe there's already a fix available for that, so you don't have to mess around with the script yourself. Check out  this patch in the Downloads section.

It's a slightly messy fix - it seems MagicSN had to create two listings for the Warlock during class selection in order to get it to work - but it does work. You should be able to select Warlock (Melee) as your class to get a fully functional Con-or-Cha Eldritch Strike.

Cryptoknight

That should show up in the download from the updates I've pushed up.

Shouldn't need the patches here unless you're looking to manage your own codebase... just take the last update I pushed up for HL4e and it should come down.

Bleak Midwinter

Thank you both for the rapid response. Unfortunately I want to do this for a Hybrid Warlock, so I can't simply select the Warlock (Melee) option. I'm hoping to understand the mechanics for how to do it as I have a nasty feeling that Hybrid is going to be repeatedly a nuisance!

Fox Lee

Ah junk, Hybrids are always a bit of a sticky wicket. It probably needs to same treatment (that is, a variant for the melee version of the hybrid). If you want to try it yourself, the best way is probably to look at the both the Hybrid Warlock and the Warlock (Melee) variant in the editor and see what you can copy from one to the other. If you make your own user file and create copies of things you want to adjust, you can't really break them any worse than what a quick reboot can fix.

Bleak Midwinter

Is there a walkthrough somewhere that will explain how to do this?

Fox Lee

Not that I'm aware of, I'm afraid. Somebody else might know of a link, but I just learned by poking around in it and reading the documentation included (which is definitely not very approachable).

Cryptoknight

Actually, look at the way I fixed the Templar (Cleric) to allow for Battle Cleric's Lore vs Healer's Lore

It's the same sort of fix for Melee/non melee warlock, and something I've been meaning to get to (time just never is there) to change the way the warlock works.

Bleak Midwinter

Thanks. I'm more than willing to do this but I just don't know where to start. The documentation around HeroLab is impenetrable to me as a non-programmer. Where did you all learn how to do stuff in it?

Bleak Midwinter

In the end, I managed this by duplicating Eldritch Strike, one being for Con and one for Cha, different strings and stats. Seems to work (but I've only included the Con one on a character). I edited the ddi_powers and ddi_classes to make that possible.

Cryptoknight

I'd look at Eldritch Blast and see how it lets you choose CHA or CON and do the same thing for Eldritch Strike.

+-Recent Topics

4e wont open due to duplicate files error by Fox Lee
April 14, 2024, 01:01:14 AM

Community Data files update 2023-02-16 by Tdotku1911
September 28, 2023, 08:52:54 PM

Errors from last update by jrmcnz
July 17, 2023, 03:30:56 PM

Community Data files update 2023-04-28 by Fox Lee
April 27, 2023, 09:40:45 PM

3rd Party - Zeitgeist character options by Fox Lee
March 25, 2023, 03:21:38 AM

Community Data files update 2023-03-25 by Fox Lee
March 25, 2023, 02:46:40 AM

Our Unofficial Update for Hero Lab 4e by jklagenberg
February 11, 2022, 09:00:52 AM

Kensei Focus - Paragon Path Feature by Charlie
October 21, 2020, 10:13:36 PM

Warlord Scraper Error Fixes by Fox Lee
April 03, 2020, 08:05:51 PM

Herolab 4e Themes Modification by Cryptoknight
July 27, 2019, 02:47:44 AM

Themes Collection by Cryptoknight
July 27, 2019, 02:47:44 AM

Feats Bug Fixes Package by Cryptoknight
July 27, 2019, 02:47:44 AM

Darksun Themes Package by Cryptoknight
July 27, 2019, 02:47:44 AM

Defensive Feats by Cryptoknight
July 27, 2019, 02:47:44 AM

Theme Framework for HeroLab 5 / 4e 4.0 - .HL version by Daphne
July 27, 2019, 02:47:44 AM

2014 09 20 Release by Cryptoknight
July 27, 2019, 02:47:44 AM

2014-09-29 Download by Cryptoknight
July 27, 2019, 02:47:43 AM

2014 11 13 Download by Cryptoknight
July 27, 2019, 02:47:43 AM

Hybrid Battlemind not working as it should by Sean Abel
July 27, 2019, 02:45:49 AM

Please read this and weigh in - Issue/Source/Document Version Control System by nixxrite
March 29, 2019, 07:14:36 AM

Items, Feats and Magic Armour calculations not working by Charlie
March 28, 2019, 01:13:14 PM

Ring Slots by Krigler
March 04, 2019, 06:38:29 AM

Invoker Damage stats by Charlie
September 08, 2018, 07:55:52 PM

Max hit points by Charlie
September 05, 2018, 10:05:12 PM

I have run into a problem with Power class types by Sean Abel
August 18, 2018, 11:43:05 PM

Powered by EzPortal