Bioware Archive

Bioware Archive V2 => Builders - Scripting => Topic started by: Legacy_ZX_Diablo on August 22, 2011, 02:32:56 pm

Title: Special Ability
Post by: Legacy_ZX_Diablo on August 22, 2011, 02:32:56 pm


               Is there a way to make my character cast Timestop or Horrid Whilting of a Caster Level of 25, i.e. make my Paladin cast Timestop as special ability as Assasin's Darkness?
               
               

               
            
Title: Special Ability
Post by: Legacy_Shadooow on August 22, 2011, 03:39:18 pm


               Yes. My unofficial patch allows to override caster level of all special abilities via variable on creature.

It has one downside that this caster level applies only to damage/duration its not "true" caster level so it cannot pierce monk's SR. SR from items is pierced via this.
               
               

               
            
Title: Special Ability
Post by: Legacy_Xardex on August 22, 2011, 03:57:07 pm


               Wait what, now you can have special abilities on PCs?
               
               

               
            
Title: Special Ability
Post by: Legacy_ZX_Diablo on August 22, 2011, 04:01:02 pm


               Didn't get what you said ShaDoOoW? .... How do I add special ability on PCs?
               
               

               
            
Title: Special Ability
Post by: Legacy_WhiZard on August 22, 2011, 07:41:36 pm


               

ShaDoOoW wrote...

Yes. My unofficial patch allows to override caster level of all special abilities via variable on creature.

It has one downside that this caster level applies only to damage/duration its not "true" caster level so it cannot pierce monk's SR. SR from items is pierced via this.


Yep, editing iprp_spells.2da is the way to assign a specific caster level to a spell for all purposes.  This being achieved through an item; however it only goes by what it is set to.  To be able to change between settings requires using different rows in the 2da by changing the cast spell item property.
               
               

               
            
Title: Special Ability
Post by: Legacy_Shadooow on August 23, 2011, 08:09:38 am


               

Xardex wrote...

Wait what, now you can have special abilities on PCs?

No. So I understood it that he speaking about NPC. If you make NPC with any special ability max lvl you can set for this ability is 15. My patch allows (atm only globally for all abilities) override this number by higher number or lower number (advantage is that lowered number has still default number as caster level for SR purposes, only dmg/duration changes, if the overriden level is higher it works like it should except monk SR (engine limitation)).

WhiZard wrote...

Yep, editing iprp_spells.2da is the way
to assign a specific caster level to a spell for all purposes.  This
being achieved through an item; however it only goes by what it is set
to.  To be able to change between settings requires using different rows
in the 2da by changing the cast spell item property.

This changes globally the caster level of spell at item. Im not sure if the OP ask for this. Anyway my patch also allows to change caster level at item, the advantage is that default level can stay the same and it only applies for specific item (all spells on that item). If you change it via this 2da all these spells on all items will have this caster level.
               
               

               
            
Title: Special Ability
Post by: Legacy_FunkySwerve on August 23, 2011, 09:25:10 am


               PCs were blocked from having special abilities in 1.65, as part of an antiexploit. You CAN, however, add them to pcs via nwnx if you're a server admin, using SetSpecialAbility from nwnx_funcs.

Funky
               
               

               
            
Title: Special Ability
Post by: Legacy_WhiZard on August 23, 2011, 09:43:38 pm


               

ShaDoOoW wrote...

This changes globally the caster level of spell at item. Im not sure if the OP ask for this. Anyway my patch also allows to change caster level at item, the advantage is that default level can stay the same and it only applies for specific item (all spells on that item). If you change it via this 2da all these spells on all items will have this caster level.


I was suggesting adding lines so you could have:

Enervation (level 1)
Enervation (level 2)
etc.

and then whenever the item spell needs its caster level changed, simply delete the enervation item property and replace it with another item property casting of the same spell. This would typically make more sense for unique powers.

