PDA

View Full Version : Some Scripting help


Segallion
June 10th, 2010, 03:45 PM
I'm looking to create a script for the adjustments tab that will take the current Dex Bonus to AC and set that bonus to 0. I've tried looking at the various things already in place but not having much luck.

Thanks in advance for any help you all can offer.

ShadowChemosh
June 10th, 2010, 07:45 PM
Here is a working script that you can use

~Post-attributes 100
~ If we're not enabled, get out now
doneif (field[pIsOn].value = 0)

~ Set Dex bonus to zero
hero.child[aDEX].field[aBonus].value = 0
hero.child[aDEX].field[aModBonus].value = 0

Segallion
June 11th, 2010, 06:01 AM
I appreciate the help Shadow.

I tried the script provided but I'm not seeing any change in the once I click that condition.

I created a new character and gave it a Dex modifier of +1. Click on the condition and nothing changes.

ShadowChemosh
June 11th, 2010, 06:40 AM
Well you asked for an Adjustment not a condition so I wrote it for an Adjustment. :)

The IF statement will need to be changed to work for a check mark on a condition not an adjustment. I am pretty sure they are different fields. I am not near HL now so can't check that.

The other thing is the first line of the script is a comment telling you the timing you have to fill in. That is above where you pasted in the script. Did you set that to be exactly what I had as the timing for this is VERY touchy as I found out when I wrote the script. Setting the correct timing of a script is about as import as writing the script correctly. So just asking as I have seen that to be a pretty common mistake.

The timing you want is Post-attributes 100.

Hope that helps....

Mathias
June 11th, 2010, 07:34 AM
Just curious, what's the difference between the AC without the DEX bonus and the flat-footed AC? The flat-footed AC is already calculated for you.

ShadowChemosh, won't zero-ing out the bonus on the Dexterity alter the Ref save, the CMD, the ranged attack, and any abilities that depend on dexterity, along with the AC?

ShadowChemosh
June 11th, 2010, 08:00 AM
ShadowChemosh, won't zero-ing out the bonus on the Dexterity alter the Ref save, the CMD, the ranged attack, and any abilities that depend on dexterity, along with the AC?
Yep sure will. In matter of fact the timing I took made sure that was all true. Could be I read what he wanted 'exactly' and not what he intended for?

I assumed that he wanted the Dex bonus to zero so that all those other fields would also be altered. Its a good question Mathias to ask what exactly is the end result he is looking for? :)

Segallion
June 11th, 2010, 09:30 AM
Sorry about the confusion...I used "adjustment" because it was in the adjustments tab....it is a condition I'm trying to set up.

Essentially it is Running...when running you lose your Dex bonus to AC, except for someone that has taken the running feat.

Mathias
June 11th, 2010, 09:48 AM
The AC you'll get to when running is the flat-footed AC, so there's no need to calculate that.

ShadowChemosh
June 11th, 2010, 09:58 AM
Sorry about the confusion...I used "adjustment" because it was in the adjustments tab....it is a condition I'm trying to set up.

No problem at all I was being very exact is all. :p


Essentially it is Running...when running you lose your Dex bonus to AC, except for someone that has taken the running feat.
In this case Mathais is right your Flat Footed AC is your AC without your Dex bonus and that is already calculated by HL. The script I wrote above will zero out the Dex Bonus for Everything on the character sheet which is not actually what you want.

If I was going to write this script I think I would just move the FF AC value into the normal AC value if check marked. I would use something like Final 20,500 for timing to make sure it was the last thing done. Of course then you would also want to do a #hasfeat[fRun] to see if you should NOT do that adjustment if they have the run feat.

Not near HL so I can't actually write the script, but the above is how I think I would do it.. :cool:

ShadowChemosh
June 12th, 2010, 09:12 AM
If you still need/want it here is the working script for a new condition that will set your AC to the same as flat-footed value(ie AC with dex).


~Final Phase 20,500
~ If we're not enabled, get out now
doneif (field[pIsOn].value = 0)

~ Set armor class equal to flat-footed value
hero.child[ArmorClass].field[tAC].value = hero.child[ArmorClass].field[tACFlat].value


Hope that helps.

Mathias
June 12th, 2010, 12:38 PM
Rather than using that script, may I recommend copying the Flat-Footed condition? That way, any other scripts that test for Flat-footed before doing something or not doing something will find the condition properly?

Mathias
June 12th, 2010, 04:03 PM
I realized I wasn't quite correct in how to set flat-footed from another condition. Instead, take a look at the Pinned condition - it's Eval Script #3 includes turning on the effects of the flat-footed condition.