Author Topic: Community Patch project - new spell script concept - your thoughs?  (Read 1201 times)

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0


               Hey, Im begin to rewrite all spell scripts to new form. Details are here - Im asking any beginner or experienced scripter what he think of this. Thanks for your opinions.
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Community Patch project - new spell script concept - your thoughs?
« Reply #1 on: August 18, 2010, 09:28:07 pm »


               I wish I knew more about the spells and scripting for them. Not something I've really touched much on. But I say anything that makes the game and scripting for it better and easier, well..I'm all for it.'=]'
               
               

               


                     Modifié par GhostOfGod, 18 août 2010 - 08:28 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Community Patch project - new spell script concept - your thoughs?
« Reply #2 on: August 18, 2010, 11:06:12 pm »


               I don't dare to say it will be easier, it will be different and thats always criticed. However it is necessary and I don't know about better approach.

There is spellsDeclareMajorVariable function definition, this function "loads" all spell info into struct.

struct spell spellsDeclareMajorVariables()
{
struct spell sp;
sp.Caster = OBJECT_SELF;
sp.Target = GetSpellTargetObject();
sp.Item = GetSpellCastItem();
sp.Loc = GetSpellTargetLocation();
sp.Id = GetSpellId();
sp.DC = GetSpellSaveDC();
sp.class = GetLastSpellCastclass();
sp.Meta = GetMetaMagicFeat();
 if(GetIsObjectValid(sp.Item) || sp.Meta == METAMAGIC_ANY)//odd behavior when spell was cast from item
 {
 sp.Meta = METAMAGIC_NONE;                                //do not change this!
 }
sp.Level = GetCasterLevel(sp.Caster);
 if(sp.Level < 1)//sanity check, this should never happen
 {
 sp.Level = 1;
 }
return sp;
}

As you can see, by this I fixed the metamagic and spell from item bug, and this also allow builder to easily change the any part of the spell variables. For example if I would want to add Pale Master level to caster level, I would add this code into function upside.

 if(sp.class == class_TYPE_WIZARD || sp.class == class_TYPE_SORCERER || sp.class == class_TYPE_BARD)
 {
sp.Level+= GetLevelByclass(class_TYPE_PALE_MASTER,sp.Caster);
 }

It needs to recompile all spells but thats not problem.

Odd, forum automatically downcase any class and class to "class" <><>

               


                     Modifié par ShaDoOoW, 18 août 2010 - 10:13 .
                     
                  


            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Community Patch project - new spell script concept - your thoughs?
« Reply #3 on: August 19, 2010, 12:25:01 am »


               I think it's high time someone makes an include which addresses some of the issues out there, also, maybe add some HGLL code for legendary level checks, to increase DC, based upon XP, and not level (for level 40 and beyond).

Epic DC is something that needs adjusting of course, and you should of course create a custom cap based upon the level of the spell, which should be adjustable too..

