Aller au contenu

Photo

Cannot get a visual to work


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

#1
Retpircs Wols

Retpircs Wols
  • Members
  • 18 messages
Greetings all,

I am working on a script that replaces  the Eldritch Blast (nw_s0_ieldblast) - turning it into a Point Blank Area of Effect spell that causes damage in a Sphere around the caster - causing more damage the closer the enemy is to the caster.  The problem is that I cannot get it to give me a good VFX on the caster.  

I attempted to get the VFX from Circle of Doom to radiate out from the caster, but cannot find it (which brings me to a request - is there a list of VFX and thier codes other than the one in the .2da list, which is almost all boxes floating over char. heads?).  The one selected is... a box over his head :?.


------------------------------- Also, how do I use the new format for a script? -----------------------------


//Made by Retpircs Wols; heavily "borrowed" from NWN Official - "Crushing Despair" and "Fireball"

#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
/*
  Spellcast Hook Code
  Added 2003-06-20 by Georg
  If you want to make changes to all spells,
  check x2_inc_spellhook.nss to find out more
*/
    if (!X2PreSpellCastCode())
    {
    // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
        return;
    }
// End of Spell Cast Hook


//SpellCode

    object oCaster = OBJECT_SELF;                        //get caster

    int nLevel = GetLevelByclass(class_TYPE_WARLOCK);    //get Warlock Level
    //GetCasterLevel(OBJECT_SELF);
        //Limit Caster level for the purposes of damage
        if (nLevel > 10)
        {
            nLevel = 10;
        }   
    int nChar = GetAbilityScore(oCaster, ABILITY_CHARISMA);    //get Charisma score
    int nDC = 5 + nChar;                                    //make the DC the baddie needs to pass (beat charisma)
    effect eEffect;                                            //effect variable
   
//////////////////VISUALS: On CASTER
  effect eVis = EffectVisualEffect(VFX_DUR_SPELL_EVIL_CIRCLE);        //cannot get good visuals
  ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oCaster);
//////////////////END VISUALS for Caster   

   
    /////////////////////////////////////RUN Collasal hit - d2 * (charisma/3) + (War. Level/2)
    object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF), TRUE, OBJECT_TYPE_CREATURE);
    while(GetIsObjectValid(oTarget))         //while loop for valid critter targets
        {
        if(!GetIsReactionTypeFriendly(oTarget) == TRUE)    //make sure it is a baddie
                {
                //attempt a Will Save at 15 + Char Mod
                if (WillSave(oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS) == 0)   
                {       
                eEffect = EffectDamage(d2(nChar/3)+ (nLevel/2), DAMAGE_TYPE_NEGATIVE, DAMAGE_POWER_ENERGY);
                ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oTarget);
               
                //visuals Necro
                    effect eVis = EffectVisualEffect(VFX_HIT_SPELL_NECROMANCY);
                    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
                }        //stop baddie if               
           }           //end of do - grab next critter
        oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF), TRUE, OBJECT_TYPE_CREATURE);
        } // End of Collosal
       
       
    /////////////////////////////////////RUN Large hit - 4d * (charisma/3) + (War. Level/2)

    oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF), TRUE, OBJECT_TYPE_CREATURE);
    while(GetIsObjectValid(oTarget))
        {
        if(!GetIsReactionTypeFriendly(oTarget) == TRUE)
                {
                //attempt a Will Save at 15 + Char Mod
                if (WillSave(oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS) == 0)   
                {       
                eEffect = EffectDamage(d4(nChar/3)+ (nLevel/2), DAMAGE_TYPE_NEGATIVE, DAMAGE_POWER_ENERGY);
                ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oTarget);
               
                //visuals Necro
                    effect eVis = EffectVisualEffect(VFX_HIT_SPELL_NECROMANCY);
                    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
                }
               
           }         
        oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF), TRUE, OBJECT_TYPE_CREATURE);
        } // End of Medium       
       
       
    /////////////////////////////////////RUN Small hit - 6d * (charisma/3) + (War. Level/2)

    oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_SMALL, GetLocation(OBJECT_SELF), TRUE, OBJECT_TYPE_CREATURE);
    while(GetIsObjectValid(oTarget))
        {
        if(!GetIsReactionTypeFriendly(oTarget) == TRUE)
                {
                //attempt a Will Save at 15 + Char Mod
                if (WillSave(oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS) == 0)   
                {       
                eEffect = EffectDamage(d6(nChar/3)+ (nLevel/2), DAMAGE_TYPE_NEGATIVE, DAMAGE_POWER_ENERGY);
                ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oTarget);
               
                //visuals Necro
                    effect eVis = EffectVisualEffect(VFX_HIT_SPELL_NECROMANCY);
                    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
                }
               
           }         
        oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_SMALL, GetLocation(OBJECT_SELF), TRUE, OBJECT_TYPE_CREATURE);
        } // End of Small               
       
}

