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 ... 41, 42, 43, 44  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Valbor



Joined: 26 Dec 2016
Posts: 145

PostPosted: Thu May 24, 2018 16:23    Post subject: Reply with quote

Oh sorry i can't download it, some problems with Google, page freezes Sad
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Thu May 24, 2018 18:48    Post subject: Reply with quote

DarkSet wrote:
Great, thanks.

Have a question about this uncapped functions:
if we have cap for abilities set to 24, and char has +24 to STR added on him and I apply +6 STR with NWNXPatch_EffectAbilityIncreaseUncapped, so char has +30 STR now
and then he unequipped item with +10 STR, and now his STR is +20
and then he equips this item again - will it add +10 STR and so again give +30 in total or it will add only +4 to STR as there is only 4 leaft to +24 cap, and effect from item is not NWNXPatch_EffectAbilityIncreaseUncapped function?

Same question for attack uncapped function.

And one more for attack uncapped - increasing offhand attack does not affect main hand attack if there is no offhand weapon and left hand if occupied by shield or two handed weapon?
Especially two handed weapon as it couns as occupying both hands.

So the case here: if I create a feat increasing off-hand attack by 4 and give this attack with uncapped function - I want to be sure it will apply only if there is off-hand weapon and will not be applied in any other case. I can handle it by adding bonus only on offhand wapon equip and remove on unequip, but it would be much easier to just add bonus on char enter if he has a feat.

it should work correctl as you would expect though i recommend to test it as I didn't perform these exact steps myself - if it won't work the way you expect I can fix it

Valbor - i will upload it on vault later today then
_________________
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 May 24, 2018 19:06    Post subject: Reply with quote

ShaDoOoW wrote:
Valbor - i will upload it on vault later today then

Ok, thanks, on vault i download without problems.
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sat May 26, 2018 9:23    Post subject: Reply with quote

NWNCX_Patch and NWNX_Patch v1.35a

DOWNLOAD (Google Disk), DOWNLOAD (vault)

Just quick update. I found and fixed another memory leak that could cause crashing. This time it was happening when firing ranged weapon with low ammount of ammunition.

Fixes to the plugin:
- fixed another memory leaks that could cause crashing in client/server when loading game/shutting down
_________________
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: Mon May 28, 2018 21:54    Post subject: Reply with quote

Important: Found quite critical error in 70_inc_nwnx include file. Basically after using SetEffectInteger (or any Uncapped effect functions), NWNXPatch_GetFirst/NextEffect stops working.

to fix this, update the definition by this code

Code:
effect NWNXPatch_SetEffectInteger(effect eEffect, int nTh, int nValue)
{
    SetLocalInt(GetModule(),"SetEffectIntegerNth",nTh);
    SetLocalInt(GetModule(),"SetEffectIntegerVal",nValue);
    eEffect = VersusTrapEffect(eEffect);
    DeleteLocalInt(GetModule(),"SetEffectIntegerNth");
    return eEffect;
}

_________________
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 May 31, 2018 12:24    Post subject: Reply with quote

I had to make few adjustments and add some new features I found my plugin lacking when working on PRC Lite.

Before I make a new release there are a few questions I have for this plugin users:

- Variable based option to set whether is item useable or not. Needed? Myself I didn't find this useful.

- I had to rework computing feat uses, as I found out the uses got bugged after restart/reload, if a module builder used function to change feat uses total over normal maximum. This however changed function IncrementRemainingFeatUses to ignore normal feat uses maximum. I think this is neat feature even though unintented, but maybe I should correct this for compatibility reasons? I was thinking that someone might have written a script which will try increment feat uses until they won't increase. Such script would caused feat uses to go to 255 under nwnx_patch.

- Unarmed Damage calculation. This was there using 2da, which wasn't ideal and I removed it because the function is running too often and could cause notable load. I didn't bring this feature back using variables because I knew there is a suitable workaround existing and thats creature weapon. This is true but the workaround is not seemless - not only player needs creature weapon proficiency feat, not only the item acquiring is visible to the player but the item has to be removed from slot whenever player equips weapon because otherwise the character sheet will still show creature weapon in the list of attacks. So it would made a sense to allow this. On the other hand, while I can enable to modify unarmed damage and plugin already allows modify threat range or critical multiplier, it won't allow everything someone might want to add to unarmed weapons. For example feat Keen Strike (3.5 Dnd Epic rules) allows to deal slashing damage with unarmed weapon. That would require to use creature weapon anyway (or make another nwnx feature to change unarmed damage type....), similar issue would be with on-hit properties and vampiric regeneration (although that would be probably workaround-able using OnDamaged event). So is it worth it then or not? How much do you guys despise the creature weapon workaround? Smile

