+- +-

+-User

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

+-Stats ezBlock

Members
Total Members: 125
Latest: Avhagapaphice
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 672
Total Topics: 332
Most Online Today: 4
Most Online Ever: 20
(June 30, 2017, 12:18:50 AM)
Users Online
Members: 0
Guests: 2
Total: 2

Author Topic: Script to assign the highest attribute for a power  (Read 3223 times)

Cryptoknight

  • Administrator
  • Sr. Member
  • *****
  • Posts: 260
    • View Profile
Script to assign the highest attribute for a power
« on: December 19, 2012, 10:19:58 PM »
Priority: 5000
Timing: After (Calc attrBonus)

Code: [Select]
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

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Script to assign the highest attribute for a power
« Reply #1 on: November 30, 2014, 04:00:58 PM »
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

  • Newbie
  • *
  • Posts: 31
  • She Bites
    • View Profile
    • Invincible Ink
Re: Script to assign the highest attribute for a power
« Reply #2 on: November 30, 2014, 11:46:19 PM »
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

  • Administrator
  • Sr. Member
  • *****
  • Posts: 260
    • View Profile
Re: Script to assign the highest attribute for a power
« Reply #3 on: December 01, 2014, 11:52:50 AM »
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

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Script to assign the highest attribute for a power
« Reply #4 on: December 01, 2014, 12:02:38 PM »
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

  • Newbie
  • *
  • Posts: 31
  • She Bites
    • View Profile
    • Invincible Ink
Re: Script to assign the highest attribute for a power
« Reply #5 on: December 02, 2014, 01:08:53 AM »
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

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Script to assign the highest attribute for a power
« Reply #6 on: December 04, 2014, 04:44:16 PM »
Is there a walkthrough somewhere that will explain how to do this?

Fox Lee

  • Newbie
  • *
  • Posts: 31
  • She Bites
    • View Profile
    • Invincible Ink
Re: Script to assign the highest attribute for a power
« Reply #7 on: December 08, 2014, 08:24:48 PM »
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

  • Administrator
  • Sr. Member
  • *****
  • Posts: 260
    • View Profile
Re: Script to assign the highest attribute for a power
« Reply #8 on: December 10, 2014, 03:44:26 PM »
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

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Script to assign the highest attribute for a power
« Reply #9 on: January 14, 2015, 12:23:02 PM »
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

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Script to assign the highest attribute for a power
« Reply #10 on: January 18, 2015, 06:02:02 PM »
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

  • Administrator
  • Sr. Member
  • *****
  • Posts: 260
    • View Profile
Re: Script to assign the highest attribute for a power
« Reply #11 on: January 22, 2015, 12:16:52 PM »
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

Making Utility Powers? by dmayhew469
July 07, 2017, 02:11:16 PM

4e license question by Cryptoknight
June 25, 2017, 09:28:29 PM

Remove/increase limit on Temporary Adjustment value? by Fox Lee
June 22, 2017, 07:30:45 PM

Add the INit modifier for Battle Harness by dmayhew469
June 15, 2017, 08:27:12 PM

Change Attack Ability by dmayhew469
June 15, 2017, 07:57:20 PM

How to allow resistance show up by dmayhew469
June 12, 2017, 04:05:57 PM

Would somebody like to take this over? by dmayhew469
June 09, 2017, 02:02:12 PM

Inherent Bonuses by dmayhew469
June 09, 2017, 01:59:28 PM

No Class or Race options by rkjanik
June 06, 2017, 01:57:21 AM

Spy by Mckinley
May 25, 2017, 02:06:57 AM

Is there a guide out for how to build a race by SAbel
May 05, 2017, 11:59:46 PM

Please read this and weigh in - Issue/Source/Document Version Control System by Charlie
April 27, 2017, 09:54:40 PM

Request Access to the CodePlex System by Charlie
March 03, 2017, 10:47:03 PM

Vampire class by Fox Lee
February 26, 2017, 05:29:29 AM

As we look at Making Card Headers correct colors by dracusmage
February 23, 2017, 03:24:01 PM

Question Involving Twofold Pact for Warlock by dracusmage
February 16, 2017, 02:52:32 AM

Daily Powers by Charlie
February 15, 2017, 06:31:00 PM

Missing Fighter? by dracusmage
February 13, 2017, 10:41:45 PM

Armor at Paragon and above by dracusmage
February 13, 2017, 06:52:16 PM

Help applying bonus damage (x + modifier) to class powers by Fox Lee
January 18, 2017, 06:16:49 AM

Cavalier Summon Steed Patch by Fox Lee
January 15, 2017, 01:00:56 AM

Fey Beast Companions (HotF) by Fox Lee
January 12, 2017, 07:49:08 PM

Has anyone worked with the Warlock (Binder) by SAbel
December 29, 2016, 11:43:17 PM

I will be posting an update soon by SAbel
December 24, 2016, 01:32:41 AM

Weapon Critical damage display by Paragon
December 02, 2016, 06:05:46 PM

Powered by EzPortal