Animals that fires projectiles? Projectiles that generate a health condition?

Started by CrazyMalk, October 02, 2017, 06:28:06 PM

Previous topic - Next topic

CrazyMalk

Hello! I would like to ask some questions, so forgive me for my bad english!
  First of all, is it possible to create an animal that fires projectiles, during certain circunstances, like when both the creature and the target are looking at each other?
  Second, is it possible to make that projectile create some custom health condition?
  Third, if the answer for the second question is yes, would it be possible to make that health condition only being created with a certain chance?

I'm trying to make an animal that deals a health condition when the target is looking to it, and it is looking at the target, but not every time it happens. Something like a Medusa, for example. In the beginning, i was thinking of something like in the Rim of Madness mod, when you look at the creature you get the health condition. But with a projectile, you could use a certain item from JecsTools to deflect the attack, for example.

Albion

I just tried to replace the <verbClass>Verb_MeleeAttack</verbClass> of an animal with <verbClass>Verb_Shoot</verbClass> like it's used for guns but this results in the error "has no available melee attack". Which means that animals can generally only melee attack and are therefor unable to fire projectiles.
It could be possible to create some c# code to fix that but that should be rather complicated.

I have another suggestion though: have the creature be a create with a race like the mechanoids. You could use the scyther as a template.
The benefit is that those can equip gear. You could create a new weapon that only your creatures can equip (like the charge lance for scythers and the inferno/blaster cannon for centipedes). That weapon then does the actual projectile firing.
You don't need to give that weapon a description or anything just have the creature spawn with it.
It's ugly and definitly a dirty fix but it's the best solution I can come up with.
Sorry for not being a better help.

If you decide to follow this path though there is a rather comprehensive tutorial on how to create a gun that shoots bullets that give certain health conditions with a specific chance. That tutorial can be found here (link).
Relevant for you are steps 12 and following. They explain in detail how to create that bullet def and the c# code you'll need.
The guide also explains how to have a specific chance to create the health condition so that is also possible.

In conclusion: It's impossible without some specific c# code but there might be a dirty workaround that could make it possible.
However even then the creature will fire at the target in range and doesn't care if the target is looking back or not. I guess this would also be fixable with some brilliant c# code but I wouldn't even know where do begin...

CrazyMalk

Thanks!
I also have no idea of where to begin a code like the one that would be needeed, but thanks for the workaround, it will work perfectly! I had thought about using the hidden gear, but did not think about the mechanoid, so this helped me out a lot :D
Once again, sorry for my bad english.

Albion

Your english is quite good so no problem.
I'm happy to help.
If you finish your mod and publish it I would love a link via a post here or a pm. I'm curious what you're working on.

CrazyMalk

I'm actually trying to finish that "Community Fantasy Animals" project... There were 3 animals textures left there without code... This is my first project ever lol
Sadly, i'm pretty sure it was abandoned, so those three probally will be the last animals added to it, and i will need to fix the others. But after that, i will try to work on my very own projects (I already have some ideas) :D