Author Topic: RE: Help with Statue Script  (Read 705 times)

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
RE: Help with Statue Script
« on: October 31, 2015, 04:50:19 pm »


               

I need a simple OnSpawn script that will freeze a creature in a certain animation pose and turn them into a statue. I need about a dozen of these and don't feel like making placeables since it might be possible to "revive" the statues under certain circumstances. I've tried the various statue scripts floating around, but can't seem to get anything other than the infamous "da Vinci" pose. Anyone got any ideas?



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
RE: Help with Statue Script
« Reply #1 on: October 31, 2015, 05:42:58 pm »


               

I fought with that a bit trying to make my tailor models. In that case I wanted to keep it in the da vinci pose.  But then I couldn't keep it there when I resized it for the particular PC... anyway, have you tried delaying the freeze a few seconds?  Freezing in the spawn path directly tends to stop it from even running the base standing animation.   I don't know if there is a way to freeze in any other animation. 



               
               

               
            

Legacy_leo_x

  • Sr. Member
  • ****
  • Posts: 403
  • Karma: +0/-0
RE: Help with Statue Script
« Reply #2 on: October 31, 2015, 05:56:41 pm »


               

I tried something like this in the past and a DelayCommand works okay but there is a rather large caveat/problem as described in this thread: http://forum.bioware...ures/?p=7484402



               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
RE: Help with Statue Script
« Reply #3 on: October 31, 2015, 06:55:19 pm »


               

Thanks for the link, Leo. After reading through that thread again, it looks like my "garden" of statues will be better implemented as placeables rather than petrified creatures - allowing me to avoid the glitches listed in the various posts throughout that thread.



               
               

               
            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
RE: Help with Statue Script
« Reply #4 on: October 31, 2015, 09:16:21 pm »


               

Sadly, they reanimate once out of sight - glitches as you mention - so yes, please make a petrified version of every creature and stock NPC as a placeable statue. That will help everyone.


FP!



               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
RE: Help with Statue Script
« Reply #5 on: October 31, 2015, 09:53:44 pm »


               


Sadly, they reanimate once out of sight - glitches as you mention - so yes, please make a petrified version of every creature and stock NPC as a placeable statue. That will help everyone.


FP!




 


LOL


               
               

               
            

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
RE: Help with Statue Script
« Reply #6 on: November 02, 2015, 01:05:15 am »


               


Sadly, they reanimate once out of sight - glitches as you mention - so yes, please make a petrified version of every creature and stock NPC as a placeable statue. That will help everyone.


FP!




 


Don't forget CEP an Q as well!  And I want multiple poses.  And a pony.


 


Okay, all joking aside--you can leave out the pony.  '<img'>


               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
RE: Help with Statue Script
« Reply #7 on: November 02, 2015, 01:19:13 am »


               

I opted for a different solution - "sleeping" villagers vs. petrified ones. Just as cliche, but much easier to implement, not to mention far more stable.



               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
RE: Help with Statue Script
« Reply #8 on: November 02, 2015, 01:38:51 am »


               

NPC statues are albeit a bit wonky at times, but still decent enough to use. Here's a link to the ones I dropped on the Vault awhile back.


http://neverwinterva...c-statues-redux



               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
RE: Help with Statue Script
« Reply #9 on: November 02, 2015, 11:41:48 am »


               

Hey thanks, I'll have to give those a try. Somehow I missed that little gem while searching the Vault.



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
RE: Help with Statue Script
« Reply #10 on: November 02, 2015, 02:26:02 pm »


               

When we are talking about petrified - are we referring to the effectPetrified?


 


Why not try EffectCutsceneFreeze - 


And then use EffectVisualEffect to apply stoned skin.


 


You may still get the issue of them doing the da-vinci pose on area entry etc


But the freeze effect shouldnt be removed in any case.


               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
RE: Help with Statue Script
« Reply #11 on: November 02, 2015, 05:58:11 pm »


               

Starting to see that for the amount of time I've wasted trying to get/make scripts that actually work without relying on the PC being in perception range, I could have just converted the models to placeables and been done with it.  ':blink:'



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
RE: Help with Statue Script
« Reply #12 on: November 02, 2015, 06:12:21 pm »


               

There are rat holes...  been down a few myself.



               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
RE: Help with Statue Script
« Reply #13 on: November 02, 2015, 11:34:07 pm »


               

Had to compromise and settle for scripted statues that animate for just a moment then freeze. I took Kalbaern's scripts and modified to the OnSpawn event to work as an OnPerception event. The statues seem to hold the chosen pose, even when the PC moves out of perception range or leaves the area - so its slightly more reliable (at least in my experience).


 


