player shoot and running question
player shoot and running question
Hey,
Im currently looking for an simple way to make the playermodel able to handle 2 different animations:
When the player doesnt move he should play the "stand and shoot" animations, and when moving the
"run and shoot" animations..
Im using the "SetClientFrame" function from scratch qc..
Im currently looking for an simple way to make the playermodel able to handle 2 different animations:
When the player doesnt move he should play the "stand and shoot" animations, and when moving the
"run and shoot" animations..
Im using the "SetClientFrame" function from scratch qc..
Re: player shoot and running question
if you want to do it properly, you'll need to use FTE_CSQC_SKELETONOBJECTS and a skeletal model. this should also allow you to twist the spine, play different parts at different speeds, and should allow foot syncing if done properly.
Simple use of it still requires having a copy of the player in csqc.
if you don't do it properly, you'll probably end up resetting the run animation while shooting. The alternative is to make numrunframes*numshootframes frames in order to switch between them properly. Its just messy.
Simple use of it still requires having a copy of the player in csqc.
if you don't do it properly, you'll probably end up resetting the run animation while shooting. The alternative is to make numrunframes*numshootframes frames in order to switch between them properly. Its just messy.
Re: player shoot and running question
regular MDL and NetQuake (FitzQuake), no FTE and Darkplaces stuff...
It has been done before in a Quakemod, but i forgot the name...
It has been done before in a Quakemod, but i forgot the name...
Re: player shoot and running question
Are there real run n shoot animations in the stock player model? Last time I looked, the only one with the right footwork frames was the axe. The other weapons dont move the feet at all when moving and attacking....
Re: player shoot and running question
i want it for my own playermodel...
too bad nobody can help :/
too bad nobody can help :/
Re: player shoot and running question
instead of the curent way of animating, call some other function that works out which frame to use based upon whether you're running (or not) and when you started shooting (or stopped).
or make two entities for the player, a bit like quake3. have the legs entity animate independantly based upon the player's speed, but be sure to update its origin to match the main/upper player model within playerpostthink. no framecount explosion then. when the torso is idle, it can use the same frame as the legs and switch to its own animation when not idle (you might want to animate the legs in playerprethink so that its done before the player/torso's think, but be sure to do the setorigin within playerpostthink - this location is mandatory or it will get disjointed or laggy).
or make two entities for the player, a bit like quake3. have the legs entity animate independantly based upon the player's speed, but be sure to update its origin to match the main/upper player model within playerpostthink. no framecount explosion then. when the torso is idle, it can use the same frame as the legs and switch to its own animation when not idle (you might want to animate the legs in playerprethink so that its done before the player/torso's think, but be sure to do the setorigin within playerpostthink - this location is mandatory or it will get disjointed or laggy).
Re: player shoot and running question
well im using scratch qc setclientframe function...
I wonder if theres a way to change the animations with
a "self.isfiring" (TRUE / FALSE) float based on button0 / !button0
somehow...
I wonder if theres a way to change the animations with
a "self.isfiring" (TRUE / FALSE) float based on button0 / !button0
somehow...
Code: Select all
void () SetClientFrame =
{
// note: call whenever weapon frames are called!
if (self.anim_time > time)
return; //don't call every frame, if it is the animations will play too fast
self.anim_time = time + 0.1;
local float anim_change, run;
if (self.velocity_x || self.velocity_y)
run = #TRUE;
else
run = #FALSE;
anim_change = #FALSE;
// check for stop/go and animation transitions
if (run != self.anim_run && self.anim_priority == #ANIM_BASIC)
{
dprint("anim_change = TRUE \n");
anim_change = #TRUE;
}
if (anim_change != #TRUE)
{
if (self.frame < self.anim_end)
{ // continue an animation
self.frame = self.frame + 1;
return;
}
if (self.anim_priority == #ANIM_DEATH)
{
if (self.deadflag == #DEAD_DYING)
{
self.nextthink = -1;
self.deadflag = #DEAD_DEAD;
}
return; // stay there
}
}
// return to either a running or standing frame
self.anim_priority = #ANIM_BASIC;
self.anim_run = run;
if (self.velocity_x || self.velocity_y)
{ // running
self.frame = 15;
self.anim_end = 20;
}
else
{ // standing
self.frame = 0;
self.anim_end = 9;
}
};
-
- Posts: 2126
- Joined: Sat Nov 25, 2006 1:49 pm
Re: player shoot and running question
I have one version of this *kinda* working (some quirks in the frameloops) in DP (uses MOVETYPE_FOLLOW). Basically I split the player model in two halves and glued two non-solid entities checking the player entity movements and frames.Spike wrote:instead of the curent way of animating, call some other function that works out which frame to use based upon whether you're running (or not) and when you started shooting (or stopped).
or make two entities for the player, a bit like quake3. have the legs entity animate independantly based upon the player's speed, but be sure to update its origin to match the main/upper player model within playerpostthink. no framecount explosion then. when the torso is idle, it can use the same frame as the legs and switch to its own animation when not idle (you might want to animate the legs in playerprethink so that its done before the player/torso's think, but be sure to do the setorigin within playerpostthink - this location is mandatory or it will get disjointed or laggy).
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC (LordHavoc)
-
- Posts: 2126
- Joined: Sat Nov 25, 2006 1:49 pm
Re: player shoot and running question
https://www.youtube.com/watch?v=Uq-jIj058FU
No MOVETYPE_FOLLOW. No vwep or attacks besides the kick, though
No MOVETYPE_FOLLOW. No vwep or attacks besides the kick, though
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC (LordHavoc)
Re: player shoot and running question
issue fixed...
re-wrote the entire way to handle playerframes..
Quakes original qc is just shit
re-wrote the entire way to handle playerframes..
Quakes original qc is just shit
Re: player shoot and running question
to be fair you are trying to beat a rushed 1996 game to do new things, this is something that isn't even possible in any modern doom port ever. Even Unreal had a similar thing with a run-while-shooting animation as well as aiming up/down variations.
i should not be here
Re: player shoot and running question
i made an own way to handle the anims, which took awhile to make but it was worth it.
It works like i wanted, and its totally different from the regular quake code.
Maybe it can be made simpler but atm im checking the players state (walk/run, button0
pressed etc..) to update the animations.
Each anims are defined (#define PLAYER_STAND etc..), getting updated via
float (float anim_type, float lastframe) GetClientFrames:
Just as an example
It works like i wanted, and its totally different from the regular quake code.
Maybe it can be made simpler but atm im checking the players state (walk/run, button0
pressed etc..) to update the animations.
Each anims are defined (#define PLAYER_STAND etc..), getting updated via
float (float anim_type, float lastframe) GetClientFrames:
Code: Select all
switch (anim_type)
{
case #PLAYER_STAND:
if (lastframe)
return 9;
return 0;
break;