Author Topic: Bug found in EffectDisappearAppear  (Read 464 times)

Legacy_AndarianTD

  • Hero Member
  • *****
  • Posts: 725
  • Karma: +0/-0
Bug found in EffectDisappearAppear
« on: December 16, 2012, 01:25:48 pm »


               I've finally tracked down the source of an odd transient bug that's been plaguing Sanctum 2 since release, and which started to show up in my remake of Sanctum 1. I use EffectDisappearAppear to generate various jumping and flying animations, and it seems that this has an unfortunate side-effect when applied to in-party henchmen. Once it has been applied to them, then instead of following you through area transitions as they should, they are instead teleported back to the origin location of the effect (the one from which they "disappeared." This is completely reproducible until you save and re-load the game, but it will vanish and things will be back to normal once you do.

I've noticed several other transient VFX effect bugs that follow a similar pattern (showing up when they're not supposed to, but vanishing on save and re-load), so I suppose it's possible that this bug is related to them. In any event I wanted to mention it and see if others have encountered it as well, and if so if anyone has found a way to clear the condition in-game through scripting without having to save and re-load.
               
               

               


                     Modifié par AndarianTD, 26 juin 2013 - 03:19 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Bug found in EffectDisappearAppear
« Reply #1 on: December 16, 2012, 01:32:52 pm »


               Interesting.

I wonder if Henchman use a stored location on transitions which happens to be the same as the location stored with that effect.
               
               

               


                     Modifié par henesua, 16 décembre 2012 - 01:33 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Bug found in EffectDisappearAppear
« Reply #2 on: December 16, 2012, 01:45:45 pm »


               I also found this function to occassionaly result in client crash. Probably linked to custom content PC parts (CEP1).
               
               

               


                     Modifié par ShaDoOoW, 16 décembre 2012 - 01:46 .
                     
                  


            

Legacy_AndarianTD

  • Hero Member
  • *****
  • Posts: 725
  • Karma: +0/-0
Bug found in EffectDisappearAppear
« Reply #3 on: December 16, 2012, 02:44:30 pm »


               

henesua wrote...

I wonder if Henchman use a stored location on transitions which happens to be the same as the location stored with that effect.


That was my guess as well, although it would involve a lot of hunting through NWN's area transition scripts to find it (assuming it's not in the engine and inaccessible). I did some preliminary skimming through them and didn't find anything obvious.

ShaDoOoW wrote...

I also found this function to occassionaly result in client crash. Probably linked to custom content PC parts (CEP1).


I have noticed that it will crash the game if you hit the "save" key while the animation is in progress. It also doesn't know how to handle characters holding all of the game's known weapons. If you try applying it to someone holding a double axe, for example, it doesn't look right.

It's strange what an immense relief this is to me to finally track down, and I have one of my Sanctum 1v4 beta testers to thank for finally noticing the connection. As I said, it's been plaguing Sanctum 2 since I wrote it five years ago. I ended up kludge-scripting the on-enter events for nearly every area in the module to re-rally the player's party as way to get around it.

The way I'm dealing with it now is to temporarily make the henchman invisible and jump him out of the scene, and then apply the effect to a temporary copy. It works OK (though it's hard not to notice the character's "create/delete blip"). So far nothing I've tried to clear the condition through scripting seems to work; saving and reloading the game seems to be the only thing that does the trick.
               
               

               


                     Modifié par AndarianTD, 16 décembre 2012 - 02:46 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Bug found in EffectDisappearAppear
« Reply #4 on: December 16, 2012, 03:19:12 pm »


               I do not have a lot of time for testing right now.   But the first step would be to trace it down to either the engine or scripting.   

The only way I can see to do that would be to try to recreate the Bug in a clean module.  

Make sure that there is nothing in any of the scripts that could be causing the problem.  That list would include:

AreaEnter/Exit
PC HB ( If you are using one) 
All Of the Henchman Event Scripts. ( you may have to edit.  Statescripts.2da to get rid of them) 


Then See if you can recreate the problem.  if you can it, chances are that it is an engine bug.   

  
               
               

               
            

Legacy_AndarianTD

  • Hero Member
  • *****
  • Posts: 725
  • Karma: +0/-0
Bug found in EffectDisappearAppear
« Reply #5 on: December 16, 2012, 04:41:01 pm »


               

Lightfoot8 wrote...

I do not have a lot of time for testing right now.   But the first step would be to trace it down to either the engine or scripting.   

The only way I can see to do that would be to try to recreate the Bug in a clean module...

Then See if you can recreate the problem.  if you can it, chances are that it is an engine bug.


Sorry if I didn't make myself clearer. I wouldn't have posted this if I weren't already confident that the problem was in the base game, and not in my scripting. I've re-created it in a new module with two areas, a door transition between them, an OC henchman from the palette, a pregen PC that comes with the game, no haks or overrides, and no custom content of any kind whatever. It fails in exactly the manner I described above (including being cleared on loading a saved game). Here's the jump script for the record (on a placeable):

