Aller au contenu

Photo

Appropriate VFX?


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

#1
Shiek2005

Shiek2005
  • Members
  • 104 messages
 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.

#2
Shadooow

Shadooow
  • Members
  • 4 471 messages
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

#3
Shiek2005

Shiek2005
  • Members
  • 104 messages
Ahh, ok...i'm gonna try that because i'm using a cep placable right now.

#4
Shiek2005

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

#5
Roddish

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

#6
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

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.

#7
Axe_Murderer

Axe_Murderer
  • Members
  • 279 messages
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.

#8
Roddish

Roddish
  • Members
  • 41 messages
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 :D

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


#9
Pstemarie

Pstemarie
  • Members
  • 2 745 messages

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. 

#10
Hardcore UFO

Hardcore UFO
  • Members
  • 86 messages
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);

#11
Shiek2005

Shiek2005
  • Members
  • 104 messages
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.

#12
Pstemarie

Pstemarie
  • Members
  • 2 745 messages
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 .


#13
Shiek2005

Shiek2005
  • Members
  • 104 messages
I see, thanks for the info.