Author Topic: Shooting arrows as VFX?  (Read 509 times)

Legacy_Vendel

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
Shooting arrows as VFX?
« on: November 13, 2011, 05:57:32 am »


               I am fiddling with some hak paks. I want to be able to shoot arrows (or similar models) without using the CastSpell or CastFakeSpell commands. Instead, I have the idea that I might create a visual effect (Beam effect maybe) between two locations.

This way, I may have, for example, a moving ship or large creature,shooting arrows every which way, WITHOUT turning to face the targets. Also, I may make traps or have arrows shot from arrow slits in walls, without engaging real creatures at all.

Can anyone help me, regarding the feasibility of this? I have been studying the visual effects 2da, but cannot see that Beam VFX employ models the same way as spells.2da does (where arrow models and projectile paths are specified).

Might there be other ways around this? CastFakeSpell has several drawbacks I wish to avoid (turning towards target, pausing to cast, limit of one cast per action, etc.)

Grateful for hints and ideas.
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Shooting arrows as VFX?
« Reply #1 on: November 13, 2011, 06:18:02 am »


               There is already an arrow vfx, but it's a homing style arrow, and not a straight line flight.

effect eArrow = EffectVisualEffect(357);  // NORMAL_ARROW
               
               

               
            

Legacy_Vendel

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
Shooting arrows as VFX?
« Reply #2 on: November 13, 2011, 07:28:35 am »


               OK. Any way to create your own variants?
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Shooting arrows as VFX?
« Reply #3 on: November 13, 2011, 10:00:34 am »


               Never played around with VFX personally, but looking at the 2da the only column with anything in it is in the "Type_FD", type "P", which the Mirv effects use.  You could try testing the visualeffects.2da in the override directory with that switched to "B", "F", and "D", to see if that in itself might give you a more usable effect from it.
               
               

               
            

Legacy_Vendel

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
Shooting arrows as VFX?
« Reply #4 on: November 13, 2011, 11:00:09 am »


               Yeah, I will play around a bit with it and see what I can get.
Even so, how can I get other models to fire? The only other entry used is "ProgFX_Impact". Here an arrow is represented by 903, while a dart (2 lines below) is represented by 904. What these refer to i have no idea.

Hm [tests like crazy]: I cannot even get a visual result with
effect eArrow = EffectVisualEffect(357); // NORMAL_ARROW
Neither when applying to object as above, or when making it an EffecBeam.
I get no visual at all!
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Shooting arrows as VFX?
« Reply #5 on: November 13, 2011, 01:03:35 pm »


               Very strange you're not getting any visual.  I've used it from within a spell script and had it work.  

What object is creating and applying the effect?  That can cause issues with some VFX, likely with that type you would need a creature or placeable to create the effect before you would see the arrow in flight VFX.
               
               

               
            

Legacy_Vendel

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
Shooting arrows as VFX?
« Reply #6 on: November 13, 2011, 01:25:47 pm »


               I have tried both having a plc and myself (PC) creating the effect, from a plc fired script.
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Shooting arrows as VFX?
« Reply #7 on: November 13, 2011, 01:59:31 pm »


               

Vendel wrote...

I have tried both having a plc and myself (PC) creating the effect, from a plc fired script.


It looks as though both the effect creator and target have to be creatures, based on teh quick test I just did.  Make a test arget creature near the placeable, and feed their tag into this OnClick script to try it out:



void ArrowSpam (object oTarget, int nCount);
void main()
{
 object oPC = GetPlaceableLastClickedBy();
 AssignCommand (oPC, ArrowSpam (GetObjectByTag ("TARGET_TAG_HERE"), d20 (5) ));
}
void ArrowSpam (object oTarget, int nCount)
{
 if (nCount < 1) nCount = 1;
 int i;
 float fDelay;
 effect eArrow = EffectVisualEffect(357); // NORMAL_ARROW
 for (i; i < nCount; i ++)
    {
     DelayCommand (fDelay, ApplyEffectToObject (DURATION_TYPE_TEMPORARY, eArrow, oTarget, 5.0) );
     fDelay += 0.25;
    }
}

Edit:  That will also work as DURATION_TYPE_INSTANT.  I switched it to temporary when I was trying to figure out why the arrow just appeared on the PC then disappeared again right after, without "launching".
               
               

               


                     Modifié par Failed.Bard, 13 novembre 2011 - 02:03 .
                     
                  


            

Legacy_shadguy

  • Jr. Member
  • **
  • Posts: 85
  • Karma: +0/-0
Shooting arrows as VFX?
« Reply #8 on: November 13, 2011, 05:26:37 pm »


               IIRC, You cannot make your own beam effects.  I'm not sure about overriding existing ones, but I think working with an existing effect  [like the arrows mentioned above]  may be your best bet.   MIRVs are also very hardcoded, so you can override what exists but making new additions won't make you happy, I think, for what you're doing. 

Maybe some sort of custom scripted fake spell is what you want;  have you experiemented with a non-targettable [self-only], point blank area of effect type of script?   Maybe you could place some waypoints or invisible objects nearby and have your custom "fake arrow barrage from a ship" attack preset nearby waypoint/locations.  The attack would be purely VFX, but with some slightly randomized timing and targets maybe you can do something that looks good.

-shadguy