void main()
{
    object oPC = GetLastUsedBy();
    object oHench = GetHenchman(oPC);
    object oLandWP = GetWaypointByTag("WP_Landing");
    location lLand = GetLocation(oLandWP);
    effect eFly = EffectDisappearAppear(lLand);
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eFly,oPC,3.0);
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eFly,oHench,3.0);
}
               
               

               


                     Modifié par AndarianTD, 16 décembre 2012 - 04:46 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Bug found in EffectDisappearAppear
« Reply #6 on: December 16, 2012, 04:51:16 pm »


               Andarian - lightfoot is talking about determining if it is in the scripting that comes with the game not your scripting. His method - to strip out the AI scripts - would help in determining this. Although i wonder if the henchmen would transition without scripting.
               
               

               
            

Legacy_AndarianTD

  • Hero Member
  • *****
  • Posts: 725
  • Karma: +0/-0
Bug found in EffectDisappearAppear
« Reply #7 on: December 16, 2012, 05:22:32 pm »


               

henesua wrote...

Andarian - lightfoot is talking about determining if it is in the scripting that comes with the game not your scripting. His method - to strip out the AI scripts - would help in determining this. Although i wonder if the henchmen would transition without scripting.


That's why I didn't try exploring it further at this point. (That and lack of time -- I am trying to get a module release out this month!) I could try systematically removing scripts (starting with the henchman heartbeat) to see if and where it gets restored, but I thought it would be a better idea to first see if anyone else was aware of it and had a workaround.

One additional data point: on some of my tests I have noticed the errant henchman in the process of fading out immediately on arrival in the new area, so it looks like they're being whisked away at the end of the area transition as opposed to not making the transition at all.

Here's a copy of the test module I referenced above if anyone wants to check it out or play with it further.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Bug found in EffectDisappearAppear
« Reply #8 on: December 16, 2012, 05:25:50 pm »


               oh... i wasn't suggesting you do all that. i was just clarifying lightfoot's post is all.

i think we are all curious and one of us will eventually investigate. '<img'>

thanks for the test mod.
               
               

               
            

Legacy_the.gray.fox

  • Full Member
  • ***
  • Posts: 214
  • Karma: +0/-0
Bug found in EffectDisappearAppear
« Reply #9 on: December 17, 2012, 07:04:01 pm »


               EffectDisappearAppear() caused trouble to me in the past. I think it was in a script from Jassper.
I solved by using EffectDisappear() followed by EffectAppear(), with a bit of trivial code to handle the timing. It worked for me. Maybe you should try.


-fox
               
               

               
            

Legacy_SHOVA

  • Hero Member
  • *****
  • Posts: 893
  • Karma: +0/-0
Bug found in EffectDisappearAppear
« Reply #10 on: December 17, 2012, 07:40:15 pm »


               ProjectQ has both jumping, and flying, Flying is a penotype, jumping from custom character animations.
I believe that CEP2.4a also has the jumping animation, but I have no idea where it could be found, or if it is easy to access it.

The effect Disappear, and the Appear have always been problematic, and always looked silly, at least to me.
               
               

               
            

Legacy_AndarianTD

  • Hero Member
  • *****
  • Posts: 725
  • Karma: +0/-0
Bug found in EffectDisappearAppear
« Reply #11 on: December 18, 2012, 03:17:34 am »


               

the.gray.fox wrote...

EffectDisappearAppear() caused trouble to me in the past. I think it was in a script from Jassper.
I solved by using EffectDisappear() followed by EffectAppear(), with a bit of trivial code to handle the timing. It worked for me. Maybe you should try.


According to the documentation, EffectDisappear() destroys the subject of the effect. That's a non-starter because the effect is being applied to the player and companions (henchmen). I would have to temporarily create copies of them to apply it to, while jumping the originals out of the scene and/or making them invisible. In that case, though, there would be no point to not just applying EffectDisappearAppear() to the copies in the first place -- which is, in fact, how I actually ended up solving the problem.

SHOVA wrote...

ProjectQ has both jumping, and flying, Flying is a penotype, jumping from custom character animations. I believe that CEP2.4a also has the jumping animation, but I have no idea where it could be found, or if it is easy to access it.


It's in the port of Vaei's animations, in custom slot 8. Thanks for reminding me about that. I'll take a look at it and see if it's something I might be able to make use of, but for the purpose here I probably need more than just an animation. EffectDisappearAppear() moves the subject to a new location, and I'm using it here for a scene that involves leaping over a chasm that's not crossable on foot. I use it in chapter 2 for various similar scenes, and for the "takeoff" animations for the flying segments. (I use the flying pheno extensively, and even had a small hand in helping Project Q implement their version and set the phenotype number.)

The effect Disappear, and the Appear have always been problematic, and always looked silly, at least to me.

They certainly have issues, although it depends a little on what you're trying to do with them. The way I worked out for using them for flying takeoff and landing scenes actually ended up looking pretty good.
               
               

               


                     Modifié par AndarianTD, 18 décembre 2012 - 03:41 .