#2
MasterChanger

MasterChanger
  • Members
  • 686 messages

Retpircs Wols wrote...

I am working on a script that replaces  the Eldritch Blast (nw_s0_ieldblast) - turning it into a Point Blank Area of Effect spell that causes damage in a Sphere around the caster - causing more damage the closer the enemy is to the caster.  The problem is that I cannot get it to give me a good VFX on the caster.  

I attempted to get the VFX from Circle of Doom to radiate out from the caster, but cannot find it (which brings me to a request - is there a list of VFX and thier codes other than the one in the .2da list, which is almost all boxes floating over char. heads?).  The one selected is... a box over his head :?.


------------------------------- Also, how do I use the new format for a script? -----------------------------
   
//////////////////VISUALS: On CASTER
  effect eVis = EffectVisualEffect(VFX_DUR_SPELL_EVIL_CIRCLE);        //cannot get good visuals
  ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oCaster);
//////////////////END VISUALS for Caster   


First, most "VFX_DUR_*" visuals are just the "frame" or icon that shows above the character's head. The idea is that it pops up when applied to let you know it's active and disappears when the effect ends.

Second, the best way to browse the visuals can be unzip them all to your directory of choice and then use the Visual Effects Editor in your Toolset's plugin menu to look through that directory. Once you've found a suitable effect, you can use EffectNWN2SpecialEffectFile to play the .SEF (don't use the .SEF extension when you pass the filename in the parameter list) rather than EffectVisualEffect.

Lastly, as far as pasting scripts here, it's always going to be rather ugly. You can use code and /code (inside square brackets like all BBCode) to maintain your formating, but it's still not as elegant as the old Bioboards. The best approach for long bits of code can be to use PasteBin and provide a link here.

Modifié par MasterChanger, 12 janvier 2011 - 10:55 .


#3
Shallina

Shallina
  • Members
  • 1 011 messages
you can edit vfx for spell and do your own with the vfx editor of the toolset.



Then you need to declare them in the visualeffect.2da to be able to declare them and link the file name so you can call that VFX in a custom spell or an editted spell.

#4
MasterChanger

MasterChanger
  • Members
  • 686 messages

Shallina wrote...

you can edit vfx for spell and do your own with the vfx editor of the toolset.

Then you need to declare them in the visualeffect.2da to be able to declare them and link the file name so you can call that VFX in a custom spell or an editted spell.


I'm almost positive that you only need to declare VFX's in visualeffect.2da if you plan to use EffectVisualEffect. Since you're directly calling the SEF with EffectNWN2SpecialEffectFile, I'm pretty sure you don't need to mess with 2da's if you use that function instead.

#5
Retpircs Wols

Retpircs Wols
  • Members
  • 18 messages
Thank you both. I am going to play with VFX editing in the future; now that I understand the naming convention, I was able to find a number of eligible VFX. I ended up with "VFX_FEAT_TURN_UNDEAD. I still wish I knew where the Circle of Doom VFX is hiding, but I can work with what I did find (about everything else!).



I do have another question though: when I test this, it does not hit friendlies, however, it does hit neutrals. Is there a way to ONLY make it hit hostile creatures? I thought I had that worked out at line 50.

#6
Dann-J

Dann-J
  • Members
  • 3 161 messages
I prefer to use EffectNWN2SpecialEffectFile rather than EffectVisualEffect to play effects, as it allows for a greater number of effects to be used. I don't think all of them have VFX_ global script constants defined for them. And as MasterChanger points out, you can create custom SEF files and use them without having to fool around with 2DAs.



I usually search for a good effect by putting an effect placeable down in the toolkit (any one will do), looking at its property tab, bringing up the effect drop-down menu, and typing likely words into the text box at the top. For instance, 'aoe' stands for 'area of effect'. For cold-based effects, I'll try search words like 'cold', 'frost', 'ice', 'glacial', etc.