[ZScript] Detecting model bone/origin

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

[ZScript] Detecting model bone/origin

Postby WallyTheBoogieBug » Tue Jan 08, 2019 11:37 am

Is it possible to read the position and angle of a bone in a model through ZScript? I tried searching through some documentation or find example of model usage and ZScript which may point toward a way and found nothing.

My use case for this is such:

I have an actor who currently uses the model of the knights from Quake as a placeholder. I would like the swings of this character's sword to have a damaging actor whose position is updated each tic to match the exact arc of his sword swing. Refer to any number of action games like Ocarina of Time or Dark Souls for a live example of this exact idea in other games.

At present, I am accomplishing this simply by spawning the damaging actor in position each tic, with all positions being preprogrammed by me to match each animation. Naturally, eyeballing this is an arduous process to create and must be scripted by hand for every attack animation on every character. A script which is capable of detecting the position and angle of a bone which I add to these models would speed up this process tremendously by adding a reusable and scriptified way of creating damaging zones from model animations, and would also allow them to appear to much more closely match the animation than guessing the positions and making them by hand.

Would anyone have an idea that would point me in the right direction to scriptifying this issue? Any other ideas to accomplish this goal are also welcome if such a thing is not possible. Thanks for any suggestions in advance.
User avatar
Joined: 22 Apr 2012

Return to Scripting

Who is online

Users browsing this forum: Dan_The_Noob and 2 guests