Not Used: Ray spell focus.... why not a ray improved crit?

View previous topic View next topic Go down

Not Used: Ray spell focus.... why not a ray improved crit?

Post by MannyJabrielle on Mon Apr 04, 2011 7:03 pm

Idea for a way to do an "imrpoved crit" feat for ray attacks:

The touchattackmelee and touchattackranged functions only return a "crit" for a 20 roll, and I have not found any function in nwnscript that will return the value of the attack roll...

So... why not do a custom touch-attack function, which would allow also a custom improved critical feat to be used?

This would only work for scripted stuff such as spells, grenade type weapons, and feat based abilities... so no ability to make custom Imp.Crit feats for the CEP weapons... but anyway...

Replace the function touchattackmelee/ranged with "Customtouchattackmelee/ranged.

The function would roll it's own d20, and then add relevant modifiers (add in str modifier for melee touch, dex for ranged touch, what ever other relevant bonuses, ect). It checks that number vs the target's relevant AC.

Same as with normal mechanics... 1 on that d20 is a miss, 20 is auto crit. It could also check, if it hits with the d20 rolling a 19... and caller ahs the imp crit feat... that crits as well.

Tada... imp.crit ray spells feat to accompany the weapon focus ray spells feat!

MannyJabrielle
Ludicrous Level
Ludicrous Level

.: Dungeon Master
Male Number of posts: 5739
Main Character: See the "A-Team" thread in the Biographies forum.
DM Name: Dungeon-Master Gaelen
Time Zone: GMT -5:00(EST)
Registration date: 2008-07-05

View user profile

Back to top Go down

Re: Not Used: Ray spell focus.... why not a ray improved crit?

Post by daveyeisley on Mon Apr 04, 2011 7:11 pm

Great idea! Fantastic!

daveyeisley
Ludicrous Level
Ludicrous Level

.: Dungeon Master
Male Number of posts: 6522
Age: 37
Location: Watching Aenea from my Inner Sanctum on the surface of Sharlo, Aenea's Silver Moon
Main Character: Dave's List of PCs
NWN Username: Dave Yeisley
DM Name: Dungeon Master Mythgar
Time Zone: GMT - 5:00
.:
Registration date: 2008-06-03

View user profile

Back to top Go down

Re: Not Used: Ray spell focus.... why not a ray improved crit?

Post by The Amethyst Dragon on Mon Apr 04, 2011 11:50 pm

Unfortunately, there isn't a practical way of accomplishing this. In order to do it right, you'd need to have a way for the NWScript to get the "touch AC" of a target.

The game engine does this within the TouchAttackMelee and TouchAttackRanged functions (which also does the attack rolls), but only returns a value of 0 (miss), 1 (hit), or 2 (critical hit...aka a 20 + a critical confirmation roll).

NWScript has a function to GetAC, but that's total AC (base 10 + size modifier + dex mod + armor bonus + armor enhancements + shield + shield enhancements + natural armor bonuses + deflection bonuses + dodge bonuses + AC increasing effects + tumble bonuses + monk AC bonuses + expertise bonuses)...it doesn't have a way to separate out just the ones that affect touch AC.

It could possibly be done with a very long and complicated script (which checks through every property of every item worn by the target, checks the target's size, checks the target for class feats and levels, checks through all magical effects on the target, checks if target is using expertise, etc., then uses everything it gathered to calculate a touch AC), but isn't really worth the scripting time or cpu load of constant runs of such a script.

The ray focus feat was actually quite simple to implement right in the spell scripting:
1. check caster for ray focus feat
2. if feat is present, apply +1 attack bonus effect for a fraction of a second so it's there when TouchAttackRanged() is called on the next line of code

_________________
.
------------------------------------- The Amethyst Dragon -------------------------------------
Creator of Aenea | Custom Content Maker | Dungeon Master | Builder | Scripter | Writer | Player | Sleepless

The Amethyst Dragon
Ludicrous Level
Ludicrous Level

.: Creator of Aenea / Dungeon Master
Male Number of posts: 7720
Age: 38
Location: probably on the computer or wrangling his offspring
NWN Username: amethystdragon
DM Name: The Amethyst Dragon
Time Zone: GMT - 7:00 (Arizona)
Registration date: 2008-06-02

View user profile http://www.amethyst-dragon.com/nwn

Back to top Go down

Re: Not Used: Ray spell focus.... why not a ray improved crit?

Post by daveyeisley on Tue Apr 05, 2011 12:10 am

Pardon me for asking if this is totally ignorant... but... obviously, all those things you listed are needed in order to properly calculate Touch AC.... so how could the default touchattackranged possibly get the touch ac without doing the same things?

If the engine itself is doing that work and storing the value somewhere, then we need to discover how to call that value, methinks.

daveyeisley
Ludicrous Level
Ludicrous Level

.: Dungeon Master
Male Number of posts: 6522
Age: 37
Location: Watching Aenea from my Inner Sanctum on the surface of Sharlo, Aenea's Silver Moon
Main Character: Dave's List of PCs
NWN Username: Dave Yeisley
DM Name: Dungeon Master Mythgar
Time Zone: GMT - 5:00
.:
Registration date: 2008-06-03

View user profile

Back to top Go down

Re: Not Used: Ray spell focus.... why not a ray improved crit?

Post by daveyeisley on Tue Apr 05, 2011 1:03 am

Just had a thought about this....

I think we might be looking at this from the wrong angle. Trying to reinvent the wheel, as it were.

You see.... we have the tool that we need to do most of the work already.... the GetAC function.

All that is truly needed to get a touch AC is to strip down the regular AC value of things that dont apply to touch attacks.

Use the GetAC function. Then with that value, subract:

1. Base Armor Value
2. Armor AC bonus
3. Natural Armor
4. Shield Base Value
5. Shield AC bonus

Unless I am missing something, this will result in the true Touch AC of the target.

daveyeisley
Ludicrous Level
Ludicrous Level

.: Dungeon Master
Male Number of posts: 6522
Age: 37
Location: Watching Aenea from my Inner Sanctum on the surface of Sharlo, Aenea's Silver Moon
Main Character: Dave's List of PCs
NWN Username: Dave Yeisley
DM Name: Dungeon Master Mythgar
Time Zone: GMT - 5:00
.:
Registration date: 2008-06-03

View user profile

Back to top Go down

Re: Not Used: Ray spell focus.... why not a ray improved crit?

Post by A_Vagabond on Tue Apr 05, 2011 7:43 am

Flatfooted +/- certain feats, flanked, held, entangled, KD'd etc. etc. There are a slew of variables that can affect AC, which is why almost all of the combat engine is hardcoded and inaccessible to scripting -- it'd be too slow if you could mess with the scripting of the calcs that are done many times per second for every combatant simultaneously in the PW.

A_Vagabond
Worldly Guide
Worldly Guide

Male Number of posts: 258
Age: 45
Registration date: 2010-11-04

View user profile

Back to top Go down

Re: Not Used: Ray spell focus.... why not a ray improved crit?

Post by daveyeisley on Tue Apr 05, 2011 7:45 am

Right. Thats why you use the function Bioware gave us, to take advantage of the work the engine is hardcoded to do. Then you just remove the stuff that would not apply.

daveyeisley
Ludicrous Level
Ludicrous Level

.: Dungeon Master
Male Number of posts: 6522
Age: 37
Location: Watching Aenea from my Inner Sanctum on the surface of Sharlo, Aenea's Silver Moon
Main Character: Dave's List of PCs
NWN Username: Dave Yeisley
DM Name: Dungeon Master Mythgar
Time Zone: GMT - 5:00
.:
Registration date: 2008-06-03

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum