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 ... 13, 14, 15 ... 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: Fri Jun 16, 2017 18:02    Post subject: Reply with quote

Valbor wrote:
Is it possible to add function *automatic hit* to special attack, as in the Coupe De Grace?
Unlikely. I can add function to set attack result message to *critical hit* *failed* *resisted* or *devastating critical hit* and few more, but *automatic hit* is not working without setting attack to be coupe de grace too. It seems to be some clientside limitation as the attack roll you see is purely client side thing. Which means it will be very hard to workaroud and even if I did it it would not work unless player used nwncx_patch therefore this is not in my TODO plan.

Btw, the last download contains forgotten code to remove damage bonus and attack penalty from power attack - in case you noticed this, its small oversight which I will remove next time.

And when looking for oversights I noticed there is already code to modify number of attacks.
Add integer variable with name:
NUM_ONHAND
NUM_OFFHAND
NUM_EXTRA

ie.
SetLocalInt(oPC,"NUM_OFFHAND",3); -> player will have 3 offhand attacks

I think I didn't announced this...
_________________
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 19:41    Post subject: Reply with quote

But your disarm still creates multiple copies Confused i did the following:

Code:
void Disarm(object oWeapon, object oTarget)
{
    CopyObject(oWeapon, GetLocation(oTarget));
}
void PerformDisarm(object oTarget, object oWeapon)
{
    if(GetIsObjectValid(oTarget) && GetIsObjectValid(oWeapon) && GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oTarget) == oWeapon)
    {
        if(GetIsPC(oTarget))
        {
          //CopyObject(oWeapon,GetLocation(oTarget));
            DelayCommand(0.0, Disarm(oWeapon, oTarget));
        }
        DestroyObject(oWeapon);//there needs to be a delay because the script to get it closer to vanilla
    }
}

Probably due to the fact that the DestroyObject function automatically delays the deletion in 0.0 seconds, as and delay from function of AssignCommand.
Back to top
View user's profile Send private message
Valbor



Joined: 26 Dec 2016
Posts: 145

PostPosted: Sat Jun 17, 2017 8:53    Post subject: Reply with quote

I would suggest that more such functions in parallel with your
Code:
//Sets the behavior of critical multiplier from nFeat
//Example: nFeat = FEAT_EPIC_DEVASTATING_CRITICAL_BASTARDSWORD (i.e. with this feat creature have more critical multiplier for Bastard sword)
void SetCriticalMultiplier_FromFeat(int nFeat, int nMultiplier);

void SetCriticalThreat_FromFeat(int nFeat, int nThreat);

or to somehow modify SetWeaponCriticalMultiplier and SetWeaponCriticalThreat for this.
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sat Jun 17, 2017 9:45    Post subject: Reply with quote

Valbor wrote:
I would suggest that more such functions in parallel with your
Code:
//Sets the behavior of critical multiplier from nFeat
//Example: nFeat = FEAT_EPIC_DEVASTATING_CRITICAL_BASTARDSWORD (i.e. with this feat creature have more critical multiplier for Bastard sword)
void SetCriticalMultiplier_FromFeat(int nFeat, int nMultiplier);

void SetCriticalThreat_FromFeat(int nFeat, int nThreat);

or to somehow modify SetWeaponCriticalMultiplier and SetWeaponCriticalThreat for this.

Would be unneccessary complicated and wouĺd not solved all possible cases. While you want to tie it with feat, someone else might want to tie it with combat mode instead.

If you want to tie threat or multiplier with some feat, all you need to do is to check for this feat in OnEquip, get original threat/multiplier, add your bonus and set new threat/multiplier. Then in UnEquip remove the threat/multiplier override. I just need to add info inside function that setting value 0 will remove the override and restores vanilla behavior.

Code:
void SetWeaponCriticalThreat(object oCreature, object oWeapon, int nThreat)
{
    if(!nThreat)
    {
        DeleteLocalInt(GetIsObjectValid(oWeapon) ? oWeapon : oCreature,"CriticalThreatOverride");
    }
    else if(nThreat > 0 && nThreat < 21)
    {
        SetLocalInt(GetIsObjectValid(oWeapon) ? oWeapon : oCreature,"CriticalThreatOverride",nThreat);
    }
}

void SetWeaponCriticalMultiplier(object oCreature, object oWeapon, int nMultiplier)
{
    if(!nMultiplier)
    {
        DeleteLocalInt(GetIsObjectValid(oWeapon) ? oWeapon : oCreature,"CriticalMultiplierOverride");
    }
    else if(nMultiplier > 0)
    {
        SetLocalInt(GetIsObjectValid(oWeapon) ? oWeapon : oCreature,"CriticalMultiplierOverride",nMultiplier);
    }
}

replace the functions with this code, setting 0 will then restore vanilla values
_________________
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: Sat Jun 17, 2017 11:53    Post subject: Reply with quote

NWNXPatch_GetWeaponCriticalMultiplier(oPC, oItem); and NWNXPatch_GetWeaponCriticalThreat(oPC, oItem); not show correctly and no support from Keen property.
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sat Jun 17, 2017 12:49    Post subject: Reply with quote

Valbor wrote:
NWNXPatch_GetWeaponCriticalMultiplier(oPC, oItem); and NWNXPatch_GetWeaponCriticalThreat(oPC, oItem); not show correctly and no support from Keen property.
another overlook in the include file

use this:

Code:
int NWNXPatch_GetWeaponCriticalThreat(object oCreature, object oWeapon)
{
    SetLocalString(GetModule(),"NWNX!PATCH!FUNCS!302",ObjectToString(oCreature)+"|"+ObjectToString(oWeapon));
    DeleteLocalString(GetModule(),"NWNX!PATCH!FUNCS!302");
    int retVal = GetLocalInt(GetModule(),"NWNXPATCH_RESULT");
    DeleteLocalInt(GetModule(),"NWNXPATCH_RESULT");
    return retVal;
}

int NWNXPatch_GetWeaponCriticalMultiplier(object oCreature, object oWeapon)
{
    SetLocalString(GetModule(),"NWNX!PATCH!FUNCS!303",ObjectToString(oCreature)+"|"+ObjectToString(oWeapon));
    DeleteLocalString(GetModule(),"NWNX!PATCH!FUNCS!303");
    int retVal = GetLocalInt(GetModule(),"NWNXPATCH_RESULT");
    DeleteLocalInt(GetModule(),"NWNXPATCH_RESULT");
    return retVal;
}

_________________
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 21, 2017 7:04    Post subject: Reply with quote

You will have a function on the similarity SetPCOBject( object oCurrent, object oNew ) from NWNX_Cool? I could use it but it does not stack with your patch.
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Wed Jun 21, 2017 17:11    Post subject: Reply with quote

Valbor wrote:
You will have a function on the similarity SetPCOBject( object oCurrent, object oNew ) from NWNX_Cool? I could use it but it does not stack with your patch.

should be possible to make nwnx_cool work with nwnx_patch

it will require to disable some hooks either in nwnx_cool or nwnx_patch but it must work
_________________
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 21, 2017 17:46    Post subject: Reply with quote

ShaDoOoW wrote:
should be possible to make nwnx_cool work with nwnx_patch

it will require to disable some hooks either in nwnx_cool or nwnx_patch but it must work

I found to disable, but here's the thing, when i use this function, the server is crashing and i don't even know where i can find a plugin with such a function to work. I really need it, grateful for any help.
Back to top
View user's profile Send private message
DarkSet



Joined: 06 Jun 2016
Posts: 98

PostPosted: Thu Jun 22, 2017 16:42    Post subject: Reply with quote

I was away for some time and see lot of interesting stuff was added to the patch. Have a question - do you update documentation as well? Scripts library? Or this topic is the only place to find all the changes and one must read it carefully not to miss something?
Back to top
View user's profile Send private message
Valbor



Joined: 26 Dec 2016
Posts: 145

PostPosted: Thu Jun 22, 2017 20:38    Post subject: Reply with quote

NWNXPatch_SetGender requires you to re-enter the game to change the appearance of the gender, is there any way to fix it?
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Thu Jun 22, 2017 20:49    Post subject: Reply with quote

Valbor wrote:
NWNXPatch_SetGender requires you to re-enter the game to change the appearance of the gender, is there any way to fix it?

Changing appearance is not what the function is supposed to do and if that happens its secondary effect of it.

Try change appearance to something else and then back, could refresh it.
_________________
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: Thu Jun 22, 2017 20:50    Post subject: Reply with quote

DarkSet wrote:
I was away for some time and see lot of interesting stuff was added to the patch. Have a question - do you update documentation as well? Scripts library? Or this topic is the only place to find all the changes and one must read it carefully not to miss something?
I didn't update documentation yet, scripts/includes are added in last release.
_________________
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: Thu Jun 22, 2017 21:15    Post subject: Reply with quote

ShaDoOoW wrote:
Valbor wrote:
NWNXPatch_SetGender requires you to re-enter the game to change the appearance of the gender, is there any way to fix it?

Changing appearance is not what the function is supposed to do and if that happens its secondary effect of it.

Try change appearance to something else and then back, could refresh it.

Male appearance still remain a male after change gender on female, even if change the appearance then.

Found in this thread a similar problem
http://www.nwnx.org/phpBB2/viewtopic.php?t=1535&postdays=0&postorder=asc&start=75
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Thu Jun 22, 2017 21:31    Post subject: Reply with quote

Valbor wrote:

Male appearance still remain a male after change gender on female, even if change the appearance then.

Found in this thread a similar problem
http://www.nwnx.org/phpBB2/viewtopic.php?t=1535&postdays=0&postorder=asc&start=75

hmm what about polymorph? Also - is this a problem for any/every characters or just for player characters?
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
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 ... 13, 14, 15 ... 42, 43, 44  Next
Page 14 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