----
Giventhe monk SR issue in your approach, I assume what you are doing with special abilities is to give the target(s) a temporary SR boost/decrease in relation to the caster level change which will dissipate shortly after the spell script fires.
               
               

               


                     Modifié par WhiZard, 23 août 2011 - 08:47 .
                     
                  


            
Title: Special Ability
Post by: Legacy_Shadooow on August 24, 2011, 07:54:31 am


               

WhiZard wrote...

Giventhe monk SR issue in your approach, I assume what you are doing with special abilities is to give the target(s) a temporary SR boost/decrease in relation to the caster level change which will dissipate shortly after the spell script fires.

yes exactly, however I cant imagine your solution in practice. First it does not solve caster level of creature abilities it can be applied only for spells cast from items. Second it does require tremedous ammount of work and new lines in TLK (which is something I tried to avoid in my patch) and it wouldnt be compatible with many custom content like PRC - uses these lines for theirs spells. Third it makes total mess in the cast spell item property window, if there would be each spell 40times...

My solution isnt perfect but allows to raise caster level even much higher. And I was thinking about workaround that would solved the issue with monk SR. Also it would be possible to set the caster level override for each spell on item itself, I havent done this yea because I havent found an easy and userfriendly solution so far.
               
               

               
            
Title: Special Ability
Post by: Legacy_GhostOfGod on August 24, 2011, 09:42:14 am


               This might be a bit of a sloppy approach but would it be possible to spawn an invisible creature at the PCs location and then have the PC cast a fake spell and the invisible creature cast the actual spell? Then just destroy the invis creature after the spell is cast? Just an idea. Haven't actually tried it.
               
               

               


                     Modifié par GhostOfGod, 24 août 2011 - 08:42 .
                     
                  


            
Title: Special Ability
Post by: Legacy_WhiZard on August 24, 2011, 01:55:19 pm


               

ShaDoOoW wrote...
My solution isnt perfect but allows to raise caster level even much higher. And I was thinking about workaround that would solved the issue with monk SR. Also it would be possible to set the caster level override for each spell on item itself, I havent done this yea because I havent found an easy and userfriendly solution so far.


I wasn't claiming it to be an efficient way.  I was claiming it to be the only way to adjust caster level in all respects.  There are many shorter approaches (like yours) that will, however, miss a little when trying to adjust caster level.  However, my approach may show some efficiency if I am using it for a specific unique power only.
               
               

               


                     Modifié par WhiZard, 24 août 2011 - 12:57 .
                     
                  


            
Title: Special Ability
Post by: Legacy_WhiZard on August 24, 2011, 02:04:46 pm


               

GhostOfGod wrote...

This might be a bit of a sloppy approach but would it be possible to spawn an invisible creature at the PCs location and then have the PC cast a fake spell and the invisible creature cast the actual spell? Then just destroy the invis creature after the spell is cast? Just an idea. Haven't actually tried it.


You can't counter a fake spell.  And cheat cast spells (what the invisible creature would likely cast) have a caster level equal to 2*innate level - 1 (minimum 10).
               
               

               
            
Title: Special Ability
Post by: Legacy_WhiZard on August 24, 2011, 02:09:56 pm


               

ShaDoOoW wrote...

WhiZard wrote...

Giventhe monk SR issue in your approach, I assume what you are doing with special abilities is to give the target(s) a temporary SR boost/decrease in relation to the caster level change which will dissipate shortly after the spell script fires.

yes exactly, however I cant imagine your solution in practice. First it does not solve caster level of creature abilities it can be applied only for spells cast from items. Second it does require tremedous ammount of work and new lines in TLK (which is something I tried to avoid in my patch) and it wouldnt be compatible with many custom content like PRC - uses these lines for theirs spells. Third it makes total mess in the cast spell item property window, if there would be each spell 40times...

