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 ... 28, 29, 30 ... 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 Sep 15, 2017 1:54    Post subject: Reply with quote

BTW

Was thinking about spellcasting setup.

I think that there might be a problem making prestige classes improving custom type of spellcasters.

Is anyone here trying to make a Warlock?

As I see it, if we had a warlorck and new set of spells that is neither arcane nor divine but invocation, then there is no way to make a prestige class which would improve spell level of invocation base class.

Since there can be unlimited number of custom spell types, invocations, powers, maneuvers, utterances etc. it is not enough to just add a new collumn InvSpellLvlMod to deal with warlocks invocations. The solution needs to handle all possible situations.

Anyone got idea how to do that? Rolling Eyes
_________________
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: Sun Sep 17, 2017 3:43    Post subject: Reply with quote

ShaDoOoW wrote:
imagine effect as a structure data type

its something like this:

struct effect
{
int TrueType;
int Value0;
int Value1;
etc.
}

Before you apply the effect its just a bunch of values. Only after you apply the effect it is determined whether the effect will heal or do something else.

70_mod_effects runs only when effect was applied or removed not before

I have in plan to write a proper tutorial but right now I am making few changes to effects in plugin so it has to wait.

As promised - Advanced effect tutorial.
_________________
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: Sun Sep 17, 2017 13:07    Post subject: Reply with quote

ShaDoOoW, thanks you)
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Mon Sep 18, 2017 17:39    Post subject: Reply with quote

ShaDoOoW wrote:
BTW

Was thinking about spellcasting setup.

I think that there might be a problem making prestige classes improving custom type of spellcasters.

Is anyone here trying to make a Warlock?

As I see it, if we had a warlorck and new set of spells that is neither arcane nor divine but invocation, then there is no way to make a prestige class which would improve spell level of invocation base class.

Since there can be unlimited number of custom spell types, invocations, powers, maneuvers, utterances etc. it is not enough to just add a new collumn InvSpellLvlMod to deal with warlocks invocations. The solution needs to handle all possible situations.

Anyone got idea how to do that? Rolling Eyes

I think I made up way how to enable all this and more.

With new 2da I should be able to enable to make:

- custom class which will improve spellcasting progression of custom type of spells such as invocations
- custom class which will be able to improve spellcasting progression of two base classes with same type of spells (ie. prestige class that increases spell level for both wizard and sorcerer or druid and cleric)
- custom class which will be able to improve spellcasting progression of any spell type (ie. prestige class like Loremaster that will increase level of any one spellcaster be it wizard, cleric or even custom spellcaster like warlock)
- custom class which will be able to improve spellcasting progression of two base classes with any type of spells (ie. prestige class which will improve levels for Wizard and Cleric, Cleric and Warlock or Wizard and Warlock)
- possibility to specify level at which class gets ability to increase spellcasting progression of 2 classes (ie. prestige class which will improve only arcane spells first 9 levels, but which will improve divine spells as well at lvl 10)
- possibility to specify exact spell level increase at each level (ie. prestige class which will increase spell progression at lvl 1 and 10 only, lvl 2,3,6 only etc.)
- also possible to specify exact value of the increase at each level (ie. prestige class which will increase spell progression by 10 at lvl 1)
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect


Last edited by ShaDoOoW on Mon Sep 18, 2017 20:49; edited 1 time in total
Back to top
View user's profile Send private message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Mon Sep 18, 2017 18:50    Post subject: Reply with quote

It is very cool. Smile
Back to top
View user's profile Send private message
Valbor



Joined: 26 Dec 2016
Posts: 145

PostPosted: Wed Sep 20, 2017 15:17    Post subject: Reply with quote

Tried to add the base armor on a helmet or other item in baseitems.2da --> BaseAC then nothing happened, there was also no response to changes in AC from the shields, this is a bug or where do i can change this?
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Wed Sep 20, 2017 18:43    Post subject: Reply with quote

Valbor wrote:
Tried to add the base armor on a helmet or other item in baseitems.2da --> BaseAC then nothing happened, there was also no response to changes in AC from the shields, this is a bug or where do i can change this?
only armor and shield and the parameter of the function is creature not item, check log for errors
_________________
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: Thu Sep 21, 2017 9:25    Post subject: Reply with quote