I tried making placeable statues, but the models I want to use for the villagers all have skins, and, although the statues loaded fine in the toolset, they crashed the game. My guess is that the game doesn't like placeables with skinmesh.


 


I'll give the OnPerception script below - the OnConversation script is unmodified.


 



   Spoiler
   


void main()

{

    object oPercep = GetLastPerceived();

 

    if (GetIsObjectValid(oPercep))

    {

        int nAnimation = GetLocalInt(OBJECT_SELF, "ANIMATION");

        switch(nAnimation)

        {

            case 0:

            case 1:  nAnimation = ANIMATION_LOOPING_CONJURE1; break;

            case 2:  nAnimation = ANIMATION_LOOPING_CONJURE2; break;

            case 3:  nAnimation = ANIMATION_LOOPING_DEAD_BACK; break;

            case 4:  nAnimation = ANIMATION_LOOPING_GET_LOW; break;

            case 5:  nAnimation = ANIMATION_LOOPING_GET_MID; break;

            case 6:  nAnimation = ANIMATION_LOOPING_LOOK_FAR; break;

            case 7:  nAnimation = ANIMATION_LOOPING_MEDITATE; break;

            case 8:  nAnimation = ANIMATION_LOOPING_PAUSE; break;

            case 9:  nAnimation = ANIMATION_LOOPING_TALK_PLEADING; break;

            case 10: nAnimation = ANIMATION_LOOPING_WORSHIP; break;

       }

 

       //float fDirection = IntToFloat(Random(361));

       //SetFacing(fDirection);

 

       PlayAnimation(nAnimation, 1.0, 9999.0);

       effect eHold = EffectVisualEffect(VFX_DUR_FREEZE_ANIMATION);

       DelayCommand(1.0,ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHold, OBJECT_SELF));

       //ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHold, OBJECT_SELF);

       effect ePetrify = EffectVisualEffect(VFX_DUR_PETRIFY);

       DelayCommand(1.0,ApplyEffectToObject(DURATION_TYPE_PERMANENT, ePetrify, OBJECT_SELF));

       //ApplyEffectToObject(DURATION_TYPE_PERMANENT, ePetrify, OBJECT_SELF);

       SetLocalInt(OBJECT_SELF, "X1_L_IMMUNE_TO_DISPEL", 10);

    }

}



 


I opted for using a local variable on the creature to store the animation rather than using a random animation. If no variable is stored, then the script will default to ANIMATION_LOOPING_CONJURE1 animation.


 


EDIT - EPIC FAIL...worked great with one NPC statue, but the moment I added more statues, the entire routine went all wonky. So its back to OnSpawn, which works adequately as long as the PC doesn't move right in once the statues OnPerception event fires and they animate.



               
               

               
            
            
            


            

            

                   
                   
                

         



                  
            
            
               
            
            
         
            

                   
  • Retour en haut

  •                    

                   
                   
                   
                   
                

               
         
      
   

      
      
      

      
      

         
      
   






   
   

      
      Retourner dans Builders - Scripting
      
   
   






   

   

      

   

       
          

  •    

          
                


  •          
       

          
                

  •          
       

          

  •    

          

  •    

          

  •    

          

  •    

          

  •    

          

  •    

          

  •    
       

   

   

   








   
   
   
   


   
   
   
   
   
   
   
   
   
   
   

               
               

                                               
  1. The BioWare Forum

  2.                            
                           
                               
  3. BioWare

  4.                            
                           

                               
  5. Legacy Games

  6.                            
                           

                               
  7. Neverwinter Nights

  8.                            
                           

                               
  9. Builders - Scripting

  10.                            
                           

                   

           

           
           
''

           
               

           
           


           
           

               
               

                       

  •                         'Flux
                       

  •                    
                           
                               

  •                                 Changer le thème
                                   
                               

  •                        
                       
                           

  •                             Français
                               
                           

  •                    
                       
                       
  • Aller en haut

  •                

           





       

           


               

               

                   
                   

                           
  • Website

  •                        
  • Game Patches

  •                        
  • Official DLC

  •                    

               

               

                   
                   

                           
  • Website

  •                        
  • Game Patches

  •                        
  • Official DLC

  •                    

               

               

                   
                   

                           
  • Website

  •                        
  • Game Patches

  •                        
  • Official DLC

  •                    

               

               

                   
                   

                           
  • Website

  •                        
  • Game Patches

  •                        
  • Official DLC

  •                        
  • Toolset

  •                    

               

               

                   
                   

                           
  • Projects

  •                        
  • Groups

  •                        
  • Albums

  •                        
  • Blogs

  •                        
  • Polls

  •                    

               


               

                    EA
                   
© 2016 EA International (Studio and Publishing) Ltd, All Rights Reserved