Aller au contenu

Function to play VFX


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

#1
Guest_dewkl_*

Guest_dewkl_*
  • Guests
I've done this before...and I've forgot how I did it. I can't find the function to play a VFX on a specific location. Could someone remind me? 

#2
Craig Graff

Craig Graff
  • Members
  • 608 messages
Engine_ApplyEffectAtLocation

#3
Guest_dewkl_*

Guest_dewkl_*
  • Guests
The one I used earlier was ApplyEffectVisualEffect, but the one you mentioned here seems more fitting. ApplyEffectVisualEffect gets the integer ID for the vfx (nVFXId), but your example doesn't seem to do so.

Engine_ApplyEffectAtlocation(int nDurationType, effect eEffect, location lLocation, float fDuration, object oCreator, int nAbilityId)

How do you get the actual visual effect? Do you have to get the ability/effect itself that is linked to the VFX? I thought the effect type was gameplay/mechanical, something that altered the numeric properties of an object. I'm confused. Could someone make a short example with this function?

Modifié par dewkl, 01 avril 2010 - 08:14 .


#4
Barrett R

Barrett R
  • Members
  • 11 messages

dewkl wrote...
How do you get the actual visual effect? Do you have to get the ability/effect itself that is linked to the VFX?


effect eMyEffect = EffectVisualEffect(nVfxId); //create a variable for the visual effect with the ID you want
Engine_ApplyEffectAtLocation(duration_type, eMyEffect, location, etc);

Modifié par Barrett R, 01 avril 2010 - 08:37 .


#5
Qutayba

Qutayba
  • Members
  • 1 295 messages
(Piggy-backing on the OP with a follow-up question)

I'm trying to have a creature explode with a mind blast animation and knock back when it dies, as a new creature is spawned from the blast.  I've gotten the new creatures to spawn, so the basic mechanics of my creature intercept script are working.  But the vfx and knockback effect don't seem to be firing. Any ideas?  Here is the relevant script:


#include "spell_constants_h"

case EVENT_TYPE_DYING:
        {
           location lWisp = GetLocation(OBJECT_SELF);
           effect eBlast = EffectVisualEffect(1526); //1526 = Mind Blast in vfx_base.xls
   
           CreateObject(OBJECT_TYPE_CREATURE, R"wh_wisp.utc", lWisp);
           
           ApplyKnockbackAoe(OBJECT_SELF);
           Engine_ApplyEffectAtLocation(EFFECT_DURATION_TYPE_INSTANT, eBlast, lWisp, MIND_BLAST_DURATION);


Modifié par Qutayba, 02 avril 2010 - 07:05 .


#6
Craig Graff

Craig Graff
  • Members
  • 608 messages
Probably that VFX is a crust effect, meaning it needs to be applied to an object. You could either make your own version of the effect and apply that one, or you could create an invisible placeable with no collision such as the Invisible Object (Trap Trigger) appearance and apply the VFX to that. Then destroy the object after the VFX has expired. Or you could just apply the effect to the new creature and see how that works.

The knockback effect is likely being removed on death, making it more or less irrelevant. If you really want to use it you would likely have to make the creature immortal and fake the death, then destroy the creature or set it inactive.

Modifié par Craig Graff, 02 avril 2010 - 05:27 .


#7
Qutayba

Qutayba
  • Members
  • 1 295 messages
I solved my issues by placing the effects in the spawn event of the new creature rather than the death event of the old creature.

#8
BloodsongVengeance

BloodsongVengeance
  • Members
  • 590 messages
annnnnnd....



am i to understand that if i've created a custom vfx... i can't use this? i can't just call up the local resource vfxproj or whatever and spawn it? it has to have a 2da line entry as an identifier? GAH!



oh heh... maybe i'll apply it on a placeable... :X wait... can i apply it to a placeable just from local? GAH!



and can somebody expand the wiki tutorials to include this end part -- how to USE the vfx you've created? that'd be handy. thanks!