vfig on 2/11/2025 at 15:27
Quote Posted by Demetri
What I'm looking for assistance on is getting it to not look like are casting a spell (like a Hammerite priest or mage) when they do it and have it resemble them actually puking the player's direction.
when an ai does a ranged attack, they always look for motions with the tag
RangedCombat 0. in the default motiondb in T2, there are three motions that match only this tag: BH113100, BH113101, BH113102—all variations on the handwaving spellcasting. more specialised ai archetypes add their own motion tags, such as bowman (Motions>ActorTagList:
WithBow 0) and BugBeast (Motions>ActorTagList:
BugDemon 0); this means they select more specific motions with, for example, the tags
RangedCombat 0, WithBow 0 (one match: BH313006).
(note: i recommend using Force's Dark Object Viewer to see the motions in action; if you view any creature mesh in it, it adds a side panel with a list of all the stock motions that you can select from to see them in action.)
as luck would have it, there is one motion in the stock T2 motiondb that is suitable for a puking ranged attack: BH113651 (this is one of two motions with the tags
Stalled 0, Poisoned 0; the other one is not really a good fit for what you describe). so you wont have to find or create your own animation.
what you
will have to do though, is build a custom motiondb for your mission. ShadowSpawn's motion tools are the classic way of doing this, and there are tutorials about it; but NewDark also added tools for dumping motion schemas and rebuilding the motiondb that can also work for this (see the NewDark docs for info on that).
whichever toolset you use, you will need a full set of motion schemas in an
mschema subfolder of your fm folder, and be able to build a new motiondb.bin in the root of your fm folder. you
might need a full copy of all the stock motions in a
motions subfolder of your fm folder for the motiondb build to work—though you do not need to distribute any unchanged stock motion files (.mc and .mi) with your mission when it is released, as they are all in motions.crf.
it is best to begin with an entirely unmodified stock set of motion schemas and make sure you can successfully build motiondb.bin and use it in-game: if something is not set up right, then you will see ais not animating properly, or garrett not able to use the blackjack or bow, or things like that. once you have a working setup with unmodified stock schemas, then you can begin to make changes.
what you might do is add a new motion schema entry for the BH113651 motion, for example with tags
RangedCombat 0, Zombie 0. then your zombie doing a ranged attack should select this animation instead of the handwaving ones for its attack, because the ZombieTypes archetype already has Motions>ActorTagList:
Zombie 0 to specialise its motions when possible.
in general, using a random motion for a ranged attack is not going to be enough to make it work right. motions have flags set on them at different frames to indicate gameplay-related events at those frames, such as when feet touch the ground, or when a melee attack should start having a physical presence, or—in this case—when a ranged attack should release a projectile: the FireRelease flag (Weyoun's motedit tool, or R Soul's motion tools for Blender can be used to view or edit these flags). in the bow-draw motiom BH113100 this flag is set on frame 74, for example.
but you are in luck with the puking motion BH113651, because it already has the FireRelease flag set on frame 24 (when the head is thrown forward). this is exactly what you need, so you shouldnt need to actually edit any motion files themselves; only a custom schema as noted above so your zombie can select the right motion for its attack.