Aller au contenu

Photo

Issue with Scripted Visual Effects


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

#1
NeoMurakami

NeoMurakami
  • Members
  • 3 messages
Hello Everyone. I have a problem with a custom item that has a unique power property on it that triggers a script.  The script is meant to apply a visual effect to the user but every visual effect I try using does not actually show when I go in game and try the item out. I'm not sure what is wrong but I am 99.9% sure its not the code because I've used the same lines of code(even tried coping and pasting) in other items with the same visual effects and it still does not work. I pasted the code below, some of the effects were commented out so i could just test for the visual. And the "mag_blue" is a visual I used in other scripts that worked. Any information would be appreicated, I've asked others about the problem and have not seen anything on the forums with problems related to this.


void main()
{
 //declare variables
 object oPC = GetItemActivator();
 effect eConfuse = EffectInsane();
 effect eConfuseIcon = EffectVisualEffect(VFX_DUR_SPELL_CONFUSION, FALSE);
 effect eDamageSelf = EffectDamageOverTime(d4(5), 6.0, DAMAGE_TYPE_FIRE, TRUE);
 effect eVisualFire =  EffectVisualEffect(VFX_IMP_MAGBLUE);
 effect eKnockdown = EffectKnockdown();
 
 //link effects
 effect eLink = EffectLinkEffects(eConfuse, eDamageSelf);
 eLink = EffectLinkEffects(eLink, eConfuseIcon);
 
 //eLink = EffectLinkEffects(eLink, eVisualFire);
 
 SendMessageToPC(oPC, "Script Ran"); 
 
 ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisualFire, oPC);
 //ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, 13.0);
 
 //Delay effects for the knockdown
 DelayCommand(12.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eKnockdown, oPC, 3.0));
 DelayCommand(12.0, SendChatMessage(oPC, oPC, CHAT_MODE_TALK, "Stop, Drop, and Roll!", FALSE));
 DelayCommand(12.0, AssignCommand(oPC, ActionPlayAnimation(ANIMATION_FIREFORGET_LAYDOWN, 6.0, 3.0)));
}

#2
Guest_Chaos Wielder_*

Guest_Chaos Wielder_*
  • Guests
Does the code work besides the visual effects?

#3
Orion7486

Orion7486
  • Members
  • 161 messages
If I recall, more people are using the EffectNWN2SpecialEffectFile for visual effects. It's been along time since I tried using it, but you I think you would try writing it like:

object oPC = GetItemActivator();

effect eEffect = EffectNWN2SpecialEffectFile("string_name", oPC);

ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC);

The string name is the name of the .sef file for that effect. For the vfx_imp_magblue effect, that would be sp_magmiss_hit.sef.

You can get the .sef names from the visual effects 2da.

Maybe someone else with more knowledge of the function can reply.

#4
NeoMurakami

NeoMurakami
  • Members
  • 3 messages

Chaos Wielder wrote...

Does the code work besides the visual effects?


Yes, the script runs and everything works except the visual effects.

@Orion

Do I need to include any particular file to use that NWNSpellEffects Function?

#5
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
most visual effect constants were done for nwn1, and left in nwn2, so you have to check and see if they are in use at all, hence why many say use the alternate code to trigger them. However all the constants do is refer to visual effects.2da, which you can look at and see if a sef is indeed used.



One way to check is using this module -- > http://nwvault.ign.c...h.detail&id=149



Which allows you to look at all the vfx and preview them. ( and you can look at scripts too i imagine. )



I would start testing with a known working spell effect, once you know it's working then try using one you want specifically. You can look at spells for examples.




// this applies an effect to oMinion
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectNWN2SpecialEffectFile("fx_animus.sef"), oMinion);

// these are used for a puking emote with a delay on oPC
DelayCommand(0.3, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectNWN2SpecialEffectFile("fx_blood_green1_L.sef"), oPC));
DelayCommand(0.4, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectNWN2SpecialEffectFile("fx_blood_green1.sef"), oPC));

// which is same as the following, just did not declare the effect ahead of time
effect eEffect = EffectNWN2SpecialEffectFile("fx_blood_green1.sef");
DelayCommand(0.4, ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC));



#6
NeoMurakami

NeoMurakami
  • Members
  • 3 messages
Thank you guys. Tested it out with a few visual effects and it now works. Just out of curiousity though, what is the difference between the visual effect function and the special effect function that would cause it to screw up? Wondering why the visual effect function worked in other scripts with the same visual effect but just not this time.