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



Joined: 20 Apr 2012
Posts: 100

PostPosted: Mon Sep 04, 2017 10:42    Post subject: Reply with quote

ok Smile

I will not consider the success of AOO Smile
Back to top
View user's profile Send private message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Mon Sep 04, 2017 11:05    Post subject: Reply with quote

I saw you added your events as modular events. Probably for the next version. Is it just duplication of modular events?

I'm interested in OnPlayerModuleEquipe* and OnPlayerModuleUnEquipe*.
Can I cancel the dressing / taking off of the equipment, through them?
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Mon Sep 04, 2017 11:31    Post subject: Reply with quote

Antegate wrote:
I saw you added your events as modular events. Probably for the next version. Is it just duplication of modular events?

I'm interested in OnPlayerModuleEquipe* and OnPlayerModuleUnEquipe*.
Can I cancel the dressing / taking off of the equipment, through them?

Yes this will be in new version and its just duplication of normal events.

I will release update later today and write how it works with some remarks as usual. But, since I updated plugin documentation, you can read about that feature (and everything else) there.

If you read it before it will be hard to compare what is new there though as I was just adding new lines here and there. But the info about module event "duplicates" is there.
_________________
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 Sep 04, 2017 12:35    Post subject: Reply with quote

Antegate wrote:
I saw you added your events as modular events. Probably for the next version. Is it just duplication of modular events?

I'm interested in OnPlayerModuleEquipe* and OnPlayerModuleUnEquipe*.
Can I cancel the dressing / taking off of the equipment, through them?

Reading your question I realized the description of this feature is vague.

So the answer is no. It just just the script that can be canceled, not the actual action that is running the event.

I rewrote the documentation to clarify this.
_________________
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: Mon Sep 04, 2017 13:02    Post subject: Reply with quote

Thanks

maybe you will make such an features? Smile
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Mon Sep 04, 2017 13:58    Post subject: Reply with quote

NWNCX_Patch and NWNX_Patch v1.32

DOWNLOAD

When I said I won't add new features, did you really believed me? Twisted Evil

Lot of code revisited, also archive contains updated documentation.

Fixes to the plugin:
- added missing stoled gold to the thief in softcoded script for pickpocket
- added some error-case log feedback into few custom functions missing it

Revisited fixes/features:
- revisited and reworked AoO softcoded script; it will now fire with a valid target even in case the AoO is caused by ranged weapon; script updated to reflect this
- overriding variable "TumbleAC" will now work even when module switch to disable AC from tumble is enabled
- removed the fix for the feat sight of gruumsh as I realized that it can be fixed without NWNX using cls_savth_ 2da
- the fix for holy/unholy aura damage shield reworked, now any damage shield effect will respects versusalignment/racialtype dynamically
- several functions removed because they weren't functioning properly:
-- GetLastAttackSneak
-- NWNXPatch_GetUsedDeflectArrows
-- NWNXPatch_GetUsedEpicDodge
-- NWNXPatch_SetUsedDeflectArrows
-- NWNXPatch_SetUsedEpicDodge
- 70_mod_init renamed to 70_mod_def_load (to supplement the new feature)

New features, fixes and improvements:
- fixed secondary crash with 255 spellslots happening when character gained/lost 255+ slots on levelup/leveldown
- disabled levelling up in polymorph
- added support for custom ranged weapons
- added module event "duplicates", each module event (except hb) can fire special script 70_mod_def_*, see notes/documentation
- the 70_mod_effects event will run for ability increase/decrease as well - this special case was added to allow builders create feats like Zen Archery or Monk AC
- enabled OnPhysicallyAttacked and OnDamaged event for players. Runs scripts 70_mod_attacked and 70_mod_damaged if they exists (scripts not distributed as there is no point run empty scripts)
- enabled to read GetLastDamager(), GetTotalDamageDealt() and GetDamageDealtByType() functions inside OnPhysicalAttacked event
- also enabled to read all the attack data informations in OnPhysicalAttacked event such as whether was attack hit or miss, critical hit, sneak etc. see function NWNXPatch_GetLastAttackCombatData
- allowed to modify saving throws, values from variables "ReflexSaveModifier", "FortitudeSaveModifier" and "WillSaveModifier" will be added into base (or overriden) value
- enabled to set number of epic dodges per round, use variable "NUM_ED" on creature (value is unlimited)
- enabled to set number of deflect arrows per round, use variable "NUM_DEFLECT" on creature (value is unlimited)
EDIT: - enabled unlimited casting - you can make an entire spell level unlimited by setting the respective spell level value in cls_spgn_*.2da to -1

