View previous topic :: View next topic |
Author |
Message |
Valbor
Joined: 26 Dec 2016 Posts: 145
|
Posted: Sat Mar 04, 2017 7:58 Post subject: |
|
|
Hi ShaDoOoW. At your project is possible the script whose execution will before each attack, and with support functions GetLastAttackMode() and GetLastAttackType()? Also function to detect if this attack is Sneak Attack if it possible? |
|
Back to top |
|
|
DarkSet
Joined: 06 Jun 2016 Posts: 98
|
Posted: Mon Mar 06, 2017 2:40 Post subject: |
|
|
+1 for detecting if attack is a sneak or death attack. At least at OnHit items tag based scripts. But having separate on attack script is even better, if it will fire even if no physical damage delt, as for OnHit. |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Mon Mar 06, 2017 6:05 Post subject: |
|
|
its doable but it might negatively impact game efficiency, i don't think it is good idea
i mean sure, it is no problem to code something inside the plugin which would change for example if attack is sneak or not, but calling a nwscript script that performs this task and then read some local variables to do it is not very good idea for something that occurs so often _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
DarkSet
Joined: 06 Jun 2016 Posts: 98
|
Posted: Mon Mar 06, 2017 8:55 Post subject: |
|
|
As for me - don't want to change it, just detect if attack is sneak or death. Maybe for efficiency create a script, that fire only in sneak/death attack? For not reading local vars in nwscript to detect it but deal with a fact that atack is a sneak. Like on disarm script, for example.
Also - is there any way to make tag based OnHit work when no physical damage is dealt? I treat it as a bug of nwn, so if it can be fixed globally - it's great. |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Fri Mar 10, 2017 12:01 Post subject: |
|
|
DarkSet wrote: | As for me - don't want to change it, just detect if attack is sneak or death. Maybe for efficiency create a script, that fire only in sneak/death attack? For not reading local vars in nwscript to detect it but deal with a fact that atack is a sneak. Like on disarm script, for example.
Also - is there any way to make tag based OnHit work when no physical damage is dealt? I treat it as a bug of nwn, so if it can be fixed globally - it's great. |
I was able to create a function GetLastAttackSneak() but it will work only in OnHitCastSpell scripts, lmk _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
Valbor
Joined: 26 Dec 2016 Posts: 145
|
Posted: Fri Mar 10, 2017 16:49 Post subject: |
|
|
ShaDoOoW wrote: | I was able to create a function GetLastAttackSneak()... |
It suits me, and when will be update? |
|
Back to top |
|
|
highv priest
Joined: 01 Mar 2013 Posts: 111
|
Posted: Tue Mar 21, 2017 4:14 Post subject: |
|
|
Here is a real challenge for you. Put a hook in for whenever an AI executes a pathfind call(doesn't need to be able to stop it, just a signal to know it's happening and ideally have it trigger for the AI actually doing it). I've been trying to figure out how to do this for forever, because one of nwns biggest problems is AI can get stuck and when they do they grab the server by the legs and drag it into the deepest pit of hell with lag(only takes like 20-30 ai to get stuck to start causing some lag).
I know it must be possible because nwnx_profiler knows when a pathfind call is executed, but I can't figure out how they did it.
While I understand realism and such, if an AI gets stuck in a damn wall I'd rather them either kill themselves or use a teleport or something more productive then just spamming the same broken pathing.
EDIT = Also be careful using "GetLastAttackTarget" Shadoow, it works fine for AI, but on players it's... Lacking. I think the actual data read for it doesn't update instantly, because I was using that function combined with on hit cast to trigger a save on death attacks and players were basically triggering the save all the time if they just broke lock and attacked. I ended up recoding my own homebrew GetLastAttackTarget using the OnAttack event from Terra with a local object instead. |
|
Back to top |
|
|
Valbor
Joined: 26 Dec 2016 Posts: 145
|
Posted: Fri Mar 24, 2017 7:20 Post subject: |
|
|
Someone knows why on immortal creature does not effecting such effects as paralysis or daze? |
|
Back to top |
|
|
Valbor
Joined: 26 Dec 2016 Posts: 145
|
Posted: Sat Mar 25, 2017 7:28 Post subject: |
|
|
Hi, another question for you ShaDoOoW, would you be able to cleave (great cleave) implement after the Devastating Critical? since he is required for taking Devast feat. |
|
Back to top |
|
|
Valbor
Joined: 26 Dec 2016 Posts: 145
|
Posted: Sat Mar 25, 2017 17:12 Post subject: |
|
|
Is it possible somehow to apply the effects of Taunt or Wounding at creature from a script? |
|
Back to top |
|
|
Valbor
Joined: 26 Dec 2016 Posts: 145
|
Posted: Wed Mar 29, 2017 21:20 Post subject: |
|
|
Bug: When making a devastating critical hit with melee weapons, message is shown that it was normal critical hit (not devastating!), but with ranged weapons the message everything is fine. |
|
Back to top |
|
|
Valbor
Joined: 26 Dec 2016 Posts: 145
|
Posted: Sat Apr 08, 2017 5:02 Post subject: |
|
|
In 70_s3_healkit.nss maybe in there is missing part of the code:
if(nResult >= nDC && GetIsEffectValid(eEffect))
{
Code: | if(GetEffectType(eEffect) == EFFECT_TYPE_POISON || (GetEffectType(eEffect) == EFFECT_TYPE_VISUALEFFECT && GetTag(GetEffectCreator(eEffect)) == "70_EC_POISON"))
{
DeleteLocalInt(oTarget, "POISON_ID");
}
else if(GetEffectType(eEffect) == EFFECT_TYPE_DISEASE)
{
DeleteLocalInt(oTarget, "DISEASE_ID");
} |
RemoveEffect(oTarget, eEffect);
}
this is the conclusion i made after the creature was several different diseases with one DC on all diseases. |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Wed Apr 19, 2017 1:56 Post subject: |
|
|
highv priest wrote: | Here is a real challenge for you. Put a hook in for whenever an AI executes a pathfind call(doesn't need to be able to stop it, just a signal to know it's happening and ideally have it trigger for the AI actually doing it). I've been trying to figure out how to do this for forever, because one of nwns biggest problems is AI can get stuck and when they do they grab the server by the legs and drag it into the deepest pit of hell with lag(only takes like 20-30 ai to get stuck to start causing some lag).
I know it must be possible because nwnx_profiler knows when a pathfind call is executed, but I can't figure out how they did it.
While I understand realism and such, if an AI gets stuck in a damn wall I'd rather them either kill themselves or use a teleport or something more productive then just spamming the same broken pathing.
EDIT = Also be careful using "GetLastAttackTarget" Shadoow, it works fine for AI, but on players it's... Lacking. I think the actual data read for it doesn't update instantly, because I was using that function combined with on hit cast to trigger a save on death attacks and players were basically triggering the save all the time if they just broke lock and attacked. I ended up recoding my own homebrew GetLastAttackTarget using the OnAttack event from Terra with a local object instead. |
Found this in the profiler source: looks to be how the path finding was hooked
CNWTileSurfaceMesh::IntraTileDFS(CNWTile *,CNWArea *,CPathfindInformation *,int,float,int,float,float,float,float,float,int) |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Sun May 28, 2017 5:06 Post subject: |
|
|
Hey guys sorry I was away from NWN for some time.
Valbor wrote: | Bug: When making a devastating critical hit with melee weapons, message is shown that it was normal critical hit (not devastating!), but with ranged weapons the message everything is fine. |
I know, I will try to fix this, this is one of the first patches I made and I was glad it was even working without crashes. My previous attempts to restore vanilla floating message feedback crashed. Maybe I can do better now. _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Sun May 28, 2017 5:08 Post subject: |
|
|
Valbor wrote: | In 70_s3_healkit.nss maybe in there is missing part of the code:
if(nResult >= nDC && GetIsEffectValid(eEffect))
{
if(GetEffectType(eEffect) == EFFECT_TYPE_POISON || (GetEffectType(eEffect) == EFFECT_TYPE_VISUALEFFECT && GetTag(GetEffectCreator(eEffect)) == "70_EC_POISON"))
{
DeleteLocalInt(oTarget, "POISON_ID");
}
else if(GetEffectType(eEffect) == EFFECT_TYPE_DISEASE)
{
DeleteLocalInt(oTarget, "DISEASE_ID");
}
RemoveEffect(oTarget, eEffect);
}
this is the conclusion i made after the creature was several different diseases with one DC on all diseases. |
Hmm. Its been long but it seems to be correct. Thanks will add into "official" code. _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
|