Xonotic Forums
[SOLVED] Orienting weapons to bones (CSQC) - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Creating & Contributing (https://forums.xonotic.org/forumdisplay.php?fid=10)
+--- Forum: Xonotic - Development (https://forums.xonotic.org/forumdisplay.php?fid=12)
+--- Thread: [SOLVED] Orienting weapons to bones (CSQC) (/showthread.php?tid=5418)



[SOLVED] Orienting weapons to bones (CSQC) - toneddu2000 - 03-28-2015

Hi guys! I'm trying to attach a weapon (normal model without bones) to a CSQC player skeleton with this code (in player predraw function)
Code:
setorigin(rifle,gettaginfo(self, weapon_r));

The weapon is attached correctly, but orientation follows mouse input. I'd like that it'd stay oriented to weapon bone.
Is it possible? I asked at guys at inside3d but no one knows how to do it

Please don't tell me to look at Xonotic code: I did it but I cannot understand a thing!Tongue

Thanks in advance guys!!


RE: Orienting weapons to bones (CSQC) - Mario - 03-28-2015

Regular weapons use a h_ model (h_electro.iqm for example) to handle bones, copying one of these to use with your static v_ mesh should work fine, no need to modify code.

A full guide on the process is available here: https://gitlab.com/xonotic/xonotic/wikis/Weaponsystem


RE: Orienting weapons to bones (CSQC) - toneddu2000 - 03-28-2015

Thanks a lot Mario, but I forgot to tell that I'm not creating a mod for Xonotic but a complete standalone project and I asked here because maybe some Xonotic dev could help me a bit

Thanks anyway though!Wink


RE: Orienting weapons to bones (CSQC) - toneddu2000 - 03-30-2015

Solved on inside3d, thanks to Spike
for those interested, go here.

Thanks anyway