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 ... 19, 20, 21 ... 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: Sat Aug 12, 2017 16:39    Post subject: Reply with quote

Quote:
Is it possible the OnDamage event to PC in your's patch or functions Get and SetEventScript?
I tried to use NWNXFuncs_SetEventScript(object oObject, string sScript, int iEvent), but my server is crashing and i don't know what that reason is.

If you want to use this function to add OnDamage for PC it won't work even if it doesn't crash. The OnDamage event on Player is not fired at all.

Baaleos made OnDamage event.
Quote:
Also replacing nwnx_patch.dll from v1.27 on v1.28 i have stopped running the server from using nwnx, reason also unknown

Sorry, bad testing. Here is new version.
NWNCX_Patch and NWNX_Patch v1.29

DOWNLOAD

Fixes:
- fixed nwnx_patch crashing on start

New features and improvements:
- reworked former SPELL_RESISTANCE_OVERRIDE variable; new name is "GetSpellResistance" and now takes 0 into consideration, to remove override variable has to be deleted instead
- defensive stance will not be canceled by spellcasting and other non-movement actions, in fact the only way to cancel it would be manually now
- improved defensive stance softcoded script, it is now possible to remove the immobility effect
- softcoded script for pickpocket now uses nwnx functions for decreasing gold and removing item so victim gets no feedback
- more possibilities for attack of opportunity in 70_s2_aoo script; aoo can be set not only to be sneak attack but also death attack or both
- removed hardcoded immunity override for death attack and stunning fist, instead softcoded scripts now uses SetImmunityOverride function to achieve this

New custom functions:
- NWNXPatch_TakeItemFromCreature

Notes:
1) I had to rename SPELL_RESISTANCE_OVERRIDE variable to avoid issues with community patch spells that used this variable but cleaned it improperly using SetLocalInt to 0. This means that this functionality will be lost untill I release new version with updated spell scripts.

2) Added forgotten 'x2_inc_switches.nss' and 'x2_mod_def_load.nss' into plugin resources.

3) Function NWNXPatch_SetEffectIntegerVoid removed.

Right now, I will focus more on code polishing, improving already existing features and bugfixes rather than new features as its time to make a final or stable 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: Sat Aug 12, 2017 17:24    Post subject: Reply with quote

From Baaleos i already have OnDamage event and there is a bug in which the event is not triggered if the damage was lethal, i wrote him a message in the topic, but i'm not sure that he will fix it Sad
Back to top
View user's profile Send private message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Sat Aug 12, 2017 18:29    Post subject: Reply with quote

Thanks
Back to top
View user's profile Send private message
highv priest



Joined: 01 Mar 2013
Posts: 111

PostPosted: Sat Aug 12, 2017 20:50    Post subject: Reply with quote

Valbor wrote:
From Baaleos i already have OnDamage event and there is a bug in which the event is not triggered if the damage was lethal, i wrote him a message in the topic, but i'm not sure that he will fix it Sad


Technically it's not a bug on his behalf. The damage is an effect and all effects immediately get removed once something dies. I just used nwnx fixes to make the death state not happen from damage and apply effect death once hp is below 0.
Back to top
View user's profile Send private message
Valbor



Joined: 26 Dec 2016
Posts: 145

PostPosted: Sat Aug 12, 2017 21:21    Post subject: Reply with quote

highv priest wrote:
Valbor wrote:
From Baaleos i already have OnDamage event and there is a bug in which the event is not triggered if the damage was lethal, i wrote him a message in the topic, but i'm not sure that he will fix it Sad


Technically it's not a bug on his behalf. The damage is an effect and all effects immediately get removed once something dies. I just used nwnx fixes to make the death state not happen from damage and apply effect death once hp is below 0.

Thanks, it solves my problem Very Happy
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Wed Aug 16, 2017 6:09    Post subject: Reply with quote

NWNCX_Patch and NWNX_Patch v1.29b

DOWNLOAD

Fixes:
- fixed critical bug in client plugin that caused very frequent crashing
- fixed buying items from store not placing item where you dragged it

Revisited features:
- removed GetEffectPosition (was only used for now removed function SetEffectIntegerVoid anyway + it was not working properly with system effects)
IMPORTANT EDIT: also removed the improvement made to GetEffectType function. I realized some of the existing custom content scripts might rely on this function to return 0 (like if type is 0 and spellid is bigby then the effect must be knockdown so lets do some action). If you want to find out if effect is knockdown use new function NWNXPatch_GetEffectTrueType instead.

New custom functions:
- NWNXPatch_GetFirstEffect
- NWNXPatch_GetNextEffect
- NWNXPatch_GetEffectTrueType

New custom functions had to be created to actually support the already existing feature to apply effects with duration type INNATE (4) and EQUIPPED (3). Effects applied with this duration type are not retrievable via vanilla GetFirstEffect and GetNextEffect, so if you want to add effect with duration equipped, you will need these 3 functions to remove it.
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect


Last edited by ShaDoOoW on Wed Aug 16, 2017 12:13; edited 1 time in total
Back to top
View user's profile Send private message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Wed Aug 16, 2017 7:34    Post subject: Reply with quote

Thanks

Quote:
fixed buying items from store not placing item where you dragged it

The OnAcquireItem event and OnUnAcquireItem event does not fire?
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Wed Aug 16, 2017 7:40    Post subject: Reply with quote

Antegate wrote:
acquire/unacquire event

they should fire normally,

the problem there was that when you buy item you can buy it by right click and confirming price -> which then puts the item into first free space, or you can drag&drop the item from shop into your inventory perhaps last page. My bugfix for buying items with full inventory caused the second possibility to fail and instead put the item into first free spot again. Thats fixes so when you drag and drop item to last page, it will be put on last page as it should Smile
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Wed Aug 16, 2017 7:45    Post subject: Reply with quote

Ок. Now everything is clear Smile


---
Is the event possible before the OnPlayerEquipItem and OnPlayerUnEquipItem events to simulate curse things and make restrictions on item for example on the gender?
Events OnPlayerEquipItem and OnPlayerUnEquipItem often fail and do not work. When you quickly change clothes - you can catch a bug
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Wed Aug 16, 2017 12:10    Post subject: Reply with quote

hm, managed to bring OnDamaged event with different method than Baaleos (better method), it will fire the OnDamaged script assigned to player

However, the default script for OnDamage is default and enabling this feature would then called default each time player gets damages. It could break some of the custom content that rely on default such as 3.5ruleset or PRC (they use it as heartbeat). Also, it suffers the same bug as Baaleos method.

I can change the default script for OnDamaged to perhaps 70_mod_damaged but that would involve one extra hook which I would like to avoid.

Another option would be to make this feature disabled by default and allow to turn it on via ini settings, that way player playing singleplayer with PRC won't get affected while builders will be able to use it.

So, not sure if its worth it afterall especially if there is Baaleos' plugin that adds it as well.
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Wed Aug 16, 2017 12:19    Post subject: Reply with quote

Not everyone has a Baaleos' plugin

Quote:

Another option would be to make this feature disabled by default and allow to turn it on via ini settings, that way player playing singleplayer with PRC won't get affected while builders will be able to use it.

This is a good option
Back to top
View user's profile Send private message
highv priest



Joined: 01 Mar 2013
Posts: 111

PostPosted: Wed Aug 16, 2017 15:16    Post subject: Reply with quote

The baaleos plugin is public, no? Also I've had no issues with his plugin lol. I already had changed death health to -120 and was scripting it to kill.
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Fri Aug 18, 2017 14:30    Post subject: Reply with quote

NWNCX_Patch and NWNX_Patch v1.29c

DOWNLOAD

the package now contains 70_inc_spells include that is used by 70_s2_learnscroll but wasn't included externally

Fixes:
- fixed possible crash when using EffectModifyBAB
- fixed SetEffectCreator NWScript definition that wasn't cleaning variables properly thus leading to unexpected behavior on other effect functions
- fixed taunt softcoded script still using GetEffectType (which no longer returns EFFECT_TYPE_TAUNT)

New or improved features:
- better method of patching shou disciple 2d20 unarmed damage bug
- custom effects (truetype 96 and above, note 96 is used by modifyBAB) will now fire new script 70_mod_effects when applied and removed events, this allows to make new custom effects, example included inside script
- EffectModifyBAB will now show icon (using above events) and also update character sheet
- innate and equipped effects will be automatically applied to dead targets without need to use new function

New custom functions:
- NWNXPatch_ForceApplyEffectToObject

I had to significally rework the custom effects because it could cause crash. Since I had to hook new functions I also added new feature copied from linux nwnx_effects plugin -> OnApply and OnRemove event. And I used it for adding effect icon into the modifyBAB effect - it will show attack increase icon, if you don't like it you can remove it in 70_mod_effects.

NWNXPatch_ForceApplyEffectToObject was added to support OnApply/OnRemove effect for a cases where you would want to affect dead player but didn't want to use DURATION_TYPE_EQUIPPED or INNATE.

BTW I tested DURATION_TYPE_EQUIPPED and what it does is that it apply effect without showing icon and the effect will not be accessable via vanilla GetFirst/NextEffect functions. To handle it use NWNXPatch_GetFirst/NextEffect. INNATE will probably be exactly the same, not sure what the difference, but I think that nwn uses INNATE for system effects like racial type and EQUIPPED for effects coming from itemproperties. If there are any differences between the two outside of the usage I don't know.
_________________
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 Aug 18, 2017 18:04    Post subject: Reply with quote

Thanx
Back to top
View user's profile Send private message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Fri Aug 18, 2017 19:41    Post subject: Reply with quote

Thanks
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 ... 19, 20, 21 ... 42, 43, 44  Next
Page 20 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