When casting display the CL of the spell in combat log
Moderators: Moderator, Quality Control, Developer, DM
- mrm3ntalist
- Retired Staff
- Posts: 7712
- Joined: Wed Feb 29, 2012 5:31 pm
- Location: Skala Kallonis, Lesvos, Greece
When casting display the CL of the spell in combat log
^^ Is it possible?
IS EMOTIONAL KEKW - GIT GUD
Mendel - Villi of En Dharasha Everae | Nikos Berenicus - Initiate of the Mirari | Efialtes Rodius - Blood Magus | Olaf Garaeif - Dwarven Slayer
Spelling mistakes are purposely entered for your entertainment!
Mendel - Villi of En Dharasha Everae | Nikos Berenicus - Initiate of the Mirari | Efialtes Rodius - Blood Magus | Olaf Garaeif - Dwarven Slayer
Spelling mistakes are purposely entered for your entertainment!
- Rhifox
- Retired Admin (Acting Assistant Admin)
- Posts: 3711
- Joined: Wed Jan 13, 2016 2:34 am
Re: When casting display the CL of the spell in combat log
Possible and a great idea.
Tarina — Witch, Apothecary, Dealer in Spirits and Black Magic
-
- QC Coordinator
- Posts: 1921
- Joined: Sat Jul 28, 2018 8:51 am
Re: When casting display the CL of the spell in combat log
Done, please see in next update.
- mrm3ntalist
- Retired Staff
- Posts: 7712
- Joined: Wed Feb 29, 2012 5:31 pm
- Location: Skala Kallonis, Lesvos, Greece
Re: When casting display the CL of the spell in combat log
Damn that was fast.
IS EMOTIONAL KEKW - GIT GUD
Mendel - Villi of En Dharasha Everae | Nikos Berenicus - Initiate of the Mirari | Efialtes Rodius - Blood Magus | Olaf Garaeif - Dwarven Slayer
Spelling mistakes are purposely entered for your entertainment!
Mendel - Villi of En Dharasha Everae | Nikos Berenicus - Initiate of the Mirari | Efialtes Rodius - Blood Magus | Olaf Garaeif - Dwarven Slayer
Spelling mistakes are purposely entered for your entertainment!
-
- QC Coordinator
- Posts: 1921
- Joined: Sat Jul 28, 2018 8:51 am
Re: When casting display the CL of the spell in combat log
Well, it literally was one line of code. Took me longer to find the place in script where to put the SendMessageToPC function rather than writing it.
-
- QC Coordinator
- Posts: 1921
- Joined: Sat Jul 28, 2018 8:51 am
Re: When casting display the CL of the spell in combat log
Sadly, had to undo it since showing correct CL is way trickier than i expected. Will implement it again after we find a good way to make sure displayed CL is real CL.
Please don't trust CL messages for SLAs. Some spells may lie as well.
Please don't trust CL messages for SLAs. Some spells may lie as well.
- mrm3ntalist
- Retired Staff
- Posts: 7712
- Joined: Wed Feb 29, 2012 5:31 pm
- Location: Skala Kallonis, Lesvos, Greece
Re: When casting display the CL of the spell in combat log
Nothing is ever straight-forward with nwn2
I hope that you can get it sorted because it can help a lot with spell/build mechanics
I hope that you can get it sorted because it can help a lot with spell/build mechanics
IS EMOTIONAL KEKW - GIT GUD
Mendel - Villi of En Dharasha Everae | Nikos Berenicus - Initiate of the Mirari | Efialtes Rodius - Blood Magus | Olaf Garaeif - Dwarven Slayer
Spelling mistakes are purposely entered for your entertainment!
Mendel - Villi of En Dharasha Everae | Nikos Berenicus - Initiate of the Mirari | Efialtes Rodius - Blood Magus | Olaf Garaeif - Dwarven Slayer
Spelling mistakes are purposely entered for your entertainment!
-
- QC Coordinator
- Posts: 1921
- Joined: Sat Jul 28, 2018 8:51 am
Re: When casting display the CL of the spell in combat log
Well, the thing is. We use a function (spellhook) that kicks in before any spell is cast. So this function relates to calculating CL, DC etc. to make sure all CL/DC affecting custom stuff actually works.mrm3ntalist wrote: ↑Fri May 13, 2022 10:59 am Nothing is ever straight-forward with nwn2
I hope that you can get it sorted because it can help a lot with spell/build mechanics
But, some spells/abilities do set up CL/DC after that code is already complete, so our spellhook does report information before such variables were actually set by spell. And since spellhook has no guaranteed means to identify what should be proper CL/DC of SLA (or a spell which sets these up specifically), it reports wrong CL while real CL of spell/SLA would still be pretty much correct in practice for most of such cases. The function that was showing CL simply wasn't getting the super final CL to send to player.
As a fix, i could make it so all stuff that set up CL/DC does so before spellhook kicks in action or, alternatively, i can just add this message to every spell.
But, it'd be big work (basically, add message to every spell/SLA in game) with some complications because not every spell has it's CL set in spell code itself, part of it is set up in spellhook.
I look for options to make it in more elegant way now. As spell code is a very big piece of code, it may already have some stuff to do it, but since it's that big, it's slow to research.
- mrm3ntalist
- Retired Staff
- Posts: 7712
- Joined: Wed Feb 29, 2012 5:31 pm
- Location: Skala Kallonis, Lesvos, Greece
Re: When casting display the CL of the spell in combat log
Hey Eastern, is the problem only with SLAs? Do you know if the CL from feats such as spellpower/BloodMagus is calculated correctly?EasternCheesE wrote: ↑Sat May 14, 2022 9:08 amWell, the thing is. We use a function (spellhook) that kicks in before any spell is cast. So this function relates to calculating CL, DC etc. to make sure all CL/DC affecting custom stuff actually works.
But, some spells/abilities do set up CL/DC after that code is already complete, so our spellhook does report information before such variables were actually set by spell. And since spellhook has no guaranteed means to identify what should be proper CL/DC of SLA (or a spell which sets these up specifically), it reports wrong CL while real CL of spell/SLA would still be pretty much correct in practice for most of such cases. The function that was showing CL simply wasn't getting the super final CL to send to player.
As a fix, i could make it so all stuff that set up CL/DC does so before spellhook kicks in action or, alternatively, i can just add this message to every spell.
But, it'd be big work (basically, add message to every spell/SLA in game) with some complications because not every spell has it's CL set in spell code itself, part of it is set up in spellhook.
I look for options to make it in more elegant way now. As spell code is a very big piece of code, it may already have some stuff to do it, but since it's that big, it's slow to research.
IS EMOTIONAL KEKW - GIT GUD
Mendel - Villi of En Dharasha Everae | Nikos Berenicus - Initiate of the Mirari | Efialtes Rodius - Blood Magus | Olaf Garaeif - Dwarven Slayer
Spelling mistakes are purposely entered for your entertainment!
Mendel - Villi of En Dharasha Everae | Nikos Berenicus - Initiate of the Mirari | Efialtes Rodius - Blood Magus | Olaf Garaeif - Dwarven Slayer
Spelling mistakes are purposely entered for your entertainment!
- Rhifox
- Retired Admin (Acting Assistant Admin)
- Posts: 3711
- Joined: Wed Jan 13, 2016 2:34 am
Re: When casting display the CL of the spell in combat log
Spellpower and Blood Magus are calculated correctly as they are handled at the spellhook level.
The main issue on things is where any extra CL/CL changes are calculated at the spell script, as that happens after the spellhook.
The main issue on things is where any extra CL/CL changes are calculated at the spell script, as that happens after the spellhook.
Tarina — Witch, Apothecary, Dealer in Spirits and Black Magic
- mrm3ntalist
- Retired Staff
- Posts: 7712
- Joined: Wed Feb 29, 2012 5:31 pm
- Location: Skala Kallonis, Lesvos, Greece
Re: When casting display the CL of the spell in combat log
Something is not correct. The CLs I am getting are all over the place. A build of mine that was supposed to have a CL of 27, actually gets 29. Some spells get 39CL
I have a suspicion of which classes get incorrect CL and how the 39CL can be explained. However some of my builds are very old so i do not know if it is a me problem or a class problem. Can someone with the QC tools test this out?
Also i do not know if it is possible to display the CL that a spell is cast, and the CL that actually affects DCs ( shadow adept - shadow magic )
IS EMOTIONAL KEKW - GIT GUD
Mendel - Villi of En Dharasha Everae | Nikos Berenicus - Initiate of the Mirari | Efialtes Rodius - Blood Magus | Olaf Garaeif - Dwarven Slayer
Spelling mistakes are purposely entered for your entertainment!
Mendel - Villi of En Dharasha Everae | Nikos Berenicus - Initiate of the Mirari | Efialtes Rodius - Blood Magus | Olaf Garaeif - Dwarven Slayer
Spelling mistakes are purposely entered for your entertainment!
-
- QC Coordinator
- Posts: 1921
- Joined: Sat Jul 28, 2018 8:51 am
Re: When casting display the CL of the spell in combat log
Let us put it this way. Spellhook does calculate CL and all the bonuses like blood magic or spellpower from archmage, then it saves that into special variable.
Normally, we never overwrite that variable inside spell script itself (cause it's handled automatically in spellhook), but some spells are a special case (say, they have very specific CL calculations). So, if any spell actually sets CL inside spell script (which happens after spellhook calculated things), it will effectively override that correct CL and write their defined one. In this case, real CL and the one you still see in combat log would be unrelated and, of course, all your spellpower/blood magic will do nothing. There are more complications about it since there are several functions that check caster's CL and some do account bloodmagic etc and some don't and i can't guarantee that all spells that overwrite CL do use right functions to check CL.
For SLAs, as they are not spells, spellhook fails to calculate CL, so it sets it to either 0 or, in some cases, to SLA's innate spell level's CL.
Some SLAs do actually set up their CL in spellscript, so no matter what message you get, they have it calculated correct. But, most SLAs don't have it set because, normally, they are not a subject to dispel or CL simply doesn't matter.
Say, if you apply earth genasi racial SLA, you don't really care about it's CL because:
1) It can't be dispelled
2) It has fixed duration
3) Nothing in it scales with CL
It's true for many of SLAs or feat effects.
So, overall, there is no easy way to say "X is correct and Y is not" without looking through code of each spell/SLA/active feat that may somehow benefit from CL in first place.
Normally, we never overwrite that variable inside spell script itself (cause it's handled automatically in spellhook), but some spells are a special case (say, they have very specific CL calculations). So, if any spell actually sets CL inside spell script (which happens after spellhook calculated things), it will effectively override that correct CL and write their defined one. In this case, real CL and the one you still see in combat log would be unrelated and, of course, all your spellpower/blood magic will do nothing. There are more complications about it since there are several functions that check caster's CL and some do account bloodmagic etc and some don't and i can't guarantee that all spells that overwrite CL do use right functions to check CL.
For SLAs, as they are not spells, spellhook fails to calculate CL, so it sets it to either 0 or, in some cases, to SLA's innate spell level's CL.
Some SLAs do actually set up their CL in spellscript, so no matter what message you get, they have it calculated correct. But, most SLAs don't have it set because, normally, they are not a subject to dispel or CL simply doesn't matter.
Say, if you apply earth genasi racial SLA, you don't really care about it's CL because:
1) It can't be dispelled
2) It has fixed duration
3) Nothing in it scales with CL
It's true for many of SLAs or feat effects.
So, overall, there is no easy way to say "X is correct and Y is not" without looking through code of each spell/SLA/active feat that may somehow benefit from CL in first place.
- mrm3ntalist
- Retired Staff
- Posts: 7712
- Joined: Wed Feb 29, 2012 5:31 pm
- Location: Skala Kallonis, Lesvos, Greece
Re: When casting display the CL of the spell in combat log
Can you test the cl of a build with dragon disciple ? My builds with that prc get 2cl more than they should. I made a post about that months ago and I was I told it was fixed, however my builds still get the bonus cl
IS EMOTIONAL KEKW - GIT GUD
Mendel - Villi of En Dharasha Everae | Nikos Berenicus - Initiate of the Mirari | Efialtes Rodius - Blood Magus | Olaf Garaeif - Dwarven Slayer
Spelling mistakes are purposely entered for your entertainment!
Mendel - Villi of En Dharasha Everae | Nikos Berenicus - Initiate of the Mirari | Efialtes Rodius - Blood Magus | Olaf Garaeif - Dwarven Slayer
Spelling mistakes are purposely entered for your entertainment!
-
- QC Coordinator
- Posts: 1921
- Joined: Sat Jul 28, 2018 8:51 am
Re: When casting display the CL of the spell in combat log
If you could send me the .bic file of that exact PC, i can replicate your results with 100% accuracy. Please send me via PM.mrm3ntalist wrote: ↑Tue May 24, 2022 9:41 am Can you test the cl of a build with dragon disciple ? My builds with that prc get 2cl more than they should. I made a post about that months ago and I was I told it was fixed, however my builds still get the bonus cl
As a reminder: Log into server, escape -> export character. Then go to documents/neverwinter nights 2/localvault, get the bic of that name with highest number in case there are several.
Having it, i will be able to add outputs to the path of CL adjustment and see where exactly it sets up wrong CL. Looking from code, i can't find any obvious reasons why it would calculate it 2 higher.
-
- QC Coordinator
- Posts: 1921
- Joined: Sat Jul 28, 2018 8:51 am
Re: When casting display the CL of the spell in combat log
This one is fixed in next update, i found the offending code and changed it to working one.mrm3ntalist wrote: ↑Tue May 24, 2022 9:41 am Can you test the cl of a build with dragon disciple ? My builds with that prc get 2cl more than they should. I made a post about that months ago and I was I told it was fixed, however my builds still get the bonus cl
On the main topic, there is no resolution yet as i seek for the way to avoid running through every spell script to check it.