View previous topic :: View next topic |
Author |
Message |
PlasmaJohn
Joined: 04 Mar 2005 Posts: 70 Location: The Garage
|
Posted: Fri Jan 08, 2010 16:52 Post subject: Whirlwind? |
|
|
FunkySwerve wrote: | It's not the intended behavior that's the issue, it's the actual behavior. Whirlwind can lock up your action queue, causing you to stand there unable to attack, and requires a relog to fix. This is apparently caused by using whirlwind more than once in a row. While that doesn't sound that bad, it's bad enough that none of our players will use it. |
Quote: | There's nothing mod-specific about it, it's an engine issue. I'm not particularly fretted about it, either - acaos has had it on his fixlist for some time now. |
Necro'd from the Wishlist for better visibility. Any chance of this getting some attention?
Thanks. |
|
Back to top |
|
|
kucik
Joined: 11 Feb 2009 Posts: 19 Location: Czech Republic
|
Posted: Mon Jan 11, 2010 12:00 Post subject: |
|
|
There is simple fix I aplied in our module.
Sylmael is author of this bugfix.
Fix
feats.2da lines 867 and 868 set ReqAction to 0
edit script x2_s2_whirl.nss
edit animation a_ba_casts.mdl (remove impact_node cast)
edit script x2_s2_whirl
Code: | // After 10s cooldown is feat useable again
void WhirlwindCooldown(object oPC)
{
SetLocalInt(oPC, "VIR", 0);
SendMessageToPC(oPC, "Whirlwind active!");
}
void main()
{
// changes begin
object oPC = OBJECT_SELF;
// Set variable to know whirlwind is running
if (GetLocalInt(oPC, "VIR") == 1)
{
SendMessageToPC(oPC, "Whirlwind cooldown...");
return;
}
SetLocalInt(oPC, "VIR", 1);
DelayCommand(10.0f, WhirlwindCooldown(oPC));
ClearAllActions(TRUE);
// end changes
// Bioware script
int bImproved = (GetSpellId() == 645);// improved whirlwind
// * GZ, Sept 09, 2003 - Added dust cloud to improved whirlwind
if (bImproved)
{
effect eVis = EffectVisualEffect(460);
DelayCommand(1.0f,ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,OBJECT_SELF));
}
DoWhirlwindAttack(TRUE,bImproved);
} |
Of course this script is not optimal, because it can bugs if player logout in attack. I'm using my own time library so its better to use timestamps instead of DelayCommand. It depeds how you use it it in module.
I can paste here a_ba_casts.mdl file, if anyone needs. |
|
Back to top |
|
|
Asparius
Joined: 18 Sep 2007 Posts: 52
|
Posted: Mon Jan 11, 2010 13:17 Post subject: |
|
|
In this solution, I would really suggest -like kucik said - storing time of the last attack in local variable, then, after use, check if 10 seconds passed.
Or at least change those lines:
Code: |
if (GetLocalInt(oPC, "VIR") == 1)
{
SendMessageToPC(oPC, "Whirlwind cooldown...");
return;
}
|
to:
Code: |
if (GetLocalInt(oPC, "VIR") == 1)
{
SendMessageToPC(oPC, "Whirlwind cooldown...");
DelayCommand(10.0f, WhirlwindCooldown(oPC));
return;
}
|
so if player logs out before "VIR" is deleted, he won't have whirlwind blocked until restart. |
|
Back to top |
|
|
kucik
Joined: 11 Feb 2009 Posts: 19 Location: Czech Republic
|
Posted: Tue Jan 12, 2010 14:01 Post subject: |
|
|
Asparius wrote: |
Or at least change those lines:
to:
Code: |
if (GetLocalInt(oPC, "VIR") == 1)
{
SendMessageToPC(oPC, "Whirlwind cooldown...");
DelayCommand(10.0f, WhirlwindCooldown(oPC));
return;
}
|
so if player logs out before "VIR" is deleted, he won't have whirlwind blocked until restart. |
I don't think this is good idea. Example: Player use W attack and try it again every 3 sec interval. Imagine two or more paralel running scripts:
Code: | W1:[used W attack]--->-->[10 sec wait]----->----->[enable attack][W attack]------------------->[10 sec wait]----->-------->
W2:-----------------------[W attack(blocked)]--------->-------->[10 sec wait]----->----->[ !!!enable attack!!! ] ^^ [use W attack]---> |
So you run first WWattack and wait 10sec before you can use it again. In meantime you try to use WW-attack again. You do not make these WW, but you runs DelayCommands, which removes "VIR" variable.
So in second 10sec interval you can use WW as many times as you've tried it in prev 10sec interval.
A hope a didn't wrote it too complicated
I think it's better to add SetLocalInt(oPC, "VIR", 0); into OnClientEnter Event. |
|
Back to top |
|
|
PlasmaJohn
Joined: 04 Mar 2005 Posts: 70 Location: The Garage
|
Posted: Tue Jan 12, 2010 17:06 Post subject: |
|
|
kucik wrote: | edit animation a_ba_casts.mdl (remove impact_node cast) |
doesn't this break other things? I've not dug into it but it sounds rather important for things like OnHit effects.
Scripted solutions are all well and good, but there's a bug in the server and I'd much prefer that patched if at all possible. |
|
Back to top |
|
|
axs
Joined: 11 Feb 2005 Posts: 76
|
Posted: Tue Jan 12, 2010 17:41 Post subject: |
|
|
kucik wrote: | edit animation a_ba_casts.mdl (remove impact_node cast) | What purpose of this? I've similar workaround without this, with no glitches. |
|
Back to top |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
Posted: Tue Jan 12, 2010 23:56 Post subject: |
|
|
PlasmaJohn wrote: | Scripted solutions are all well and good, but there's a bug in the server and I'd much prefer that patched if at all possible. | Whirlwind is semi-hardcoded, and the code is very tangled; if there are working scripted solutions, I don't want to spend hours debugging the code just to fix it in the engine. _________________ In Soviet Russia, NWN plays you! |
|
Back to top |
|
|
kucik
Joined: 11 Feb 2009 Posts: 19 Location: Czech Republic
|
Posted: Wed Jan 13, 2010 23:03 Post subject: |
|
|
axs wrote: | kucik wrote: | edit animation a_ba_casts.mdl (remove impact_node cast) | What purpose of this? I've similar workaround without this, with no glitches. |
I don't know, why is this. But it works and it didn't broke anything else in our server. We have some animation changes, but it's different chapter and I'm not friend with 3DS Max.
Try it without animation changes and if there will be some problems, I'll send animation. |
|
Back to top |
|
|
Asparius
Joined: 18 Sep 2007 Posts: 52
|
Posted: Fri Jan 15, 2010 0:31 Post subject: |
|
|
@kucik - thats why I said that checking the timer instead of DelayCommand is better.
I have encountered few cases where action delayed by DelayCommand didnt fire at all , thats why OnClientEnter deletion method can be insufficient. Though you do have a point (but, well, if someone trues to exploit it and get himself blocked ... iI do not feel bad for it ).
Anywa, I think we should continue this discussion in "scripts and modules" part |
|
Back to top |
|
|
|