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 
 
Whirlwind?

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development
View previous topic :: View next topic  
Author Message
PlasmaJohn



Joined: 04 Mar 2005
Posts: 70
Location: The Garage

PostPosted: Fri Jan 08, 2010 16:52    Post subject: Whirlwind? Reply with quote

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
View user's profile Send private message
kucik



Joined: 11 Feb 2009
Posts: 19
Location: Czech Republic

PostPosted: Mon Jan 11, 2010 12:00    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Asparius



Joined: 18 Sep 2007
Posts: 52

PostPosted: Mon Jan 11, 2010 13:17    Post subject: Reply with quote

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
View user's profile Send private message
kucik



Joined: 11 Feb 2009
Posts: 19
Location: Czech Republic

PostPosted: Tue Jan 12, 2010 14:01    Post subject: Reply with quote

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 Smile

I think it's better to add SetLocalInt(oPC, "VIR", 0); into OnClientEnter Event.
Back to top
View user's profile Send private message Visit poster's website
PlasmaJohn



Joined: 04 Mar 2005
Posts: 70
Location: The Garage

PostPosted: Tue Jan 12, 2010 17:06    Post subject: Reply with quote

kucik wrote:
edit animation a_ba_casts.mdl (remove impact_node cast)

Shocked 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
View user's profile Send private message
axs



Joined: 11 Feb 2005
Posts: 76

PostPosted: Tue Jan 12, 2010 17:41    Post subject: Reply with quote

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
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Tue Jan 12, 2010 23:56    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger
kucik



Joined: 11 Feb 2009
Posts: 19
Location: Czech Republic

PostPosted: Wed Jan 13, 2010 23:03    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Asparius



Joined: 18 Sep 2007
Posts: 52

PostPosted: Fri Jan 15, 2010 0:31    Post subject: Reply with quote

@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 Razz).

Anywa, I think we should continue this discussion in "scripts and modules" part Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development All times are GMT + 2 Hours
Page 1 of 1

 
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