- Modifying speed: I found out that the functions Get/SetMovementRate Factor are bugged. The problem isn't in the plugin, but in engine. Whatever I did, after using it in any way, after player did some actions, unequip/equip/stealth/encumbrance, the resulting speed got bugged and player ended up mostly with higher speed than he should have - and this stacked. So, I added new feature which will modify vanilla GetMovementRate factor with variable on creature. This works perfectly. The question now is, whether the functions Get/SetMovementRateFactors are then for any use? I suppose get is useful for debugging purposes, but considering Set leads to incorrect values, shouldn't that be removed?

- And last: SetRacialType. In singleplayer I found out that this function will force appearance change whenever is game loaded or reloaded. This is serious drawback but it is normal. Game seems to force appearance matching racial_type. Not sure if server does this too (I suppose not). Either way, the question is what to do with this - should I aim to remove the vanilla appearance update on load? Or should I leave it be to scripters - afterall they can restore the appearance manually using SetCreatureAppearanceType function. Or something else?
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
DarkSet



Joined: 06 Jun 2016
Posts: 98

PostPosted: Sat Jun 02, 2018 0:49    Post subject: Reply with quote

Quote:
- Variable based option to set whether is item useable or not. Needed? Myself I didn't find this useful.

I personally did not use it yet, but i see it's usable in some scenarious so I'd rather have it than not.
And if it can override any reasons why item is unusable, for example allow to equip weapon without proper proficiency feat - that is great and I have at least one use case for it to implement.

Quote:
- I had to rework computing feat uses, as I found out the uses got bugged after restart/reload, if a module builder used function to change feat uses total over normal maximum. This however changed function IncrementRemainingFeatUses to ignore normal feat uses maximum. I think this is neat feature even though unintented, but maybe I should correct this for compatibility reasons? I was thinking that someone might have written a script which will try increment feat uses until they won't increase. Such script would caused feat uses to go to 255 under nwnx_patch.

I personally will benefit from this. I tried to do paladin's Lay on Hands usable as many times as turn undead, like Divine Might/Shield work. And found no way for it except restoring feat use if there are still turn undead uses with decreasing them. This works, but player sees only 1 use for lay on hands and must remember that it's actually equal to turn uses.
With this feature to set uses above maximum I can increase Lay on Hands uses to Turn uses number and just decrease both in usage scripts.
Minor, but still.
Have some scenarious to implement with Epic Spells as well.
And with this feature a function to get normal max uses will be handfull, for not to go the long way to check 2das.

Code:
- Unarmed Damage calculation. This was there using 2da, which wasn't ideal and I removed it because the function is running too often and could cause notable load. I didn't bring this feature back using variables because I knew there is a suitable workaround existing and thats creature weapon. This is true but the workaround is not seemless - not only player needs creature weapon proficiency feat, not only the item acquiring is visible to the player but the item has to be removed from slot whenever player equips weapon because otherwise the character sheet will still show creature weapon in the list of attacks. So it would made a sense to allow this. On the other hand, while I can enable to modify unarmed damage and plugin already allows modify threat range or critical multiplier, it won't allow everything someone might want to add to unarmed weapons. For example feat Keen Strike (3.5 Dnd Epic rules) allows to deal slashing damage with unarmed weapon. That would require to use creature weapon anyway (or make another nwnx feature to change unarmed damage type....), similar issue would be with on-hit properties and vampiric regeneration (although that would be probably workaround-able using OnDamaged event). So is it worth it then or not? How much do you guys despise the creature weapon workaround? Smile

I personally don't like creature weapon approach. And gloves will not work this way. So I don't change unarmed damage at all. But it can be very usefull if can be done properly via functions/variables.

