logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
NWNX_Patch
Goto page Previous  1, 2, 3 ... 12, 13, 14 ... 42, 43, 44  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Mon Jun 12, 2017 14:24    Post subject: Reply with quote

highv priest wrote:
Does this modify the attack when used? When swung? Or when hit?
neither and all, this is outside of the usual scope you know

current special attack scripts triggers in the time before the attack roll is printed into chat, but when attack roll and damage is already calculated

the special attack attack roll bonus calculation would happen milisecond earlier when attack roll is going to be calculated
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Valbor



Joined: 26 Dec 2016
Posts: 145

PostPosted: Tue Jun 13, 2017 16:37    Post subject: Reply with quote

And when can we expect updates?
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Tue Jun 13, 2017 19:01    Post subject: Reply with quote

Valbor wrote:
And when can we expect updates?

What about just right now? Cool

NWNCX_Patch 1.23c (still only client plugin, server plugin once it will be properly tested)

DOWNLOAD

I completely remade the way special attacks are softcoded, they will no longer fire the old scripts 70_s2_knockdown etc. but instead they will fire 70_s2_specattk and they will fire it multiple times because the script will fire in 4 possible situations:
1) special attack feat was used on target
2) engine wants to calculate attack bonus for special attack
3) engine wants to calculate damage bonus for special attack
4) and after attack roll and damage was calculated (case of old softcoded scripts)

So each special attack can be fully rescripted from conditionals to use (unarmed/melee) to actual effects.

Now, every vanilla special attack plus Attack of Opportunity, Cleave, Greater Cleave and potentionally few more special cases are softcoded and will trigger 70_s2_specattk where you can modify them as you see fit.

70_s2_specattk already contains NWScript code that should perform every vanilla special attack in way how they works in vanilla. If there are differences, please report them.

On top of that. It is now possible to create custom special attack and it will fire 70_s2_specattk too. To do it, make an useable feat with no SPELLID. Then alter 70_s2_specattk and code your special attack from scratch.

More details, examples and notes are inside 70_s2_specattk script included in download.

And to make all of this possible I had to add new NWScript functions:
NWNXPatch_GetIsFeatGranted
NWNXPatch_GetTotalDamageDealtByType
NWNXPatch_SetTotalDamageDealtByType
NWNXPatch_ActionUseSpecialAttack
NWNXPatch_SetAttackRoll

see 70_inc_nwnx included in download archive for more details and yes, its possible to make a special attack to always roll 20 for attack you guessed right

Known issues:

Ki Damage - still hardcoded as the damage is calculated elsewhere but it should be possible to recalculate the damage and change it in 70_s2_specattk. That will however involve quite a complicated NWScript code for which I didn't have time. If someone can provide the code I wil include it. We could also change the way how critical hit Ki Damage works and calculate maximal result of all dices not just one as it is in vanilla (lets call it quality of life change).

Custom special attacks shows the "star" icon, not feat icon set in feat.2da.
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Valbor



Joined: 26 Dec 2016
Posts: 145

PostPosted: Tue Jun 13, 2017 19:35    Post subject: Reply with quote

ShaDoOoW wrote:
What about just right now? Cool

Thank Very Happy
Back to top
View user's profile Send private message
Valbor



Joined: 26 Dec 2016
Posts: 145

PostPosted: Tue Jun 13, 2017 21:28    Post subject: Reply with quote

NWNCX_Patch 1.23c Something happened with the attack roll, i'm confused http://pixs.ru/showimage/ThePrelude_7655414_26517356.png

Also in 70_s2_specattk.nss in this script you can make add these attacks:
const int SPECIAL_ATTACK_RIPOSTE = 65003; // Riposte Attack (Parry Mode) No idea whats with these numbers.
And special attacks from Circle Kick, Whirlwind Attack and Improved Whirlwind Attack since they are also considered as a special attacks when calculating on a roll.

In this regard, i had another question, is it possible to make a softcode on attacks from any mode, i.e. Dirty Fighting (Mode) attack or Flurry of Blows etc?
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Wed Jun 14, 2017 14:46    Post subject: Reply with quote

