I have a dpm model and i want to control bones without csqc,is there a way to do it?
I tried split model on legs and tors parts and use MOVETYPE_FOLLOW,but its looks bad.
http://www.youtube.com/watch?v=q1ldKNgr ... e=youtu.be
Code: Select all
entity tophalf = spawn();
entity lowerhalf = spawn();
//We'll attach tophalf to lowerhalf
setmodel(lowerhalf, "models/bottom.iqm");
setmodel(tophalf, "models/top.iqm");
setattachment(tophalf, lowerhalf, "lower_attachment"); // Arguments are as follows: 1. The entity you want to attach, 2. The entity to attach onto, 3. The name of the tag or bone to attach onto (Set in your 3d modeling package)
Tags/bone names are essentially the same chunk of data, so you can use the bone name to use setattachment(); Just make sure you take note of how you set up your skeletons and where you want to attach things.Max_Salivan wrote:Thanks for reply.
At this moment i am using dpm(converted half life model in to dpm).
I could not find info about tags(how to do it or something else).
i didnt know what 3 argument of setattachment can be bone name. Maybe i can get better player model with setattachment function.
That's a toughie, as I don't use dpm.Max_Salivan wrote:Ok,bigthanks, i'll try it.
Is there a way to see dpm bones?(program or something else). DPMViewer cant do it(
Code: Select all
void() all_update =
{
if (self.owner.velocity_x || self.owner.velocity_y)
self.frame = 1;
else
self.frame = 0;
self.angles_y = self.owner.angles_y;
self.origin = self.owner.origin;
self.think = all_update;
self.nextthink = time + 0.01;
}
void() DrawAll =
{
tophalf = spawn();
lowerhalf = spawn();
setmodel(lowerhalf, "progs/player_legs.dpm");
setmodel(tophalf, "progs/player_tors.dpm");
lowerhalf.owner = self ;
setattachment(tophalf, lowerhalf, "Bip01");
lowerhalf.think = all_update;
lowerhalf.nextthink = time + 0.01;
}I'm not sure if that's just pseudocode, but it seems like the inheritance of origins is a bit inverted in your example. It seems like the parent(legs) are getting updated with it's own origin, rather than updating the origin of the torso in relation to the legs.Max_Salivan wrote:I found bone names in milkshape)
And wrote something like this,but animation are still like a shit(like this lol http://www.youtube.com/watch?v=-y93lpCP ... e=youtu.be)
Code: Select all
void() all_update = { if (self.owner.velocity_x || self.owner.velocity_y) self.frame = 1; else self.frame = 0; self.angles_y = self.owner.angles_y; self.origin = self.owner.origin; self.think = all_update; self.nextthink = time + 0.01; } void() DrawAll = { tophalf = spawn(); lowerhalf = spawn(); setmodel(lowerhalf, "progs/player_legs.dpm"); setmodel(tophalf, "progs/player_tors.dpm"); lowerhalf.owner = self ; setattachment(tophalf, lowerhalf, "Bip01"); lowerhalf.think = all_update; lowerhalf.nextthink = time + 0.01; }