My solution isnt perfect but allows to raise caster level even much higher. And I was thinking about workaround that would solved the issue with monk SR. Also it would be possible to set the caster level override for each spell on item itself, I havent done this yea because I havent found an easy and userfriendly solution so far.


TLK lines would be reused rather than have new ones added (remember spells.2da already has these lines).  Creatures can be given their special abilities by local variables and then make use of them through items.  So yes it can work on a few select monster abilities, adjusting caster level in all instances.  The question as to how efficient it is, is a completely different matter.
               
               

               
            
Title: Special Ability
Post by: Legacy_Shadooow on August 24, 2011, 02:31:48 pm


               

GhostOfGod wrote...

This might be a bit of a sloppy
approach but would it be possible to spawn an invisible creature at the
PCs location and then have the PC cast a fake spell and the invisible
creature cast the actual spell? Then just destroy the invis creature
after the spell is cast? Just an idea. Haven't actually tried
it.

I cannot see how this solves anything. Except this its extremely lame solution, pardon me for that expression but since you can adjust the caster level in script like I did (with only one downside which is very rare to occur) using some kind of faking via invisible creature is just useless. Except the issues WhiZard already stated Im not very sure how would you synchronize it so it would look as real spell + spawning invisible creature every time... baad

WhiZard wrote...

I was claiming it to be the only way to adjust caster level in all respects.

And this claim is wrong too. There is much more solutions, I just realized another one and Im pretty sure NWNX can do this too.

Re-using TLK lines doesnt solve the issue I had in mind which is that those without the changed TLK sill be gibberlish instead.

Giving special abilities to the monsters on skin or other item seems very user unfriendly to me and I doubt that AI can even use them and if does that definitely not the same way as before as item powers are later in AI code.

If you use it for specific purpose like item caster level it might be a good solution. But it cant be a solution for monster's special abilities.

EDIT: just realized my new idea has the same downside as yours as its a combo of both my and yours idea (make caster lvl at 40 by default and then decrease it via script and SR increase effect on monsters) so I will stick with current solution
               
               

               


                     Modifié par ShaDoOoW, 24 août 2011 - 01:37 .
                     
                  


            
Title: Special Ability
Post by: Legacy_Failed.Bard on August 24, 2011, 02:43:45 pm


               The SR problem would be solved most easily by making your own ResistSpell script that took the changes into consideration, wouldn't it?
               
               

               
            
Title: Special Ability
Post by: Legacy_Shadooow on August 24, 2011, 03:22:32 pm


               Right. Though its not very much possible to do without another issues and without nwnx.
               
               

               
            
Title: Special Ability
Post by: Legacy_GhostOfGod on August 24, 2011, 04:13:39 pm


               

ShaDoOoW wrote...

GhostOfGod wrote...

This might be a bit of a sloppy
approach but would it be possible to spawn an invisible creature at the
PCs location and then have the PC cast a fake spell and the invisible
creature cast the actual spell? Then just destroy the invis creature
after the spell is cast? Just an idea. Haven't actually tried
it.

I
cannot see how this solves anything. Except this its extremely lame
solution, pardon me for that expression but since you can adjust the
caster level in script like I did (with only one downside which is very
rare to occur) using some kind of faking via invisible creature is just
useless. Except the issues WhiZard already stated Im not very sure how
would you synchronize it so it would look as real spell + spawning
invisible creature every time...baad

Wow. Since when is this forum in the business of putting peoples IDEAS down so negatively. :crying:
               
               

               


                     Modifié par GhostOfGod, 24 août 2011 - 03:20 .
                     
                  


            
Title: Special Ability
Post by: Legacy_Shadooow on August 24, 2011, 04:36:52 pm


               Sorry I mean that when I was creating my feature I was considering all possible approach. Nobody here didnt came up with anything new or better for me. Plus I was asking help for this months before and nobody helped me, now when its done there is plenty of peoples who claims they can do it better...
               
               

               
            
Title: Special Ability
Post by: Legacy_WhiZard on August 24, 2011, 09:58:35 pm


               

