Aller au contenu

Casting/creating a cone VFX


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

#1
Guest_dewkl_*

Guest_dewkl_*
  • Guests
I'm trying to get a boss cast a flame cone (Flame Blast) VFX on the player from where it's standing. The boss is intended to be frozen in place but still being alive, something I think I can solve by using SetCreatureIsStatue. There's two problems I've encountered so far.

1. The caster is a beast and therefore I can't get it to actually cast the spell. At least I assume that's the reason. So I thought I could just create a vfx and do a conecheck (GetObjectsInShape) at the same time and inflict damage using that. I can't get it to work by using Engine_ApplyEffectAtLocation. I'm not sure how to use this for cone-based spells. How do you make it directed towards the player while having a specific source location? I'm guessing the location would be the location of the caster? If the flame blast cone is a crust effect. 

2. I tried adding a human (which I hope I could make invisible somehow) and gave it a command to use flame blast. It worked fine until I applied SetCreatureIsStatue which made the vfx/spell fire on itself (difficult to explain, but it didn't look right). Is there another way to freeze a creature's movement and still have it able to cast spells? 

#2
TimelordDC

TimelordDC
  • Members
  • 923 messages
I think the cone vfx is directed outward in the direction the caster is facing. So, you could try re-orienting the caster (boss) towards the player and then, just apply the effect on him. From the code in spell_cone, this should spawn the vfx on the boss:
-----
    effect eCone = EffectConeCasting(Ability_GetImpactLocationVfxId([color="#ff0000"]Flame Blast's Ability ID[/color]));
    ApplyEffectOnObject(EFFECT_DURATION_TYPE_TEMPORARY, eCone, [color="#ff0000"]oBoss[/color], 1.5f, [color="#ff0000"]oBoss[/color], 0);
-----

Once you do that, you will have to cycle through the creatures inside the cone and apply the effects. You can copy that piece of code directly from the spell_cone (just the flame blast parts, of course)

Don't know about second one. Couldn't you just have a human and change the appearance to a different ID (via SetAppearanceType) and still retain all 'human' properties including spell-casting?

#3
Nattfodd

Nattfodd
  • Members
  • 321 messages
To set the direction of the flame, i guess you can take a look on how are handled the projectiles. Maybe you can create a custom ability and add it to the Boss, starting from archery based abilities and substituting the arrow with the vfx.

About keeping the boss to its place but being able to move, i guess you want something similar to the new spec introduced in Awakening (i'm talkin about "Keeper" spec): you activate a modal ability that surrounds you with brambles and roots that keep you immobile but still able to cast spells.



These are only ideas, i've never tried that.

#4
Guest_dewkl_*

Guest_dewkl_*
  • Guests
Thanks! With everyones help I think I solved it. I just did this to orient to the player:
vector vPlayer = GetPosition(GetHero());
SetFacingPosition(oBoss, vPlayer);


and to keep the boss still but able to cast:
effect eMove = EffectModifyMovementSpeed(0.00, FALSE);
Engine_ApplyEffectOnObject(EFFECT_DURATION_TYPE_PERMANENT, eMove ,OBJECT_SELF);


The only obstacle left is making the human invisible. I'm looking into the setappearancetype-function now.
Edit: Changing the model to anything else will cause the effect to mis-orient, coming out from the side of the model etc.

Modifié par dewkl, 21 juin 2010 - 04:31 .


#5
TimelordDC

TimelordDC
  • Members
  • 923 messages
Do you still need an invisible human? Doesn't applying the vfx on the boss work?

#6
Guest_dewkl_*

Guest_dewkl_*
  • Guests
The VFX just fires from behind/side of the boss, regardless of how I position the facing. It only works correctly when applied to a human that can cast.

#7
Nattfodd

Nattfodd
  • Members
  • 321 messages
Probably you must attach the VFX to the correct crust node of the boss (if it is possible).

#8
Eshme

Eshme
  • Members
  • 756 messages
May be a VFX fixed to a crust node, but dewkl hasnt said what VFX he's talking about. But i think with the casting script stuff, it is. And then it is attached to the casting Crust ID's 2 and 3 for both hands which must be present in the Model first.

#9
Guest_dewkl_*

Guest_dewkl_*
  • Guests

Eshme wrote...

May be a VFX fixed to a crust node, but dewkl hasnt said what VFX he's talking about. But i think with the casting script stuff, it is. And then it is attached to the casting Crust ID's 2 and 3 for both hands which must be present in the Model first.

It's the fire blast-vfx as you can see in TimelordDC's example (ability ID: 10001) which I think is vfx id 1001. Can I print integer variables to the log somehow? to be sure?

Something tells me it's easier to hide the human than to find the correct crusts (if there are any) and calibrate them.

#10
Eshme

Eshme
  • Members
  • 756 messages
Sadly you havent meantioned which boss it is, im not certain. I know from models that only certain kinds have a casting crust node. Of course would make sense that a rock doesnt have one, but so may your boss. But all the humanoid have one thou. I think even the skeletons etcetc.

And VFX can be made crust based as u can see from the VFX editor. Fire blast sounds like a crust based cast spell that is cast from humans.

#11
tmp7704

tmp7704
  • Members
  • 11 156 messages

dewkl wrote...

I'm trying to get a boss cast a flame cone (Flame Blast) VFX on the player from where it's standing. The boss is intended to be frozen in place but still being alive, something I think I can solve by using SetCreatureIsStatue. There's two problems I've encountered so far.

1. The caster is a beast and therefore I can't get it to actually cast the spell. At least I assume that's the reason.

The drakes/dragons have ability which casts cone of fire in front of them, complete with the vfx. Perhaps you could give your boss that ability or at least look into how it's granted to the drakes and re-implement it for your creature?

#12
Eshme

Eshme
  • Members
  • 756 messages
This may also be crust vfx. At least the fire follows the Dragons movement so it is probably attached to a crust, and there it is Head ID5 this time that should be present and properly located as well, which may only be true for the dragons themselves since the dragon vfx is special made for them. You know the rotation and stuff of the crust node is important.

#13
TimelordDC

TimelordDC
  • Members
  • 923 messages
So, is it possible to copy the flame blast VFX and change the crust node it is attached to so we can use it for creature types that don't have the ability to cast that spell?

#14
Eshme

Eshme
  • Members
  • 756 messages
Maybe? You can download the VFX source files. And there (if it is a crust effect) try changing the underlying model and relocate the effect to proper crust and location. And play an animation to see if it looks alright. But it requires a crust node at the desired location.



You could in this case edit the model in max and add one with me exporter.

#15
TimelordDC

TimelordDC
  • Members
  • 923 messages
Thanks for clarifying that, Eshme. I plan to have some custom bosses with unique abilities in my mod so this information will definitely come in handy.

#16
Guest_dewkl_*

Guest_dewkl_*
  • Guests
Thanks indeed, I just got it working. I just edited the vfx, posted it, added 2da entry and now it works perfectly. Consider this topic solved, at least for me. Thanks to everyone.

Modifié par dewkl, 22 juin 2010 - 10:59 .


#17
Nattfodd

Nattfodd
  • Members
  • 321 messages
Can you tell me if you created a new VFX or if you modified the existing one and which 2DA you used?

Modifié par Nattfodd, 23 juin 2010 - 01:46 .


#18
Guest_dewkl_*

Guest_dewkl_*
  • Guests

Nattfodd wrote...

Can you tell me if you created a new VFX or if you modified the existing one and which 2DA you used?

1. Downloaded the vfx source files from here
2. Opened fxa_fire_cone_c
3. Edited the orientation to fit my model. (this turned out to be pretty straightforward)
4. Posted it to local
5. Added a new row in vfx_base (Using the original fire blast as a template)
edit: this forum sometimes doesn't get my line breaks.

Modifié par dewkl, 23 juin 2010 - 02:06 .