New custom functions:
NWNXPatch_GetBaseAC
NWNXPatch_SetBaseAC - allows modify natural base AC or base AC from armor and shield
NWNXPatch_GetLastAttackCombatData - reads all attack data such as if the attack was sneak/critical hit/miss etc. use in OnAttacked event


Notes:

0) From efficiency reasons, the hook allowing effect shenanigans changed from SupernaturalEffect to VersusTrapEffect - it is important you update the 70_inc_nwnx library and recompile all your scripts possibly using effect functions from patch plugin!

1) The reason I removed those 5 functions is because they weren't functioning properly. Basically they worked correctly only if there was a single attack in flurry. If player/creature had more attacks, by the time OnDamage script (or whatever script you used) ran, all attacks in flurry already happened so if you wanted to allow Epic Dodge for multiple attacks, it only worked for first attack in flurry. So scraped it. Now you have the possibility to set a number of epic dodges and deflect arrows per round which is better option isn't it?

2) module events duplicates (just a repost from plugin's documentation]

Plugin will also run a “duplicate” event for each module event except heartbeat. Main purpose for these events is to enforce some of the scripted community patch features in every module without need to merge module event scripts. You can reuse this feature to similar goal - to make something to work in every module you (or those who you send the script to) will play. Also, the plugin allows to bypass running original event script, to do it, set local variable “BYPASS_EVENT” int 1 on module object. Clarification: while it is possible to cancel running original event script, it is just the script that is blocked, not the actual action that caused the event. So it is not possible to disallow player to unequip items etc.
OnAcquireItem - 70_mod_def_aqu
OnActivateItem - 70_mod_def_act
OnClientEnter - 70_mod_def_enter
OnClientLeave - 70_mod_def_leave
OnCutsceneAbort - 70_mod_def_abort
OnHeartbeat - not running extra script
OnModuleLoad - 70_mod_def_load
OnPlayerChat - 70_mod_def_chat
OnPlayerDeath - 70_mod_def_death
OnPlayerDying - 70_mod_def_dying
OnPlayerEquipItem - 70_mod_def_equ
OnPlayerLevelUp - 70_mod_def_lvup
OnPlayerRespawn - 70_mod_def_resp
OnPlayerRest - 70_mod_def_rest
OnPlayerUnEquipItem - 70_mod_def_unequ
OnUnAcquireItem - 70_mod_def_unaqu
OnUserDefined - 70_mod_def_user

3) New player events

So at the end I decided to add the OnDamaged event for players. Added also OnAttacked when I was at it.

The reasoning is simple: I was using OnHitSpellCast on skin so far personally, but seriously this is much much more efficient and cleaner solution. Also, while this event was added by Baaleos plugin, my plugin works for both client and server which adds extra benefit. Also, as far as I tested this, my plugin runs the event correctly even for a killing blow.

However, unlike Baaleos plugin there is not a possibility to modify the damage.

Also, with another feature added it is possible to read the damage dealt already in OnAttacked event. The reason why OnDamaged is even still fired is that player can get damage by other sources not just attack.

Note to 2+3: Some of the event scripts are not distributed within community patch or package with this plugin. That’s because there was no need to use them within community patch and it wouldn’t be efficient to provide an empty script doing nothing. If you want to use an event which uses script not provided, simply create new script and save it under specified name.