Code:
- Modifying speed: I found out that the functions Get/SetMovementRate Factor are bugged. The problem isn't in the plugin, but in engine. Whatever I did, after using it in any way, after player did some actions, unequip/equip/stealth/encumbrance, the resulting speed got bugged and player ended up mostly with higher speed than he should have - and this stacked. So, I added new feature which will modify vanilla GetMovementRate factor with variable on creature. This works perfectly. The question now is, whether the functions Get/SetMovementRateFactors are then for any use? I suppose get is useful for debugging purposes, but considering Set leads to incorrect values, shouldn't that be removed?

will GetMovementRate set certain speed for character? Will it have restrictions like max 150% of speed increase, immunifies and freedom of movement prevent speed decrease, funny things with Haste stacking?
Because I really like the idea of how Get/SetMovementRate Factor work. But with bugs it's certanly not the thing to use.

Quote:
- And last: SetRacialType. In singleplayer I found out that this function will force appearance change whenever is game loaded or reloaded. This is serious drawback but it is normal. Game seems to force appearance matching racial_type. Not sure if server does this too (I suppose not). Either way, the question is what to do with this - should I aim to remove the vanilla appearance update on load? Or should I leave it be to scripters - afterall they can restore the appearance manually using SetCreatureAppearanceType function. Or something else?

forcing appearance change is not good. On the other hand it really can be overriden. Maybe you can add parameter to the function allowing to force or not force appearance change and make it force by default for backwards compatibility?
It's just IT Analyst in me talking Smile As an nwn developer don't use race change on PCs much so any decision here will most likely not touch me.
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sat Jun 02, 2018 8:16    Post subject: Reply with quote

DarkSet wrote:
I personally will benefit from this. I tried to do paladin's Lay on Hands usable as many times as turn undead, like Divine Might/Shield work. And found no way for it except restoring feat use if there are still turn undead uses with decreasing them.

But nwnx_patch already offers this feature, it is just not working properly on relog (but you can fix the uses in OnEnter if you store them in database).
there should be function NWNXPatch_SetFeatTotalUses, use it to set lay on hands to 10, then you will be able to IncreaseFeatUses up to 10. Or wait for my new version, there you will be able to use IncreaseFeatUses on any feat directly (though SetFeatTotalUses is still useful as it will handle uses after rest automatically).

Quote:
will GetMovementRate set certain speed for character? Will it have restrictions like max 150% of speed increase, immunifies and freedom of movement prevent speed decrease, funny things with Haste stacking?
Because I really like the idea of how Get/SetMovementRate Factor work. But with bugs it's certanly not the thing to use.

First of all, lets not confuse SetMovementRate and GetMovementRate with SetMovementRateFactor and GetMovementRateFactor. The first functions gets/sets the base movement rate defined in creaturespeed.2da. This works well and you always could increase PC speed this way if you added new entries into 2da. This way it will stack with anything, but requires 2da edits and bit more work. The factor functions were supposed to modify the actual speed after modifications are taking into account, such as monk speed, haste, encumbrance. This can be used for bit more things - you can impose a hard cap on monk speed this way etc. (You can do it already now but since it is bugged I recommend to wait for new version)
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
DarkSet



Joined: 06 Jun 2016
Posts: 98

PostPosted: Sat Jun 02, 2018 14:53    Post subject: Reply with quote

Quote:
there should be function NWNXPatch_SetFeatTotalUses

did not know about that one, will look closer, thanks!

Quote:
First of all, lets not confuse SetMovementRate and GetMovementRate with SetMovementRateFactor and GetMovementRateFactor. The first functions gets/sets the base movement rate defined in creaturespeed.2da. This works well and you always could increase PC speed this way if you added new entries into 2da. This way it will stack with anything, but requires 2da edits and bit more work. The factor functions were supposed to modify the actual speed after modifications are taking into account, such as monk speed, haste, encumbrance. This can be used for bit more things - you can impose a hard cap on monk speed this way etc. (You can do it already now but since it is bugged I recommend to wait for new version)

well, I actually planned to do speed based on race and CON mod, so 2da is not enoughp for this.
And actually I planned to change monk speed - do a fake feat instead of vanilla one and recalculate actual speed with this rate functions. And yes, now it does not cap monk speed, it just sets base speed for char and than monk speed and other speed bonuses are applied anyway.
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sat Jun 02, 2018 16:03    Post subject: Reply with quote

NWNCX_Patch and NWNX_Patch v1.36

DOWNLOAD (vault)

