Continuous fire on weapon

SeeSharpist

New member
Hey guys. I'm wondering if there is anyway to denote a shootable weapon as firing a beam, for example a laser beam. Single or continuous. Essentially what the ParticleStream does with the MagicItem ability script in the demo, but triggered from a weapon instead. Anything like that on the horizon? Or any clues you can point me at were I to try to implement it myself? Thanks!
 
Not really - is there any particular reason you don't want to use a magic item for this?

I wonder if you could use a projectile weapon and just have the projectile be really long and thin...
 
So I did try to set up the item as a Magic item yesterday but I couldn't seem to get the OnImpact event like I could with a melee weapon. Maybe if I add Damage as an ImpactEvent? Essentially attempting to make a No Man's Sky style mining beam, got the beam working, except it's using the cast animation haha

Also, I couldn't find where 'Mana' was set in the demo scene, where should MagicItem resource pools be added? To the item?
 

Attachments

  • combat-weapon.jpg
    combat-weapon.jpg
    35.4 KB · Views: 5
You can have the attribute be on either the character or the item itself, depending on if you want each item to have a separate or shared attribute. In the MagicItem's "Attributes" section (under "Use") you can define if the attribute is on the item or the character (or both!).

For the impact, the OnImpact event will only be fired by a projectile (or Shootable/Melee Weapon). What you could do however is create a custom magic impact action - they inherit from ImpactAction and you can look at one of the existing ones, like AddForce, as an example. The Impact/ImpactInternal methods give you info on the objects that caused and hit the impact, similar to the OnObjectImpact event.
 
Thanks! That's not a bad idea, I'll look at doing that, seems a good route to go.

Speaking of actions, for the MagicItem script, I'm having two problems. One, I've specified a Play Audio Clip Begin Action (the laser charging) and a similar End Action (the laser ramping down). However, the begin action audio clip is not playing, and when I change the End Action Audio Clip size to 1, it immediately changes it back to 0 and actually sets the begin action clip array size to equal it. For example, I set 3 as a size to end action audio clip array, it changes it to zero and sets begin audio action audio clip array size to 3. Is that by design or a bug?
 

Attachments

  • magicitemaudiobug1.JPG
    magicitemaudiobug1.JPG
    42.1 KB · Views: 9
  • magicitemaudiobug2.JPG
    magicitemaudiobug2.JPG
    44.7 KB · Views: 9
Top