Aller au contenu

Photo

Unable To Use Item After Being Stunned/Snared/Etc? (Tentatively Solved)


  • Veuillez vous connecter pour répondre
14 réponses à ce sujet

#1
MagicalMaster

MagicalMaster
  • Members
  • 2 000 messages

In a module, the player possess an item called the Ring of Valor which can be used to heal themselves.  But I'm encountering a very weird bug.  Below is a video link -- here's a textual description of the problem:

 

1. I use the ring at the very start of the video

2. I run toward the enemy and get frozen (aka Cutscene Paralyze)

3. I attempt to use the ring while frozen, doesn't work (expected)

4. I thaw and try to use the ring...but nothing happens

5. I move back a step and try to use the ring...but nothing happens

6. I move forward a step and try to use the ring...but nothing happens

7. I attack the enemy

8. I use the ring...and it works (in further testing, I don't even need to actually even SWING at the enemy, simply triggering the attack action from 30 yards away with a melee weapon is enough to make the ring work again)

 

Another method to fix it besides attacking an enemy is to unequip and reequip the item.

 

Video is here.  Thoughts?

 

Thinking I might try to do a ClearAllActions on the player once the stun ends to see if that helps but I'm puzzled why this is happening in the first place.



#2
Shadooow

Shadooow
  • Members
  • 4 468 messages

Just another vanilla bug. Saw this happen to NPC that didnt even possessed any such talent, she just tried to attack me melee after she released from chaos shield stone effect.

 

I might be able to fix this in my NWNCX_Patch plugin, but I guess thats something you have no desire anyway.

 

Question, do you actually have to use the item while frozen to get bugged?



#3
MagicalMaster

MagicalMaster
  • Members
  • 2 000 messages

After doing another test, no, you don't even have to try to use the item while "frozen," it seems to bug out regardless.

 

I might be able to fix this in my NWNCX_Patch plugin, but I guess thats something you have no desire anyway.

 

I use NWNCX, I'd have to know more about your Patch plugin thing.

 

Regardless, though, I'd really prefer to make sure I find a solution for this for people who don't have NWNCX in the first place, let alone your plugin.  Going to try clearing actions of the PC as soon as freeze ends and seeing if that helps.



#4
MagicalMaster

MagicalMaster
  • Members
  • 2 000 messages

Edit: This doesn't work all the time, actually, apparently I was lucky.

 

I AssignCommanded the following code onto the cutscene paralyzed PC 0.05 seconds before the paralyze technically should end and it seems to fix the problem.  Still weird, though:

//// Clears the action queue of the subject once they are no longer cutscene paralyzed
void ClearWhenNotParalyzed()
{
    effect eTemp = GetFirstEffect(OBJECT_SELF);
    while (GetIsEffectValid(eTemp))
    {
        if (GetEffectType(eTemp) == EFFECT_TYPE_CUTSCENE_PARALYZE)
        {
            DelayCommand(0.05, ClearWhenNotParalyzed());
            return;
        }

        eTemp = GetNextEffect(OBJECT_SELF);
    }

    ClearAllActions();
}


#5
Shadooow

Shadooow
  • Members
  • 4 468 messages

can you verify this happens with normal paralyse effect?



#6
MagicalMaster

MagicalMaster
  • Members
  • 2 000 messages

Um, let me change the code to test.



#7
MagicalMaster

MagicalMaster
  • Members
  • 2 000 messages

Okay, it DOES happen with the normal Paralyze effect but not as often, it seems.  Best current theory is the main cause is when the action queue gets "clogged" with commands triggered while unable to carry them out and those "invisible" commands cause problems.

 

Absolutely no guarantee that's correct but it seems the most consistent with the tests I'm running of any other idea I've had.



#8
MagicalMaster

MagicalMaster
  • Members
  • 2 000 messages

Further testing shows that fix didn't seem to purely fix it.  Hmm...



#9
WhiZard

WhiZard
  • Members
  • 1 204 messages

Try throwing something trivial onto the action queue and see if that resolves it.

 

For example:

 

ActionSpeakString("Trivial action");



#10
MagicalMaster

MagicalMaster
  • Members
  • 2 000 messages

When I run the below code "Clearing actions" appears but still can't use the ring.

//// Clears the action queue of the subject once they are no longer cutscene paralyzed
void ClearWhenNotParalyzed()
{
    effect eTemp = GetFirstEffect(OBJECT_SELF);
    while (GetIsEffectValid(eTemp))
    {
        if (GetEffectType(eTemp) == EFFECT_TYPE_CUTSCENE_PARALYZE)
        {
            SpeakString("Found stun");
            DelayCommand(0.05, ClearWhenNotParalyzed());
            return;
        }

        eTemp = GetNextEffect(OBJECT_SELF);
    }

    ClearAllActions();
    ActionSpeakString("Clearing actions");
}

When I run the below code "Haven't cleared actions" does NOT appear and still can't use the ring.

//// Clears the action queue of the subject once they are no longer cutscene paralyzed
void ClearWhenNotParalyzed()
{
    effect eTemp = GetFirstEffect(OBJECT_SELF);
    while (GetIsEffectValid(eTemp))
    {
        if (GetEffectType(eTemp) == EFFECT_TYPE_CUTSCENE_PARALYZE)
        {
            SpeakString("Found stun");
            DelayCommand(0.05, ClearWhenNotParalyzed());
            return;
        }

        eTemp = GetNextEffect(OBJECT_SELF);
    }

    ActionSpeakString("Haven't cleared actions");
    ClearAllActions();
}


#11
Shadooow

Shadooow
  • Members
  • 4 468 messages

wait, I thought you said the clear action after paralyse ends fixes this?



#12
MagicalMaster

MagicalMaster
  • Members
  • 2 000 messages

I thought it did but apparently I just got lucky on those tests.

 

Which, of course, is why I kept testing it ;)



#13
MagicalMaster

MagicalMaster
  • Members
  • 2 000 messages

I even tried doing a second ClearAllActions delayed a second after the first...which meant I had the ring queued up, saw the queue get cleared (due to the second call), tried to use the ring again...and nothing.  ClearAllActions does nothing.

 

I have an idea which is to force the PC to attack the enemy and THEN clear actions a split second later -- player shouldn't notice it happened and it may fix the problem.  We'll see.



#14
MagicalMaster

MagicalMaster
  • Members
  • 2 000 messages

I have an idea which is to force the PC to attack the enemy and THEN clear actions a split second later -- player shouldn't notice it happened and it may fix the problem.  We'll see.

 

This seems to work perfectly, though it's still a tentative conclusion.



#15
WhiZard

WhiZard
  • Members
  • 1 204 messages

Maybe the player can be forced to attack himself. I've done that in game with knockdown to get a good initiative roll before going into battle.

 

EDIT: You may also try ClearAllActions(TRUE);