ShaDoOoW wrote...
Re-using TLK lines doesnt solve the issue I had in mind which is that those without the changed TLK sill be gibberlish instead.

I wasn't planning on changing TLK in the first place.

EDIT: just realized my new idea has the same downside as yours as its a combo of both my and yours idea (make caster lvl at 40 by default and then decrease it via script and SR increase effect on monsters) so I will stick with current solution


You do realize your current solution would still have issues with creatures with both a SR increase effect and an SR decrease effect.


What is very time consuming and may require many computers to accomplish is to try to locate the local integer on a creature that stores the caster level (due to the way caster level works, I'm pretty sure it is done this way).  Once the local integer is located, all one has to do is use SetLocalInteger() and the whole caster level issue is solved.
               
               

               


                     Modifié par WhiZard, 24 août 2011 - 08:58 .
                     
                  


            
Title: Special Ability
Post by: Legacy_Shadooow on August 25, 2011, 04:54:52 pm


               

WhiZard wrote...

ShaDoOoW wrote...
Re-using TLK lines doesnt solve the issue I had in mind which is that those without the changed TLK sill be gibberlish instead.

I wasn't planning on changing TLK in the first place.

Then what were you planning? You specifically said:

I was suggesting adding lines so you could have:

Enervation (level 1)
Enervation (level 2)
etc.


how you want to do this without changing TLK or making custom TLK? Im lost.

You do realize your current solution would still have issues with creatures with both a SR increase effect and an SR decrease effect.


What is very time consuming and may require many computers to accomplish is to try to locate the local integer on a creature that stores the caster level (due to the way caster level works, I'm pretty sure it is done this way).  Once the local integer is located, all one has to do is use SetLocalInteger() and the whole caster level issue is solved.

No I dont realize that, what you mean?

Also dont understand what you point with local variables, but instead of guessing you could maybe download my patch and read readme? -> yes for overriding caster level I use local variable on creature/item but still can't see what you mean.
               
               

               
            
Title: Special Ability
Post by: Legacy_WhiZard on August 25, 2011, 05:54:08 pm


               

ShaDoOoW wrote...

WhiZard wrote...

ShaDoOoW wrote...
Re-using TLK lines doesnt solve the issue I had in mind which is that those without the changed TLK sill be gibberlish instead.

I wasn't planning on changing TLK in the first place.

Then what were you planning? You specifically said:

I was suggesting adding lines so you could have:

Enervation (level 1)
Enervation (level 2)
etc.


how you want to do this without changing TLK or making custom TLK? Im lost.

The only lines added are to iprp_spells.2da.  They will reference the same tlk lines as the spell.  Thus ingame it will look like nothing happened (the item property switched from cast:spell enervation to cast:spell enervation) only the caster level changed.


You do realize your current solution would still have issues with creatures with both a SR increase effect and an SR decrease effect.


What is very time consuming and may require many computers to accomplish is to try to locate the local integer on a creature that stores the caster level (due to the way caster level works, I'm pretty sure it is done this way).  Once the local integer is located, all one has to do is use SetLocalInteger() and the whole caster level issue is solved.

No I dont realize that, what you mean?

Also dont understand what you point with local variables, but instead of guessing you could maybe download my patch and read readme? -> yes for overriding caster level I use local variable on creature/item but still can't see what you mean.


The above two points are separate and I will address them in order.

1) SR decreases do not stack.  Thus to effectively decrease SR on a creature with nature's balance or breach reductions you will need to add the amount you wish to reduce to the amount of the highest SR decrease effect and apply that as one effect.  Unfortunately only a 3rd party utility can get the SR decrease amount from an effect, and then it has to go through all the SR decrease effects to determine which is used as the highest.

2) The game likely stores caster level as a local integer, and GetCasterLevel() is likely used to retreive that integer.  Thus finding which local integer it is may allow for a very easy way to create a SetCasterLevel() function.
               
               

               
            
Title: Special Ability
Post by: Legacy_Shadooow on August 25, 2011, 06:13:46 pm


               TLK: ok then havent thought of that, then its doable if the lines will be sorted by caster lvl or even line number (that would be awfull but still useable). Still this solution is atm not useable for me if I dont want to make any conflict in various CC. That may however change when I finally complete the 1.70 version and there will be demand for more features/fixes.

SR decrease: Didnt know but its workadoundable. You can set the ammount of the spell decrease into variable when applying from the spellscripts. OK thanks, ill fix this issue. It cannot work with any CC but thats acceptable price

CasterLevel: no you are wrong, the game stores as variables only few informations .like mappins. Caster level is function that calculates it every time you call it. Its not stored anywhere, if it would then you could find it when you save module and open it. Or for PCs there is a method how to loop all variables on him via nwnx, I already try it on every object in game mainly encounters but except mappins, there is nothing stored in locals AFAI-and my friends-K.
               
               

               
            
Title: Special Ability
Post by: Legacy_WhiZard on August 25, 2011, 06:26:07 pm


               

ShaDoOoW wrote...
CasterLevel: no you are wrong, the game stores as variables only few informations .like mappins. Caster level is function that calculates it every time you call it. Its not stored anywhere, if it would then you could find it when you save module and open it. Or for PCs there is a method how to loop all variables on him via nwnx, I already try it on every object in game mainly encounters but except mappins, there is nothing stored in locals AFAI-and my friends-K.


It doesn't recalculate at call.  Try with area of effects and unrelated scripts and you will see it just keeps returning the same number until you cast another spell, in which case it will keep on returning the caster level of the next spell.  There is information stored in relation to your character and all the noticable calls to set it are hardcoded. 
               
               

               
            
Title: Special Ability
Post by: Legacy_Shadooow on August 25, 2011, 07:05:45 pm


               Right you find a error in my statement, but still is not stored in local variable.
               
               

               
            
Title: Special Ability
Post by: Legacy_Failed.Bard on August 25, 2011, 07:22:08 pm


               NWNX has GetFirst/GextNext variable functions, so it's easily checked what variables are stored on the character. Caster level and Metamagic aren't among them, unfortunately.

Name: bX3_M_ARCHERY Type: 1 Object: 7ffffffd Position: 0 Label: Command:
Name: oX3_Skin Type: 4 Object: 7ffffffd Position: 1 Label: Command:

Those two, and variables for journal entry states were the only ones stored on the character after casting a spell and checking them.
               
               

               


                     Modifié par Failed.Bard, 25 août 2011 - 06:27 .
                     
                  


            
Title: Special Ability
Post by: Legacy_WhiZard on August 25, 2011, 08:07:08 pm


               

Failed.Bard wrote...

NWNX has GetFirst/GextNext variable functions, so it's easily checked what variables are stored on the character. Caster level and Metamagic aren't among them, unfortunately.


Thanks for checking.  The only other places that might have it that could be alterable are the databases (SetCampaignInt() I don't think this one's the case) or the module's local variables.  If someone wants to tackle these and is successful, it would really be a boon to the community.  Otherwise, if it is not in those locations, I guess we are at a loss for directly changing it by standard script.
               
               

               
            
Title: Special Ability
Post by: Legacy_Shadooow on August 25, 2011, 08:28:17 pm


               Its not in database, if it would then every module would created some database when launched. This is not the case of how things works.
               
               

               
            
Title: Special Ability
Post by: Legacy_WhiZard on August 25, 2011, 08:34:09 pm


               

ShaDoOoW wrote...

Its not in database, if it would then every module would created some database when launched. This is not the case of how things works.


I said unlikely, but a database like "dbgeneral" might be a location, the standard Neverwinter does not come devoid of databases you know.
               
               

               
            
Title: Special Ability
Post by: Legacy_WhiZard on August 25, 2011, 10:15:58 pm


               

WhiZard wrote...

ShaDoOoW wrote...

Its not in database, if it would then every module would created some database when launched. This is not the case of how things works.


I said unlikely, but a database like "dbgeneral" might be a location, the standard Neverwinter does not come devoid of databases you know.

Tested all databases in the database folder.  None of them are affected by a  caster level change.
               
               

               
            
Title: Special Ability
Post by: Legacy_Shadooow on August 26, 2011, 01:05:18 am


               I told you. Its not so easy, if it would someone else would found it out already after all its 10years old game. You are not the first one who had this idea with local variables, Im pretty sure that Primogenitor original founder of PRC and the first who found out mappins was also looking for something like caster level.
               
               

               
            
Title: Special Ability
Post by: Legacy_GhostOfGod on August 26, 2011, 01:15:04 am


               

ShaDoOoW wrote...

...someone else would found it out already after all its 10years old game.


Not necessarily. People are still finding out new stuff after all this time. social.bioware.com/forum/1/topic/192/index/8147590

It doesn't hurt to poke around and try to find new ways to do stuff. Or even revisit old ways to see if something has changed.

Just my 2 cents.
               
               

               
            
Title: Special Ability
Post by: Legacy_WhiZard on August 26, 2011, 01:18:01 am


               

ShaDoOoW wrote...

I told you. Its not so easy, if it would someone else would found it out already after all its 10years old game. You are not the first one who had this idea with local variables, Im pretty sure that Primogenitor original founder of PRC and the first who found out mappins was also looking for something like caster level.


Well if you want the final word on the subject, there is still the Module Local Variables to test.  Other than that it can't be adjusted by standard scripting.
               
               

               
            
Title: Special Ability
Post by: Legacy_Shadooow on August 26, 2011, 08:19:58 am


               

GhostOfGod wrote...

ShaDoOoW wrote...

...someone else would found it out already after all its 10years old game.


Not necessarily. People are still finding out new stuff after all this time. social.bioware.com/forum/1/topic/192/index/8147590

It doesn't hurt to poke around and try to find new ways to do stuff. Or even revisit old ways to see if something has changed.

Just my 2 cents.

Of course they do, but this is a bit different than local variables on object.


BTW module variables can be easily checked via save game WhiZard.
               
               

               
            
Title: Special Ability
Post by: Legacy_WhiZard on August 26, 2011, 01:59:30 pm


               

ShaDoOoW wrote...

BTW module variables can be easily checked via save game WhiZard.


They could also be deleted on saving.  When you load a save game your caster level is back to zero.
               
               

               
            
Title: Special Ability
Post by: Legacy_WhiZard on August 26, 2011, 02:01:01 pm


               The way to effectively test for module variables is to loop through the active module variables while in game before and after casting a spell that would change caster level just as failed bard did with PC locals, and how I did for databases.  Unfortunately, without NwNx, I do not have access to these commands.
               
               

               


                     Modifié par WhiZard, 26 août 2011 - 01:03 .
                     
                  


            
Title: Special Ability
Post by: Legacy_Failed.Bard on August 26, 2011, 02:20:04 pm


               It might be stored in temporarily in CombatRoundData [UserDefinedStruct: 51930], which is empty when the saved bic is viewed, but I have no idea how to get a list of struct components in game via script to see what, if anything, gets inserted there.
               
               

               
            
Title: Special Ability
Post by: Legacy_WhiZard on August 27, 2011, 04:12:38 am


               

Failed.Bard wrote...

 It might be stored in temporarily in CombatRoundData [UserDefinedStruct: 51930], which is empty when the saved bic is viewed, but I have no idea how to get a list of struct components in game via script to see what, if anything, gets inserted there.


A struct might not be able to be changed in such a way that later callings would reflect the change.  Can there be verification of a module local variables not being affected, as that is the last certain realm of direct modification?