I praise you for wanting to take on this project, it's something the community has needed for a very long long time... The include of course would need to have all of the adjustments in them, and make sure you tell the builders not to overwrite bioware scripts when importing, which can cause bugs...
(I Hope you know what I'm talking about here..)

Finally, I'd like to say, this should also be available in hak pak version as well, for ease of use, and possibly some good addons, like True Deweomers (Level 40 Required), just an idea..

Good luck on this ShaDoOow, I hope you make this mate..
               
               

               


                     Modifié par Genisys, 18 août 2010 - 11:25 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Community Patch project - new spell script concept - your thoughs?
« Reply #4 on: August 19, 2010, 12:43:56 am »


               Epic DC, custom cap, everything is easily possible by adjusting the new spell concept include library. I have no plan to add it though, but some quick guide and tutorial how to do it is possible.

It will come in the override version so there wont be need to import anything in order to avoid overwritting conflict. The hak version is possible but rather as requirement to log in to some server (and the patch is designed to avoid this),just by adding modified hak version of patch (without scripts and blueprints) with installation. If some builder would want to force players to have it, he would just need to add the hak into module hak list. However there is really no reason to do this, most stuff is server side(2das, creatures, scripts) and works even if player dont have the patch. The rest is once again only client-side, only player will see it (hands/icons/etc)
               
               

               


                     Modifié par ShaDoOoW, 18 août 2010 - 11:46 .
                     
                  


            

Legacy_the.gray.fox

  • Full Member
  • ***
  • Posts: 214
  • Karma: +0/-0
Community Patch project - new spell script concept - your thoughs?
« Reply #5 on: August 19, 2010, 03:24:07 am »


               A most noble intent you have.
But...

... you begin with spellscripts.
Then you want to fix the Spell Resistance checks.
Then you want to fix the handling of Metamagic.
Then you want to fix the Dispel system.

Just these first 3 hits make you rewrite like 400 scripts.

Then you notice that the Holy Avenger too is in need of a fix.
Then you want to handle *correctly* the manual unsummoning of a summoned creature (because it introduces a pair of hideous bugs with the dispel system).

Then you notice that the Polymorph spells/abilities host bugs from begin to end.
For example, try to polymorph to something that gives you a Temporary Hit Points boost (any but Tenser's Transformation. That one is the only spell handled correctly in this regard).
Then be harmed by somebody. Then perform a manual Character Export, via GUI.
Your character instantly returns to full Hit Points and full Temporary Hit Points. Nice exploit, is not it?

Then you want to fix the bug of spell-related feats.
Try to apply a Spell Resistance Decrease to a level 12+ Monk... see what happens.

I can go on, trust the fox.
I have been working on this for 3 years now.

And the end result is a set of scripts and 2da that become highly incompatible with almost everything out there. The vast majority of problems related to spells can be fixed. I did.
But the price to pay? Headaches to no end. And a package that only a confident modder can plug into his modules.

Is this all really worth your time?


-fox
               
               

               


                     Modifié par the.gray.fox, 19 août 2010 - 02:26 .
                     
                  


            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Community Patch project - new spell script concept - your thoughs?
« Reply #6 on: August 19, 2010, 11:30:20 am »


               Sounds like Fox has been down this road, maybe he has a very valid point, truly...



I have to admit ShaDoOow, I'm a little lost now on exactly what your doing, because I was thinking maybe you were going to rewrite all the spell script which included an include and custom modifications which builders could adjust...  It seems to me this would be the BEST way to handle ALL problems, and to expand the base bioware spell systems...



Now that the community is quite developed in scripting, most builders that is, I think it would be a trivial thing for any of us to come up with our own reworking of spell coding... I've been staring at code for a solid 3 years and my proficiency at reading it, is pretty good, but I'm not knowledgable about structs, can you elaborate about your intentions with the above struct more indepth?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Community Patch project - new spell script concept - your thoughs?
« Reply #7 on: August 19, 2010, 12:06:58 pm »


               

the.gray.fox wrote...

A most noble intent you have.
But...

... you begin with spellscripts.
Then you want to fix the Spell Resistance checks.
Then you want to fix the handling of Metamagic.
Then you want to fix the Dispel system.

Just these first 3 hits make you rewrite like 400 scripts.

Then you notice that the Holy Avenger too is in need of a fix.
Then you want to handle *correctly* the manual unsummoning of a summoned creature (because it introduces a pair of hideous bugs with the dispel system).

Then you notice that the Polymorph spells/abilities host bugs from begin to end.
For example, try to polymorph to something that gives you a Temporary Hit Points boost (any but Tenser's Transformation. That one is the only spell handled correctly in this regard).
Then be harmed by somebody. Then perform a manual Character Export, via GUI.
Your character instantly returns to full Hit Points and full Temporary Hit Points. Nice exploit, is not it?

Then you want to fix the bug of spell-related feats.
Try to apply a Spell Resistance Decrease to a level 12+ Monk... see what happens.

I can go on, trust the fox.
I have been working on this for 3 years now.

And the end result is a set of scripts and 2da that become highly incompatible with almost everything out there. The vast majority of problems related to spells can be fixed. I did.
But the price to pay? Headaches to no end. And a package that only a confident modder can plug into his modules.

Is this all really worth your time?


-fox

Spell resistance and metamagic handling is included in the rewrite im going to make. Dispell will be probably too, but I don't know how the dispell should work yet. Right now the MD is unbeatable and other dispells are unusable at higher levels.

For HA - the fixed caster lvl 10 was very bad idea, however it cannot be changed without some very heavy workaround like 5itemproperties so I will probably keep it as it is. I guess there was some special reason why patch 1.69 changed it into this state anyway.

I already set summons to by supernatural effect - the rest must be handled in the dispell spells.

Polymorphing - i know about this bug and I got fix for this.

Spell decrease? Tell me more, never heard of it.

If the community will like the new concept its worth. Because even if I dont bring fix for SR, I will bring the easy way how to modify it, because every function in spell scripts will be "hooked" - call another function. So in future anyone who would want to change SR behaviour will need just to modify the include and recompile all scripts.
               
               

               
            

Legacy_the.gray.fox

  • Full Member
  • ***
  • Posts: 214
  • Karma: +0/-0
Community Patch project - new spell script concept - your thoughs?
« Reply #8 on: August 19, 2010, 03:15:47 pm »


               Hello.


ShaDoOoW wrote...

Dispell will be probably too, but I don't know how the dispell should work yet. Right now the MD is unbeatable and other dispells are unusable at higher levels.

To change the Dispel system of NWN is to write an alternate one, and make your spellscripts use that, instead of the core functions EffectDispelMagicAll() and EffectDispelMagicBest().
It is a mammoth job, beware!
The current rules of the Dispel system of NWN are fine. The problems are in its implementation.
It leaves much to be desired
For example, it targets and removes *single* spell effects -along with what is linked to them-.
But if a spellscript applies 2 sets of linked effects? The NWN dispel system may remove only 1 of them, leaving the other 1 in place.
This would make such spell count as if it was cast 2 times, not just 1.
Also, in case of Area Dispel, any leftover from a previously not-completely-removed spell could then be considered a valid spell to be removed... de facto reducing to zero the amount of Best spells to be removed from each target. A nasty side effect.

By current design the spell-effects applied by a single spell are not being seen as a whole.
So maybe in your report you read that Mage Armor was removed... and you think the whole spell is gone... while in truth maybe only a VFX_DUR_* effect was removed. Leaving the actual boost to AC in place.
Just an example. Mage Armor per se has no such problem. But many more spells *do*.

It gets even worse when it is about multiple Area of Effect spells and the spell-effects they apply.

Other than that, the 1 rule I changed about the dispellers is that a caster receives automatic success at dispelling his own spells. That is the correct D&D 3E behavior.
According to D&D the automatic success is *forced* in Targeted Dispel mode.
In Area Dispel mode the caster may *choose* to auto-win or not the dispel check for each of his spells.
But the NWN engine can not offer this functionality to Players. So, for balance, I force the automatic success in Area Dispel mode as well.
This in turn forces you as a spellcaster to think before throwing a dispeller into the fray. You may end up unsummoning your own minion (but then again, there are ways to give your minions more chances to survive a dispel magic you cast).
Another TODO thing is to introduce a proper dispel check for Area of Effect spells (and also a proper dispel report to output to the console). The current BioWare scripts just do this on a random roll that has little to do with your caster level. A proper dispel check has to be run. Which in turn makes AOE spells more useful, for they become much harder to remove.

I have changed the Mordenkainen's Disjunction greatly.
It allows full Caster Level bonus (+40), like the original. But it no longer performs a Greater Spell Breach before that.
In short, my MD behaves like the other dispel magiks, and is subject to the same rules.

As for the Greater and Lesser Spell Breach spells, I have changed them completely.
They do not exist in D&D 3E. The Greater Spell Breach was a BioWare invention to introduce a surrogate of the superability of MD to suppress each and every ongoing magical effect on the spell target.
The idea was good. But the implementation was bad.
The NWN engine just does not offer enough functionality to handle that in proper way (if you want to stay true to what D&D 3E says).
And it is an overpowered mechanism in NWN any way you look at it.
So I have changed the breachers.
In my modification their purpose is now to suppress those spells who provide protection vs. other spells.
They will seek and target specific spells, by Innate Level, and if any is found -> it is removed.
For balance I have made the breachers subject to Spell Resistance, but with a special rule: if the target is protected by a spell mantle, the breacher is absorbed completely, but the mantle is instantly killed.


ShaDoOoW wrote...


For HA - the fixed caster lvl 10 was very bad idea, however it cannot be changed without some very heavy workaround like 5itemproperties so I will probably keep it as it is. I guess there was some special reason why patch 1.69 changed it into this state anyway.

Good or bad I do not know.
But anwyay if you want to address the glitches of the Dispel system, you also have to address the dispel magic cast by the HA, for it has the same glitches. Else, it will interfere with all your hard work.
The positive side of it is that you may get total control of the Caster Level bonus granted by HA.


ShaDoOoW wrote...

Polymorphing - i know about this bug and I got fix for this.

Do you also know how to specify a different VFX effect to play for when the polymorph is ended?
(this implies the ability to create a polymorph effect that plays no VFX at all -- if so you wish)


ShaDoOoW wrote...

Spell decrease? Tell me more, never heard of it.

The Diamond Soul feat (Monks receive it for free at level 12) is a bug from begin to end.
First, it says it grants to a Monk character a Spell Resistance equal to Monk Level +10.
It is not entirely correct.
If you have a Monk(20), Diamond Soul gives him 20+10 = 30 Spell Resistance. Correct.
If you have a Fighter(20), Diamond Soul gives him 0+10 = 10 Spell Resistance. Bug. A character that has no levels in Monk class is no Monk to begin with. Even if you give him the Feat via Toolset, he should gain no Spell Resistance from it.

Second, a character with the Diamond Soul feat becomes immune to any Spell Resistance Decrease effect.
Such character will retain what Spell Resistance was given to him by the Diamond Soul feat, even if you try and apply a Spell Resistance Decrease of 90 (the absolute maximum for a NPC Monk(60) with all 10 Increased Spell Resistance epic feats).
The solution here is to turn the 11 original feats unavailable.
Then introduce your 11 substitute feats who will look & feel like the originals.
But *your scripts* will take care to apply and maintain the Spell Resistance bonus, so that the NWN engine stays out of it.


My HTML is lame. How do you write hyperlinks in your sig?
Tell me and I link you to my project. There you can download it and look at my source code.
Seeing things in action speaks better than a pile of words.


-fox
               
               

               


                     Modifié par the.gray.fox, 19 août 2010 - 02:26 .
                     
                  


            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Community Patch project - new spell script concept - your thoughs?
« Reply #9 on: August 19, 2010, 03:16:20 pm »


               I just tested a 40  monk, applied -20 SR and the character sheet didn't change, I'm wondering if there are other effects from this bug... can you elaborate what this bug actually is and does?
               
               

               
            

Legacy_the.gray.fox

  • Full Member
  • ***
  • Posts: 214
  • Karma: +0/-0
Community Patch project - new spell script concept - your thoughs?
« Reply #10 on: August 19, 2010, 03:37:48 pm »


               Hello.

Not much else to say.
The Spell Resistance Increase granted by Diamond Soul (and its 10 epic successors) is handled engine side.
Hm. Okay, in the end *everything* is handled engine side -- what I mean is that Diamond Soul is insensible to any counter effect applied via script.
The engine ultimately has the "last word" on your Spell Resistance, and actively maintains what bonus Diamond Soul & Co. grant you.

If you want a bad side-effect, is that an Epic Monk(40) with the Increased Spell Resistance X feat, achieves a permanent Spell Resistance of 70. And nobody can decrease it.
This makes such Monk impervious to 99.9% of spells.
Not even an epic Wizard/Sorcerer(40), with the Epic Spell Penetration feat could pierce such Spell Resistance.
His total Spell Penetration would roof at 70. You need 71 to beat a Spell Resistance of 70.
So you see, such epic Monk plays god-mode vs. any spellcaster.

Only an NPC (able to go up to level 60) may total a Spell Penetration of 90, and then pierce the super Spell Resistance of epic Monks. But then again, an epic NPC Monk(60) would be absolutely invincible to spells.

Is this not overpowered?
There is no way to defeat this bug. Only a workaround: make your Monk Players use 11 alternate feats, so that you (and not the engine) handle the Spell Resistance Increase.
And so, a Spell Resistance Decrease can strike correctly.


-fox
               
               

               


                     Modifié par the.gray.fox, 19 août 2010 - 02:49 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Community Patch project - new spell script concept - your thoughs?
« Reply #11 on: August 19, 2010, 03:52:47 pm »


               

the.gray.fox wrote...
dispells

I know the totall rewrite is needed, I saw this being ddone in PRC already, however this interfere with other bug - if caster re-log server the effect creator is lost. I don't know about any good solution for this except dispell everything without valid creator without check...

the.gray.fox wrote...
polymorph VFX

Yes I know how to change VFX as well. - replace current polymorph VFX model by empty one, make new one based on default and add in into visualleffects and apply this effect from script when polymorphing (you can remove the monk glowing eyes as well by this trick, etc.). Which is very similar to way I fixed temporary HPs.

the.gray.fox wrote...
monk Diamond Soul

I know you cant decrease monks SR and I thought its intended or even in rules -  but didnt checked. The solution for this is too heavy for me anyway.

the.gray.fox wrote...
links

use url code bracket [ url=link ] [ /url ]
               
               

               


                     Modifié par ShaDoOoW, 19 août 2010 - 03:09 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Community Patch project - new spell script concept - your thoughs?
« Reply #12 on: August 19, 2010, 03:59:14 pm »


               

the.gray.fox wrote...

If you want a bad side-effect, is that an Epic Monk(40) with the Increased Spell Resistance X feat, achieves a permanent Spell Resistance of 70. And nobody can decrease it.
This makes such Monk impervious to 99.9% of spells.
Not even an epic Wizard/Sorcerer(40), with the Epic Spell Penetration feat could pierce such Spell Resistance.
His total Spell Penetration would roof at 70. You need 71 to beat a Spell Resistance of 70.
So you see, such epic Monk plays god-mode vs. any spellcaster.

Only an NPC (able to go up to level 60) may total a Spell Penetration of 90, and then pierce the super Spell Resistance of epic Monks. But then again, an epic NPC Monk(60) would be absolutely invincible to spells.

Is this not overpowered?

I don't think so, I once made this build at Bastions of War, yes I was immune to magic, but because I took all feats for SR my char sucked in melee, it was just another point giver...

Also some spells dont check SR - thats Great thunderclap and damage shields, so if the caster cast damage shields, SR monk wont dare to attack anyway...

in pvm i dont think this will be useable, such monk missing everything else...
               
               

               


                     Modifié par ShaDoOoW, 19 août 2010 - 03:11 .
                     
                  


            

Legacy_the.gray.fox

  • Full Member
  • ***
  • Posts: 214
  • Karma: +0/-0
Community Patch project - new spell script concept - your thoughs?
« Reply #13 on: August 19, 2010, 04:12:10 pm »


               

ShaDoOoW wrote...

I don't think so, I once made this build
at Bastions of War, yes I was immune to magic, but because I took all
feats for SR my char sucked in melee, it was just another point giver...

Also some spells dont check SR - thats Great thunderclap and damage shields, so if the caster cast damage shields, SR monk wont dare to attack anyway...

Allow me to disagree.
Point giver, as you call it, is only in theory. The practice is different.
Equipment can make up for your lack of melee skills.
A well equipped Monk, with 70 SR is a major threat. Way bigger than a mage of comparable level.
This unbalances the game.

The damage shields are another theory thing.
You sacrifice your health to hit the target. But the target is still damaged. And you can use potions.
So can the target, of course.
But again your equipment can shield you from shield damage spells.
And again you are a major threat.

The point of it is that a SR of 70 is too big an asset to have.
At least in D&D a Monk past level 19 becomes Outsider, and as such he is prey of spells specifically disruptive to all outsiders.
But in NWN this rule is ignored.
(btw, I address this in my scripts as well)


I thank you for the url tip.
But how do I add a signature to my posts?
Much appreciated.

[edit]
Sig done. Thank you again :-)
[/edit]


-fox
               
               

               


                     Modifié par the.gray.fox, 19 août 2010 - 03:24 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Community Patch project - new spell script concept - your thoughs?
« Reply #14 on: August 19, 2010, 04:15:13 pm »


               Profile in menu left -> forum settings '<img'>