4) Custom ranged weapons info (just a repost from plugin's documentation)

NWN will now respect custom ranged weapons defined in baseitems.2da. Ranged weapon must have column “RangedWeapon” set to value referring to the baseitem of ammo or new weapon itself.

NWN now recognizes two types of ranged weapons. Weapons that will refer in baseitems.2da into different base item type will be considered ammo based ranged weapons while weapons that will refer to itself will be considered to be throwing weapons.

Ammo based ranged weapons will respect itemproperty unlimited ammo while throwing weapons will respect boomerang itemproperty.

Besides this, every custom ranged weapon will fire on full attack progression (ie. if you make a copy of crossbow, such crossbow will not be limited to 3 attacks per round). Rapid Shot combat mode will work with every custom ranged weapon as well. Additionally, I hardcoded a special quirk of repeating crossbow on baseitem 30 and that’s disabling all attacks in flurry in which new round of ammunition is equipped.

Special note to custom ammunition: It is possible to create a custom bolt with for example max stack size of 5, ammunition that will be equipped into off-hand etc, but creating custom ammunition models remains hardcoded.

5) Ability increase/decrease effect event

From efficiency reasons, the script only fires when the effect is applied/removed on/from player. I was testing this with a code for changing base natural ac to match charisma modifier and it worked perfectly - however, the script fires too early, in that time, the effect was not added/removed yet, so you need to calculate the ability modifier with a small delay like 0.1.

I was thinking about doing the same for EffectDispellMagic* but since that would require blocking the original effect code I decided not to for now. Would probably be better to make up some system to allow run 70_mod_effects for any vanilla effect you want. No idea how to make that dynamic and simple though.

6) I also revisited the plugin settings switches, mostly consolidated several hooks working together under single switch:
these got removed:

DisableResolveSpecialAttackDamageBonusHook=0
DisableResolveSpecialAttackAttackBonus=0
DisableResolveMeleeSpecialAttack=0
DisableUseFeat=0
DisableGetSetSubType=0
DisableResolveAmmunitionHook=0
DisableOnHitCastSpellHook=0

these got added:

DisableModuleEvents=0
DisableEffects=0
DisableSpecialAttacks=0
DisableRangedWeapons=0
DisableEventHandler=0

7) I feel I forgot something... but can't remember and I overwrote my development notes. If I missed some fix/feature I will inform you, hopefully thats all.
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect


Last edited by ShaDoOoW on Tue Sep 05, 2017 3:10; edited 2 times in total
Back to top
View user's profile Send private message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Mon Sep 04, 2017 14:56    Post subject: Reply with quote

O_O
it's big! Smile

Thanks.

Quote:

Note to 2+3: Some of the event scripts are not distributed within community patch or package with this plugin. That’s because there was no need to use them within community patch and it wouldn’t be efficient to provide an empty script doing nothing. If you want to use an event which uses script not provided, simply create new script and save it under specified name.

names of scripts?
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Tue Sep 05, 2017 3:12    Post subject: Reply with quote

Forgot to mention possibility to create unlimited casters. Post updated.
Antegate wrote:
names of scripts?

they are written above and in plugin documentation too
_________________
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: Tue Sep 05, 2017 8:21    Post subject: Reply with quote

Quote:
they are written above and in plugin documentation too

I readed the documentation, thank you for the detailed description Smile
Back to top
View user's profile Send private message
DarkSet



Joined: 06 Jun 2016
Posts: 98

PostPosted: Thu Sep 07, 2017 0:27    Post subject: Reply with quote

Hi
I have a request. Can you make human race abilities to get extra feat and extra skill points usable for custom races? For now it's tied to the line in 2da as far as I know.

And a question. I want to change paladin to make his cast spessl like sorc - choose spells on level up and use any of them instead of choosing slots like now. So is it possible with your custom spellcasting or it's better to make fully custom class copying paladin and make it custom caster as I want?
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Thu Sep 07, 2017 7:03    Post subject: Reply with quote

DarkSet wrote:
And a question. I want to change paladin to make his cast spessl like sorc - choose spells on level up and use any of them instead of choosing slots like now. So is it possible with your custom spellcasting or it's better to make fully custom class copying paladin and make it custom caster as I want?

Readme says you caqn modify vanilla class any way you want that everything is dynamic, so why do you think it cannot be done?
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Valgav



Joined: 28 Aug 2010
Posts: 53

PostPosted: Thu Sep 07, 2017 18:37    Post subject: Reply with quote

I haven't found any better place than this to ask this question.