Fixes to the plugin:
- fixed feat uses to get bugged when relogging, if builder used fiunction NWNXPatch_SetFeatUsesTotal
- fixed ability increases from items that got bugged when uncapped ability increase has been applied

Revisited fixes/features:
- removed SetMovementRateFactor function as it caused speed stacking, use SetMovementRaceFactorModifier instead now
- reworked the attack increase uncapped feature to use same code as uncapped ability to avoid potential issues

New fixes and features:
- added OnCriticalHit event, the event fires script 70_mod_crithit
- enabled Weapon of Choice to work for unarmed attacks, unfortunately only critical multiplier and threat bonus works, the WM bonus to attack doesn't work for neither unarmed nor ranged/throwing weapons (I suggest to workaround that using AttackIncreaseUncapped as I don't plan to fix this in near future)
- added option to override default unarmed damage dice value, use either variable "UnarmedDiceOverride" (int) or corresponding function in 70_inc_nwnx
- added option to override default unarmed damage die value, use either variable "UnarmedDieOverride" (int) or corresponding function in 70_inc_nwnx
- added option to override default unarmed damage type value, use either variable "UnarmedTypeOverride" (int) or corresponding function in 70_inc_nwnx
- effect event registering: added three new functions (see below) which allows to "register" specified effect type to fire 70_mod_effects dynamically. This is useful to reduce load and increase efficiency. So you can have all effects turned off by default, and then when player acquire certain feat or class have this player only run this event.
- added secondary parameter into GetMovementRateFactor that allows to return base movement rate factor value without monk speed alterations
- vanilla function IncrementRemainingFeatUses can now increase feat uses over their normal maximum uses
- vanilla function ForceRest will now trigger module event duplicate script 70_mod_def_rest with a rest event type REST_EVENTTYPE_REST_FORCEREST. Please make sure you do not use ForceRest in this script (or check that event type != force rest) otherwise you cause neverending loop and critically bug out your nwn client/server.
- added variable to override whether the item can be used or not. Use "CanUse" = -1 when you want to make item unusable, 1 when you want to make normally unusable item usable.

New custom functions:
- NWNXPatch_SetMovementRateFactorModifier - alters the vanilla result of GetMovementRateFactor by your own value
- NWNXPatch_RegisterEffectEvent
- NWNXPatch_UnregisterEffectEvent
- NWNXPatch_GetIsEffectEventRegistered
- NWNXPatch_GetRoundStarted - returns the time when current round
- NWNXPatch_SetUnarmedDamageDiceOverride
- NWNXPatch_SetUnarmedDamageDieOverride
- NWNXPatch_SetUnarmedDamageTypeOverride


Notes:

I didn't test server plugin at all. I just copied the code from client, it should work but consider testing it on your own before using it for running server.

CanUse variable will not work for polymorphed characters. (I can make it to work, but I was thinking the 2da is probably enough, or isn't it?)

I forgot to include an example script for critical hit event into package with plugins, so there is it:
Code:
//::///////////////////////////////////////////////
//:: Community Patch OnCriticalHit module event script
//:: 70_mod_crithit
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This script will run when any creature strikes a critical hit.

The usual use is to add special On-Hit effects or damage.

Requires running game via NWNX or NWNCX and Community Patch plugin.

Following functions works in this event:
NWNXPatch_SetAttack*
NWNXPatch_SetTotalDamageDealtByType
*/
//:://////////////////////////////////////////////
//:: Created By: Shadooow for Community Patch 1.72
//:: Created On: 31-05-2017
//:://////////////////////////////////////////////

#include "70_inc_nwnx"
#include "inc_prclite"

void main()
{
    object oCreature = OBJECT_SELF;
    object oWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND);
    if(oWeapon != OBJECT_INVALID && (GetBaseItemType(oWeapon) == BASE_ITEM_SHORTSPEAR || GetBaseItemType(oWeapon) == BASE_ITEM_TRIDENT))
    {
        if(GetHasFeat(FEAT_STORMLORD_SHOCKING_WEAPON))
        {
            NWNXPatch_SetTotalDamageDealtByType(oCreature,DAMAGE_TYPE_ELECTRICAL,d10());
        }
        if(GetHasFeat(FEAT_STORMLORD_THUNDER_WEAPON))
        {
            NWNXPatch_SetTotalDamageDealtByType(oCreature,DAMAGE_TYPE_SONIC,d8());
        }
    }
}

