Author Topic: Appropriate VFX?  (Read 538 times)

Legacy_Shiek2005

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
Appropriate VFX?
« on: August 19, 2011, 08:15:38 pm »


                Hoping someone can help here.

I want an appropriate vfx to trigger when a boulder is destroyed, i have tried some that sound like something appropriate, but they don't trigger, these are 

eVFX = EffectVisualEffect(VFX_COM_CHUNK_STONE_MEDIUM);

and

eVFX = EffectVisualEffect(VFX_COM_CHUNK_STONE_SMALL);

But they do not trigger...AT ALL.

Here's my script:

/*
*  Script generated by LS Script Generator, v.TK.0
*
*  For download info, please visit:
*  http://nwvault.ign.c....Detail&id=1502
*/
// Can go OnDamaged, OnDisturbed, OnSpellCastAt, etc.
// This is a generic script, calling GetLastHostileActor() instead of the event-sepcific command.


void main()
{
   effect eVFX;
   object oSelf = OBJECT_SELF;

   // Get the creature who triggered this event.
   object oPC = GetLastHostileActor();

   // If the PC's current strength is at least 16.
   if ( GetAbilityScore(oPC, ABILITY_STRENGTH) >= 16 )
   {
       // Destroy an object (not fully effective until this script ends).

       eVFX = EffectVisualEffect(VFX_COM_CHUNK_STONE_SMALL);
       ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oSelf);
       DestroyObject(oSelf, 1.0);

       // Have text appear over the PC's head.
       FloatingTextStringOnCreature("" + GetName(oPC) + " Destroyed the boulder blocking the way.", oPC);

       // Give 100 experience to us.
       GiveXPToCreature(oSelf, 100);
   }
   else
   {
       // Have text appear over the PC's head.
       FloatingTextStringOnCreature("" + GetName(oPC) + " Is not strong enough to destroy the boulder.", oPC);
   }
}

Any ideas? or is the vfx i'm looking for another different one that i may be overlooking.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Appropriate VFX?
« Reply #1 on: August 19, 2011, 08:27:19 pm »


               try oPC = GetLastDamager(); if that helps otherwise it seems ok

btw the (most) placeables itself (at least default from biowatr) has some a visual effect on being destroyed
               
               

               
            

Legacy_Shiek2005

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
Appropriate VFX?
« Reply #2 on: August 19, 2011, 08:32:50 pm »


               Ahh, ok...i'm gonna try that because i'm using a cep placable right now.
               
               

               
            

Legacy_Shiek2005

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
Appropriate VFX?
« Reply #3 on: August 19, 2011, 08:58:48 pm »


               Yeah, it works better now that i'm using a bioware placable. Is there anyway to duplicate that vfx on something else?
               
               

               
            

Legacy_Roddish

  • Jr. Member
  • **
  • Posts: 82
  • Karma: +0/-0
Appropriate VFX?
« Reply #4 on: August 19, 2011, 09:04:46 pm »


               well i just made it work on a dwarfen chest. is that bioware or cep?? hat placeable did you use?
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Appropriate VFX?
« Reply #5 on: August 19, 2011, 09:14:55 pm »


               

Shiek2005 wrote...

 
I want an appropriate vfx to trigger when a boulder is destroyed, i have tried some that sound like something appropriate, but they don't trigger, these are 

 .


So I guess you are placing the script in the OnDeath Event.  If so this is your porblem.   Short answer is that once the script is finished running the Object is no longer around to do anything.
               
               

               
            

Legacy_Axe_Murderer

  • Full Member
  • ***
  • Posts: 199
  • Karma: +0/-0
Appropriate VFX?
« Reply #6 on: August 19, 2011, 09:19:12 pm »


               If it is an OnDeath event, calling DestroyObject on OBJECT_SELF is pointless...engine will do that automatically for you as soon as the script ends.
               
               

               
            

Legacy_Roddish

  • Jr. Member
  • **
  • Posts: 82
  • Karma: +0/-0
Appropriate VFX?
« Reply #7 on: August 19, 2011, 09:20:08 pm »


               aha.....
so maybe if you place a location variable with the boulders location on the player damaging it in the boulders on damaged and then get the ondeath of the boulder to fire a script on the player creating the effect at the location?



---------------------edit


just re-read the thread. seems i grabbed the wrong end of the stick and proceeded to beat around the bush with it. sorry '<img'>
               
               

               


                     Modifié par Roddish, 19 août 2011 - 08:21 .
                     
                  


            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Appropriate VFX?
« Reply #8 on: August 19, 2011, 09:37:08 pm »


               

Shiek2005 wrote...

Yeah, it works better now that i'm using a bioware placable. Is there anyway to duplicate that vfx on something else?


That's cause a lot of the CEP plasceables are missing the appropriate animations for OnHit, nDeath, etc. - probably because they are meant to be static pieces. 
               
               

               
            

Legacy_Hardcore UFO

  • Full Member
  • ***
  • Posts: 157
  • Karma: +0/-0
Appropriate VFX?
« Reply #9 on: August 19, 2011, 10:06:24 pm »


               If it's on a placeable's OnDeath, you're also giving the placeable 100 XP instead of the destroyer. You can easily change that with:

GiveXPToCreature(oPC, 100);
               
               

               
            

Legacy_Shiek2005

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
Appropriate VFX?
« Reply #10 on: August 20, 2011, 12:11:18 am »


               It's on the OnPhysicalAttacked or whatever the event is called because i need to check the PC's strength before determining whether s/he can destroy the object or not.

It's a CEP placable, for a while i was thinking that the VFX was initiated through a script, but thats kind-of silly when thinking about some more, not all placables have scripts.
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Appropriate VFX?
« Reply #11 on: August 20, 2011, 01:58:23 am »


               The VFX is initiated by the animations it has. If it has the default OnHit anim the plc will shake when hit with an attack. If it has the default OnDamage anim it will blow apart into chunks.

Those chunks you see are not actually a VFX in the way you normally think of them. They are particles generated by an emitter that is linked to the OnDamaged animation. The chunks that fly from a plc when its destroyed are not the same chunks you see if you were using the visual chunk effects. They may look the same but the source models are different - one is the plc model and the visual chunk comes from a specific VFX model.
               
               

               


                     Modifié par Pstemarie, 20 août 2011 - 01:01 .
                     
                  


            

Legacy_Shiek2005

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
Appropriate VFX?
« Reply #12 on: August 20, 2011, 05:24:44 pm »


               I see, thanks for the info.