Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
Quote:
What I was thinking of doind, although I am not sure it is possible, is set up some sort of script in the custom ability that says "ignore the first validation error coming from the selection of too many spells on the wizard panel." and then "If the validation error is being ignored, apply -1 temporary damage to Con". Is there any way to script the ignoring of a validation error from a specific source? if not, how do you suggest I impletment the ability? |
|
#31 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
I tried that just now Lazarus, no luck
|
#32 |
Junior Member
Join Date: Dec 2007
Posts: 22
|
What phase are you doing it in? I've found that it's very finicky to when it goes: I suspect if you try it in the Final phase, you'll see the bonus adding in. Hm. I see you've already got it going in the Final ... perhaps the tag isn't correct?
Laz Beware the JabberOrk |
#33 |
Junior Member
Join Date: Dec 2007
Posts: 22
|
One option you could use is to take a look at the xml files for something that has "while shield is equipped" checked.
Also, mind if I muck about with your script a bit? Here's something that's more efficient: Code:
var bonus as number bonus = #hasfeat[fShieldFoc] + #hasfeat[fGrShieldF] ~ is a 1 if one of them, 2 if both ~ NOTE: this is going to add the number of Shield Focus feats in. This is non-SRD stuff :p if (hero.tagis[Hero.EquipShld] <> 0) then hero.child[ArmorClass].field[tACShield].value += bonus endif Laz Beware the JabberOrk |
#34 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
Thanks Lazarus, by all reason that should work. I just tried it out myself but it is not working exactly correctly.
When I enable debugging and click View - Show Selection Fields - Armor Class it breaks down the different sources of AC change, and it shows when I equiq a heavy shield the Shield bonus as +3, but the normal AC and Flat footed AC still only recieve +2. Very wierd. I added 2 extra lines hero.child[ArmorClass].field[tAC].value += bonus hero.child[ArmorClass].field[tACFlat].value += bonus and now it works. Thanks for all your help, you know it's always the little things that mess me up. |
#35 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
Is there a way to multiply in this programing language? Like say I wanted to double a creatures base land speed when adding a template, how would I code that?
|
#36 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Here's a script I got to work for 1/2 movement:
Timing: Final/10000 ~Spd/2 hero.child[Speed].field[tSpeedMod].value = hero.child[Speed].field[tSpeedMod].value/2 |
#37 |
Senior Member
Join Date: Jul 2007
Location: Syracuse, NY (USA)
Posts: 213
|
To double the movement just use:
hero.child[Speed].field[tSpeedMod].value = hero.child[Speed].field[tSpeedMod].value*2 |
#38 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
Thanks for the help with the Speed doubling, now I know multiplication is * and division is /. I ended up doing it differently though, the script I used is
~ Double our Base speed hero.child[Speed].field[tSpeedMod].value = hero.child[Speed].field[tSpeed].value Which doesn't seem like it should work to me, because in the help files it says tSpeedMod is the final modified speed for the hero... but actually it seems to be the final modifier that is added to the base speed. |
#39 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
Now another question, how do you replace one tag with another? I am adding an ability that negates encumberance, and the script I am trying is :
var result as number if (hero.tagis[Encumbered.Medium] = 0) then result = hero.assign[Encumbered.Light] elseif (hero.tagis[Encumbered.Heavy] = 0) then result = hero.assign[Encumbered.Light] My hero is still showing medium encumberance, and his Dex bonus to AC is reduced. I think the problem is that although the Light encumberance tag is being assigned, the Medium or heavy tags are still there and overriding it.... I am aware of the hero.assign command, but is there an opposite to this that removes the tag? I tried "hero.disable" and "hero.remove" though neither worked. An alternate method may be to fiddle with the encumberance table and set the Light encumberance for the hero to some insanely high weight, or if there is a way to override the max Dex bonus to AC due to encumberance that is also peachy. Again, don't know how to do either of these things. |
#40 |
Thread Tools | |
Display Modes | |
|
|