_________________
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: Sat Jun 02, 2018 20:09    Post subject: Reply with quote

DarkSet wrote:
forcing appearance change is not good. On the other hand it really can be overriden. Maybe you can add parameter to the function allowing to force or not force appearance change and make it force by default for backwards compatibility?
It's just IT Analyst in me talking Smile As an nwn developer don't use race change on PCs much so any decision here will most likely not touch me.
Just headsup. After spending hours in debugger trying to find place when appearance is changed in engine I realized I might be looking at wrong place and indeed I was. The appearance change is caused by wonderful 1.69 horse scripts, not by engine. So there are no problem with plugin itself.
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
DarkSet



Joined: 06 Jun 2016
Posts: 98

PostPosted: Sat Jun 02, 2018 22:33    Post subject: Reply with quote

thats ok

Does critical hit event fire on sneak attack? If not - can you make one? I'd like to add more sneak damage for rouge and assasin as item properties.
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sun Jun 03, 2018 8:05    Post subject: Reply with quote

DarkSet wrote:
thats ok

Does critical hit event fire on sneak attack? If not - can you make one? I'd like to add more sneak damage for rouge and assasin as item properties.
should
_________________
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 07, 2018 21:58    Post subject: Reply with quote

NWNCX_Patch and NWNX_Patch v1.37

DOWNLOAD (vault)

Fixes to the plugin:
- fixed crash when using custom effects
- fixed crash with unarmed attacks
- fixed crash with custom spellcaster 2das that had 16 characters in their name
- fixed crash when using recommended button when selecting spells of custom spontaneous spellcaster
- fixed feats with (normally) unlimited uses having 0 uses per day
- fixed unlimited spells not working correctly

Revisited fixes/features:
- EffectModifyBAB reworked to actually replace BAB, not just increase number of attacks

New fixes and features:
- just 5 new functions, see below

New custom functions:
- NWNXPatch_EffectIgnoreArcaneSpellFailure - new effect which will allow ignore arcane spell failure from armor/shield - can be made class specific (ie. this will allow you to implement removal of arcane spell failure for bard without affecting spells of sorcerer/wizard)
- NWNXPatch_PerformMeleeAttacks - performs real attack(s) without the action
- NWNXPatch_SetSpellFailure - changes arcane spell failure from armor/shield
- NWNXPatch_SetSkillCheckPenalty - changes skill check penalty from armor/shield
- NWNXPatch_SetSkillPointsRemaining - modifies players remaining (saved) skill points
_________________
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: Mon Jun 11, 2018 14:20    Post subject: Reply with quote

NWNCX_Patch and NWNX_Patch v1.38

DOWNLOAD (vault)

New fixes and features:
- improved order of classes in levelup class selection - it will now show custom base classes before any prestige classes (NWNCX_Patch feature)

New custom functions:
- NWNXPatch_EffectSpellLevelImmunity - as itemproperty but effect (suprisingly this effect is missing in vanilla)
- NWNXPatch_EffectBonusFeat
- NWNXPatch_EffectIcon
- NWNXPatch_TransferEffectValuesIntoNthEffect - see remarks
- NWNXPatch_SetItemCastSpeed - ever wanted to reduce the wait time after using item? now you can
- NWNXPatch_SetSneakDamageBonus - increases sneak attack damage

Remarks:

The three new effects are nothing new actually - this was already possible to do since 1.33 or something where I presented effects manipulating. I simply created a custom functions in NWScript that are using other NWNXPatch_ functions.

NWNXPatch_TransferEffectValuesIntoNthEffect will let you modify an actual effect on creature. I think I mentioned this in effect tutorial I wrote, but again, this wasn't possible before. In fact, the effect you get from GetFirst/Next functions is just a copy of the effect that is on creature and any modifications into this effect will not manifest on creature. One solution is to remove old effect and re-apply it with changed values, however this is not gonna work with effects in link. So, this functions will copy all values from effect you provide into nTh effect on creature. You need to calculate the internal position of the effect, ie. you must use NWNXPatch_GetFirst/NextEffect, not vanilla GetFirst/NextEffect!
_________________
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 ... 41, 42, 43, 44  Next
Page 42 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