Quote:
struct CombatAttackData NWNXPatch_GetLastAttackCombatData()
{
struct CombatAttackData data;
data.AttackDeflected = GetLocalInt(OBJECT_SELF,"AttackDeflected");
data.AttackResult = GetLocalInt(OBJECT_SELF,"AttackResult");
data.AttackType = GetLocalInt(OBJECT_SELF,"AttackType");
data.Concealment = GetLocalInt(OBJECT_SELF,"Concealment");
data.CoupDeGrace = GetLocalInt(OBJECT_SELF,"CoupDeGrace");
data.CriticalThreat = GetLocalInt(OBJECT_SELF,"CriticalThreat");
data.DeathAttack = GetLocalInt(OBJECT_SELF,"DeathAttack");
data.KillingBlow = GetLocalInt(OBJECT_SELF,"KillingBlow");
data.MissedBy = GetLocalInt(OBJECT_SELF,"MissedBy");
data.SneakAttack = GetLocalInt(OBJECT_SELF,"SneakAttack");
data.ThreatRoll = GetLocalInt(OBJECT_SELF,"ThreatRoll");
data.ToHitMod = GetLocalInt(OBJECT_SELF,"ToHitMod");
data.ToHitRoll = GetLocalInt(OBJECT_SELF,"ToHitRoll");
return data;
}


How to know what weapon is attacking? (object oItem) From script 70_mod_attacked
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Thu Sep 21, 2017 9:55    Post subject: Reply with quote

Antegate wrote:
How to know what weapon is attacking? (object oItem) From script 70_mod_attacked

This is classic OnPhysicalAttacked event like for NPCs.

use:
Quote:

// Get attacker, and the other parts.
object oAttacker = GetLastAttacker();

// Get the last weapon used to hit us, IE: From this attack.
// * Most useful for disolving enemy weapons/taking them/disarming
// them, but very very evil if you do
object oWeapon = GetLastWeaponUsed(oAttacker);

+ as was mentioned OnDamaged functions will work in this event 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: Thu Sep 21, 2017 10:16    Post subject: Reply with quote

Thanks)
Back to top
View user's profile Send private message
Valbor



Joined: 26 Dec 2016
Posts: 145

PostPosted: Thu Sep 21, 2017 22:05    Post subject: Reply with quote

70_mod_damaged not worked in a single game. It also does not work on the PC copy from function CopyObject(oPC, GetLocation(oPC), OBJECT_INVALID, ""); 70_mod_attacked not tested.
I think that copies of the PC generally there are no scripts, maybe to do so this function automatically will adding default scripts in the absence of them if it possible or maybe there is another solution to this problem?
Back to top
View user's profile Send private message
highv priest



Joined: 01 Mar 2013
Posts: 111

PostPosted: Thu Sep 21, 2017 22:44    Post subject: Reply with quote

Valbor wrote:
70_mod_damaged not worked in a single game. It also does not work on the PC copy from function CopyObject(oPC, GetLocation(oPC), OBJECT_INVALID, ""); 70_mod_attacked not tested.
I think that copies of the PC generally there are no scripts, maybe to do so this function automatically will adding default scripts in the absence of them if it possible or maybe there is another solution to this problem?


NWNX funcs can do this for you though.
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Thu Sep 21, 2017 23:08    Post subject: Reply with quote

Valbor wrote:
70_mod_damaged not worked in a single game.

Works for me. Make sure OBJECT_SELF is PC in this event.

this is my testing script:
Quote:
void main()
{
object oDamager = GetLastDamager();
int nTotal = GetTotalDamageDealt();
int hp = GetCurrentHitPoints();
SendMessageToPC(OBJECT_SELF,"OnDamaged: damager: "+GetName(oDamager)+", damage dealt: "+IntToString(nTotal)+", hp: "+IntToString(hp));
}


Quote:
It also does not work on the PC copy from function CopyObject(oPC, GetLocation(oPC), OBJECT_INVALID, ""); 70_mod_attacked not tested.
I think that copies of the PC generally there are no scripts, maybe to do so this function automatically will adding default scripts in the absence of them if it possible or maybe there is another solution to this problem?
Hmm yes makes sense. Player script events are set to "default". If you make a copy of player, this copy is no longer considered PC and this 70_mod_damaged won't run. Standard creature event will try run default.nss for OnDamaged (and any other event) but the script doesn't exist so nothing happens. Even if the script would exists there is no way to reliably found out which event just ran.

The only solution is to modify PC's copy event script names which so far nwnx_patch doesn't offer. Nwnx_funcs can do it.
_________________
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 Sep 21, 2017 23:09    Post subject: Reply with quote

highv priest wrote:
NWNX funcs can do this for you though.

When using NWNXFuncs_SetEventScript my server is crashing and i don't know the reason Sad


Last edited by Valbor on Thu Sep 21, 2017 23:20; edited 2 times in total
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Thu Sep 21, 2017 23:13    Post subject: Reply with quote

I take back. OnDamaged for PC works only for combat damage but not from damage from spells/scripts.
_________________
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 ... 28, 29, 30 ... 42, 43, 44  Next
Page 29 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