Valbor wrote:
NWNCX_Patch 1.23c Something happened with the attack roll, i'm confused http://pixs.ru/showimage/ThePrelude_7655414_26517356.png

Also in 70_s2_specattk.nss in this script you can make add these attacks:
const int SPECIAL_ATTACK_RIPOSTE = 65003; // Riposte Attack (Parry Mode) No idea whats with these numbers.
And special attacks from Circle Kick, Whirlwind Attack and Improved Whirlwind Attack since they are also considered as a special attacks when calculating on a roll.

In this regard, i had another question, is it possible to make a softcode on attacks from any mode, i.e. Dirty Fighting (Mode) attack or Flurry of Blows etc?

Sorry no idea how did I didn't notice this bug

DOWNLOAD - NWNCX_Patch + NWNX_Patch v 1.23c - yes finally server plugin as well!
- fixed the reported bug with attack roll log
- allowed to overwrite threat roll
- allowed to set attack to be killing blow (to make engine perform cleave and such -> added into quivering palm)
- new functions:
NWNXPatch_SetAttackSneak
NWNXPatch_SetAttackCriticalThreatRoll
NWNXPatch_SetAttackKillingBlow
to be used in special atack softcoded script in the attack bonus calculation event


As far as combat modes goes. Each combat mode effects are calculated really deep inside main combat engine functions and all of them at different place. It would be really hard to make them softcoded. It is not hard to do such modification statically ie. change values inside plugin but softcoded = call nwscript and then back to plugin is completely different matter. Its doable but I am not convinced its good idea.

What would you want to do with them specifically?
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Valbor



Joined: 26 Dec 2016
Posts: 145

PostPosted: Wed Jun 14, 2017 17:16    Post subject: Reply with quote

ShaDoOoW wrote:
As far as combat modes goes. Each combat mode effects are calculated really deep inside main combat engine functions and all of them at different place. It would be really hard to make them softcoded. It is not hard to do such modification statically ie. change values inside plugin but softcoded = call nwscript and then back to plugin is completely different matter. Its doable but I am not convinced its good idea.

What would you want to do with them specifically?

Well, for example in Dirty Fighting to increase the thread on a critical hit or execute a sneak attack.
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Wed Jun 14, 2017 18:04    Post subject: Reply with quote

Valbor wrote:
Well, for example in Dirty Fighting to increase the thread on a critical hit or execute a sneak attack.

I see. But look, the problem is that each combat mode is doing something else and its effects are coded in different place in engine.

So where would the softcode happen ? When you activate/deactivate that mode? Already handled by nwnx_events - Toggle Mode Event.

When the number of attacks is calculated? Then you won't be able to code what you want to do because that happens much later in engine.

