Animation and weapon

Discuss programming in the QuakeC language.
Post Reply
Freemanoid
Posts: 52
Joined: Mon Jun 16, 2008 11:25 am
Location: BELARUS
Contact:

Animation and weapon

Post by Freemanoid »

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! :?:
IceDagger
Posts: 25
Joined: Fri Nov 19, 2004 10:43 am

Post by IceDagger »

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.
Urre
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon
Contact:

Post by Urre »

The question is wether he has made new animation frames for his playermodel, or just the view weapon.
I was once a Quake modder
Freemanoid
Posts: 52
Joined: Mon Jun 16, 2008 11:25 am
Location: BELARUS
Contact:

Post by Freemanoid »

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^
IceDagger
Posts: 25
Joined: Fri Nov 19, 2004 10:43 am

Post by IceDagger »

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. :(
Freemanoid
Posts: 52
Joined: Mon Jun 16, 2008 11:25 am
Location: BELARUS
Contact:

Post by Freemanoid »

I have found the answer in Reload Quake :wink:
^O,..,o^
Post Reply