[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - Understanding Animation.

Understanding Animation.

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Understanding Animation.

Postby ScatterBox » Thu Nov 21, 2013 9:58 pm

User avatar
ScatterBox
 
Posts: 50
Joined: Sun Oct 13, 2013 7:53 pm

Re: Understanding Animation.

Postby Spike » Thu Nov 21, 2013 10:18 pm

void() army_run2 =[ $run2, army_run3 ] {ai_run(15);};

expands to:
void() army_run2 =
{
//this is the 'op_state' part from the square brackets
self.frame = $run2; //frame macros expand to immediates (read: constants). Each name defined by the "$frame" directive at the top of the qc file defines a $yourconstant that has 1 value more than the previous one, starting at 0. The qcc expands them to float immediates when it encounters them.
self.think = army_run3; //the named function from op_state is automatically prototyped as returning void and taking no arguments.
self.nextthink = time + 0.1; //op_state implies a specific 0.1 second interval. you can always override after.

ai_run(15); //yup, that's a regular function call.
};

the ai_run function executes the ai code for the 'run' behaviour. 'run' basically means running at the monster's .enemy and probably switching to attack animations randomly.
the argument is the number of quake units to move forward by. remember that its specified at 0.1 intervals, so 15 is effectively 150qu per second, but only for a 10th of a second...
per-frame values allow a lurching sort of animation, which nicely ties to the monster's lurching animation.
there's other ai functions like ai_stand() and ai_walk(x) for other states also there's ai_pain to step around. your attack states should probably update the angle the monster is facing, but they typically don't bother running any other ai while shooting.

side note: more modern animation styles for player-type characters would use a constant value for each frame, and have the model itself provide the staggering. you can then have the clientside gamecode update the animation at a rate relative to the actual distance traveled. this covers lag and all sorts of other issues, ensuring foot-sync. of course, if you're using vanilla content, your code needs vanilla-compatible lurches. yay!... *cough*. it doesn't matter too much with monsters, its players that can strafe and do other non-axial movements that make life fun that really need it.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Understanding Animation.

Postby Cobalt » Fri Nov 22, 2013 7:15 pm

Lots of mods I see dont use the " $ " type commands at all for the frame macros and such. Did the original release of progs < 1.06 use these ? For example:

$cd id1/models/player_4
$origin 0 -6 24
$base base
$skin skin


player.qc file seems to have these commands in some cases, but not every one has them. I have been told before they are basicly useless ?
User avatar
Cobalt
 
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA

Re: Understanding Animation.

Postby Spike » Fri Nov 22, 2013 8:17 pm

those ones you listed were part of some tool to convert 'alias' models to quake's .mdl format. id were fans of scanning sourcecode, I guess.
ignored by the qcc, they're not used by the engine and can be stripped out without problems. just don't strip the $frame parts.
consider them as comments.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 2 guests