Index | FAQ | Search | Memberlist | Usergroups | Profile | Log in to check your private messages | Log in | Register

Animation and weapon

| Inside3d Forums Forum Index -> QuakeC Programming

View previous topic :: View next topic
Author | Message
--- | ---
Freemanoid Joined: 16 Jun 2008 Posts: 52 Location: BELARUS |

Posted: Mon Jun 16, 2008 4:11 pm Post subject: Animation and weapon |

I wish to prolong playing of animation of the weapon. I create 17 frames of shooting my RPG. I have written function: In weapons.qc : $cd id1/progs/v_rock2.mdl $origin 0 0 54
$base base
$skin skin
$frame shot1 shot2 shot3 shot4 shot5 shot6
$frame shot7 shot8 shot9 shot10 shot11 shot12
$frame shot13 shot14 shot15 shot16 shot17
void() s_shot1 = [$shot1, s_shot2] {};
void() s_shot2 = [$shot2, s_shot3] {};
void() s_shot3 = [$shot3, s_shot4] {};
void() s_shot4 = [$shot4, s_shot5] {};
void() s_shot5 = [$shot5, s_shot6] {};
void() s_shot6 = [$shot6, s_shot7] {};
void() s_shot7 = [$shot7, s_shot8] {};
void() s_shot8 = [$shot8, s_shot9] {};
void() s_shot9 = [$shot9, s_shot10] {};
void() s_shot10 = [$shot10, s_shot11] {};
void() s_shot11 = [$shot11, s_shot12] {};
void() s_shot12 = [$shot12, s_shot13] {};
void() s_shot13 = [$shot13, s_shot14] {};
void() s_shot14 = [$shot14, s_shot15] {};
void() s_shot15 = [$shot15, s_shot16] {};
void() s_shot16 = [$shot16, s_shot17] {};
void() s_shot17 = [$shot17, s_shot17] {};
Then i put function s_shot1 (); in function W_Attack :
else if (self.weapon == IT_ROCKET_LAUNCHER)
{
player_rocket1();
W_FireRocket();
self.attack_finished = time + 1.2;
s_shot1 ();
}
But when i shot from RPG in game in top left corner appears text :
R_DrawSprite No Such Frame 4
R_DrawSprite No Such Frame 4
R_DrawSprite No Such Frame 5
R_DrawSprite No Such Frame 5
Help me with this problem please!

Back to top |

IceDagger Joined: 19 Nov 2004 Posts: 20 |

Posted: Mon Jun 16, 2008 5:46 pm Post subject: |

Hmm... I'm guessing you're trying to extend the rocket weaponview model animation from 6 frames to 17 frames? If that's the case, then your use of the s_shot frame macro is wrong. Calling the s_shot1() function will run an animation string on the player model using the frame aliases you listed for v_rock2.mdl
The code you want to take a look at is in player.qc, look at player_rocket1-6() and you'll get the idea what you need to do. Easiest/Hackiest way would be to just stretch the player_rocket animation to 17 frames and set the corresponding self.weaponframe value each time. However, a better solution would be to code the animations manually.

Back to top |

Urre Joined: 05 Nov 2004 Posts: 1073 Location: Sweden |

Posted: Tue Jun 17, 2008 6:08 am Post subject: |

The question is wether he has made new animation frames for his playermodel, or just the view weapon. _________________ Look out for Twigboy

Back to top |

Freemanoid Joined: 16 Jun 2008 Posts: 52 Location: BELARUS |

Posted: Tue Jun 17, 2008 6:50 am Post subject: |

I tried to extend animation from 6 frames to 17 using functions in player.qc I get something like this : void() player_rocket1 =[$rockatt1, player_rocket2 ] {self.weaponframe=self.weaponframe + 1; self.effects = self.effects | EF_MUZZLEFLASH;};
void() player_rocket2 =[$rockatt2, player_rocket3 ] {};
void() player_rocket3 =[$rockatt3, player_rocket4 ] {};
void() player_rocket4 =[$rockatt4, player_rocket5 ] {};
void() player_rocket5 =[$rockatt5, player_rocket6 ] {};
void() player_rocket6 =[$rockatt6, player_run ] {
if (self.weaponframe == 17)
self.weaponframe = 1;
};
But it still doesn't work!
_________________
^O,..,o^

Back to top |

IceDagger Joined: 19 Nov 2004 Posts: 20 |

Posted: Tue Jun 17, 2008 2:07 pm Post subject: |

Urre wrote:
The question is wether he has made new animation frames for his playermodel, or just the view weapon.

He doesn't really need new player animation frames. He could slow the player frame sampling by using the same frame several times in a row, or he could just use running or standing animations for frames in excess of the sixth.
The best way IMO would be to manually code the animation into a custom think function instead of using frame macros, but I don't think he can do that without any help just yet.
Anyway, I'll see if I can come up with something as soon as I have the time. I'm a bit swamped with work at the moment.

Back to top |

Freemanoid Joined: 16 Jun 2008 Posts: 52 Location: BELARUS |

Posted: Wed Jun 18, 2008 7:05 am Post subject: |

I have found the answer in Reload Quake _________________ ^O,..,o^

Back to top |

Display posts from previous:

| Inside3d Forums Forum Index -> QuakeC Programming | All times are GMT
Page 1 of 1

Jump to:

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2004 phpBB Group