[ZScript] Detecting model bone/origin

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

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.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
WallyTheBoogieBug
Posts: 47
Joined: Sun Apr 22, 2012 6:56 am

[ZScript] Detecting model bone/origin

Post by WallyTheBoogieBug »

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.
Post Reply

Return to “Scripting”