Would it be possibile to overwrite references to dialog.tlk especially names of spells to same value stored as variable? Maybe using some some nwnx+nwncx magic(pun intended) it could be possible to to create some kind of custom token?

We can create custom lines in 2da for custom spells and custom logic for spells which will use variables from DB/object to decide about dmg, type of it's visual effect, duration, range etc. This with nwnx functions to add/remove spells gives us ability to create custom spellbook but we can't change the name.

P.S. Now I'm realising that there's also no way to switch icons.
Back to top
View user's profile Send private message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Fri Sep 08, 2017 11:48    Post subject: Reply with quote

from 70_mod_effects
Quote:
Can be used to create a new custom effects, first declare some effect, change its
truetype to value above 96, apply the effect and then code what should happen when
effect with this truetype is applied.


ShaDoOoW, can you explain the creation of effects in more detail?
Can I insert my own icon?
NWNXPatch_SetEffectInteger what this function does? In this example, you use it 2 times:
Quote:
Code:
#include "70_inc_nwnx"
void main()
{
object oPC = GetFirstPC();
effect eTemp = EffectStunned();
effect eBonusSpellSlot = NWNXPatch_SetEffectTrueType(eTemp,EFFECT_TRUETYPE_BONUS_SPELL_OF_LEVEL);
eBonusSpellSlot = NWNXPatch_SetEffectInteger(eBonusSpellSlot,0,CLASS_TYPE_WIZARD);
eBonusSpellSlot = NWNXPatch_SetEffectInteger(eBonusSpellSlot,1,1);
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eBonusSpellSlot,oPC);
}


In this example, you do something with the EffectHeal effect, but I still do not understand Smile Why then the base attack?

Quote:
Code:
if(nEffectTrueType == EFFECT_TRUETYPE_NWNXPATCH_MODIFYBAB)
        {
            if(GetObjectType(OBJECT_SELF) != OBJECT_TYPE_CREATURE) return;
            int duration_type = GetEffectDurationType(eEffect);
            float fDuration = NWNXPatch_GetEffectRemainingDuration(eEffect);
            effect eIcon = EffectHeal(29);
            eIcon = NWNXPatch_SetEffectTrueType(eIcon,EFFECT_TRUETYPE_ICON);
            if(fDuration == 0.0)
            {
                eIcon = NWNXPatch_SetEffectSpellId(eIcon,10000); //to identify this effect comes from
            }
            ApplyEffectToObject(duration_type,eIcon,OBJECT_SELF,fDuration);
        }
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Fri Sep 08, 2017 13:03    Post subject: Reply with quote

Valgav wrote:

We can create custom lines in 2da for custom spells and custom logic for spells which will use variables from DB/object to decide about dmg, type of it's visual effect, duration, range etc. This with nwnx functions to add/remove spells gives us ability to create custom spellbook but we can't change the name.
I don't understand what are you trying to achieve?
_________________
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 Sep 08, 2017 13:10    Post subject: Reply with quote

Antegate wrote:

ShaDoOoW, can you explain the creation of effects in more detail?
Can I insert my own icon?
NWNXPatch_SetEffectInteger what this function does? In this example, you use it 2 times:

Effects can have values. Some effects has none (EffectStunned), some has 1 (EffectHeal) and some even more.

If you are changing effect using SetEffectTrueType you need to know how many values the new effect type uses. For example, EffectIcon has one value that refers to effecticons.2da.

Knowing that, there are two way how to define EffectIcon with icon fatigue (Cool.

method A:
declare effect eTemp = EffectStunned();
and add integer 0 (0 - 1st, 1 - 2nd etc.) to value you want ie. eTemp = NWNXPatch_SetEffectInteger(eTemp,0,Cool;
then (or before) change into icon using eTemp = NWNXPatch_SetEffectTrueType(eTemp,EFFECT_TRUETYPE_ICON);

method B:
use vanilla effect that has 1 value such as heal ii. eTemp = EffectHeal(Cool;
then change into icon using eTemp = NWNXPatch_SetEffectTrueType(eTemp,EFFECT_TRUETYPE_ICON);
_________________
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 ... 25, 26, 27 ... 42, 43, 44  Next
Page 26 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