To enable you to script what you want to do would require:
Toggle Mode event (easy to do, but at this moment I don't plan providing same functionality as other plugins unless I need that functionality to fix something), OnAttackRoll event (easy to do, but will fire damn so often) and in case you want to change damage then OnDamageRoll event .

That would mean to run two scripts for each attack roll in game. And if you want to change for example how Dirty Fighting works with concealment (such as ignoring it) then one more script.

Plus I would need to remove the actual Dirty Fighting code from engine to make it do nothing so it could be rescripted in NWScript.

I actually did all of this for special attacks but they are not used that often. Doing this for every attack is not good idea at all.

Probably the best would be to rescript the vanilla damage/attack roll calculation inside plugin, but I don't think I am able do this because there is a lot of debugging/client feedback which I don't know how to copy in c++.

I have some ideas though. Will see what I can do.
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Valbor



Joined: 26 Dec 2016
Posts: 145

PostPosted: Wed Jun 14, 2017 23:14    Post subject: Reply with quote

I add this in 1st event:
Code:
if(nEvent == SPECIAL_ATTACK_EVENTTYPE_USE_FEAT)
{

    else if(nType == SPECIAL_ATTACK_CALLED_SHOT_LEGS || nType == SPECIAL_ATTACK_CALLED_SHOT_ARMS)
    {
        NWNXPatch_ActionUseSpecialAttack(OBJECT_SELF,oTarget,nType);
    }
}

otherwise it just wouldn't work.

NWNXPatch_SetAttackSneak(OBJECT_SELF, 2); not work (i've only test in 2nd event). Also you may add in this function the ability to simultaneously use 2 of these attacks as in http://i12.pixs.ru/storage/6/1/1/Grand0000e_3146810_26529611.png

NWNXPatch_SetCanCastInPolymorph(OBJECT_SELF, TRUE); not work for client in multiplayer without nwncx_patch v23c at this client.
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Thu Jun 15, 2017 12:23    Post subject: Reply with quote

Good catch with called shot. I added the code into my 70_s2_specattk.

Death attack works actually - the damage is calculated properly if you have death attack feats, but combat log doesn't show it properly. Trying to fix.
BTW its possible to use it together if you set it with 1 and then with 2, but I already modified the function to allow set 3 which will do this in single command, its just the log not working properly...

Yes this feature is server-client. Client must have nwncx_patch to work properly.
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Fri Jun 16, 2017 12:23    Post subject: Reply with quote

NWNX_Patch and NWNCX_Patch v1.23d

DOWNLOAD

Changes:
- fixed several issues with AB/critical threat which were caused by old fix for Ki Critical feat issue
- added possibility to override weapon critical threat and multiplier with custom values
- added missing code in 70_s2_specattack for called shot

New NWScript functions:
NWNXPatch_GetWeaponCriticalThreat
SetWeaponCriticalThreat
NWNXPatch_GetWeaponCriticalMultiplier
SetWeaponCriticalMultiplier
NWNXPatch_SetAttackCoupeDeGrace

EDIT: dammit, I overlooked NWNXPatch_SetAttackSneak function inside code for knockdown I used for testing, please remove it by yourself.
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Valbor



Joined: 26 Dec 2016
Posts: 145

PostPosted: Fri Jun 16, 2017 15:11    Post subject: Reply with quote

Quivering Palm: you missed level cap for triggered.
Sap: http://nwn.wikia.com/wiki/Sap triggered if successfully deals damage. And there's more to say "This feat will only work on large-sized creatures or smaller.", although i'm unsure why this is necessary.

And in SetWeaponCriticalMultiplier nThreat need to nMultiplier.

Very glad to new functions Very Happy
Back to top
View user's profile Send private message
Valbor



Joined: 26 Dec 2016
Posts: 145

PostPosted: Fri Jun 16, 2017 16:26    Post subject: Reply with quote

SetWeaponCriticalThreat and SetWeaponCriticalMultiplier after applying these functions are not updated in the statistics of the character, only after re-equip weapon.
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Fri Jun 16, 2017 17:04    Post subject: Reply with quote

Valbor wrote:
Quivering Palm: you missed level cap for triggered.
Sap: http://nwn.wikia.com/wiki/Sap triggered if successfully deals damage. And there's more to say "This feat will only work on large-sized creatures or smaller.", although i'm unsure why this is necessary.

And in SetWeaponCriticalMultiplier nThreat need to nMultiplier.

Very glad to new functions Very Happy

okay added code to implement the forgotten conditions on quivering palm and sap, also added missing feedback messages when using knockdown on too large/small target or called shot on target without arms/legs

So far still no luck with the nonfunctional feedback when making attack to be death attack.

As far as combat modes goes thats not going to be easy either.
In my testing, I removed the ab penalty and damage bonus from power attack, but while that works , client still shows -5ab in character sheet because client calculates is on his own instead of taking the attack bonus value from server.
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Valbor



Joined: 26 Dec 2016
Posts: 145

PostPosted: Fri Jun 16, 2017 17:13    Post subject: Reply with quote

Is it possible to add function *automatic hit* to special attack, as in the Coupe De Grace?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development All times are GMT + 2 Hours
Goto page Previous  1, 2, 3 ... 12, 13, 14 ... 42, 43, 44  Next
Page 13 of 44

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group