Last visit was: Sun Nov 24, 2024 4:49 am It is currently Sun Nov 24, 2024 4:49 am

All times are UTC




 [ 18 posts ]  Go to page Previous  1, 2
 Pat, about using Lazarus source under GPL 
Author Message
Post 
Here's the whole new G_SetClient Frame function in p_view.c:
Code:
#define MAX_STEP_FRACTION 0.80

void G_SetClientFrame (edict_t *ent)
{
   gclient_t   *client;
   qboolean   duck, run;
   // CDawg -- add here!
   trace_t      tr;
   vec3_t      end = {0, 0, -2};
   qboolean   floor = true;

   if (ent->s.modelindex != MAX_MODELS-1)
      return;      // not in the player model

   client = ent->client;

   if (client->ps.pmove.pm_flags & PMF_DUCKED)
      duck = true;
   else
      duck = false;
   // Knightmare- don't always play running animation when in mud
   if (ent->in_mud && xyspeed > 40)
      run = true;
   else if (!ent->in_mud && xyspeed)
      run = true;
   else
      run = false;

   // Lazarus: override run animations for vehicle drivers
   if (ent->vehicle)
      run = false;

   // Knightmare- do the check here, to be sure not to skip over the frame increment
   // also, always set to jump if jumping upward
   VectorMA (ent->s.origin, 50, end, end);
    tr = gi.trace (ent->s.origin, NULL, NULL, end, ent, MASK_ALL);
    //Com_Printf("%f\n", tr.fraction);
   if (tr.fraction >= MAX_STEP_FRACTION)
      floor = false;
   else if (ent->client->oldvelocity[2] > 0 || ent->velocity[2] > 0)
      floor = false;
   // CDawg -- end here!

   // check for stand/duck and stop/go transitions
   if (duck != client->anim_duck && client->anim_priority < ANIM_DEATH)
      goto newanim;
   if (run != client->anim_run && client->anim_priority == ANIM_BASIC)
      goto newanim;
   // Knightmare- only skip increment if greater than step or swimming
   if (!ent->groundentity && client->anim_priority <= ANIM_WAVE && (!floor || ent->waterlevel > 2))
      goto newanim;

   if(client->anim_priority == ANIM_REVERSE)
   {
      if(ent->s.frame > client->anim_end)
      {
         ent->s.frame--;
         return;
      }
   }
   else if (ent->s.frame < client->anim_end)
   {   // continue an animation
      ent->s.frame++;
      return;
   }

   if (client->anim_priority == ANIM_DEATH)
      return;      // stay there
   if (client->anim_priority == ANIM_JUMP)
   {
      if (!ent->groundentity)
         return;      // stay there
      ent->client->anim_priority = ANIM_WAVE;
      ent->s.frame = FRAME_jump3;
      ent->client->anim_end = FRAME_jump6;
      return;
   }

newanim:
   // return to either a running or standing frame
   client->anim_priority = ANIM_BASIC;
   client->anim_duck = duck;
   client->anim_run = run;

   // Knightmare- added swimming check
   if (!ent->groundentity && (!floor || ent->waterlevel > 2)) //CDawg modify this
   {
//ZOID: if on grapple, don't go into jump frame, go into standing
//frame
      if (client->ctf_grapple) {
         ent->s.frame = FRAME_stand01;
         client->anim_end = FRAME_stand40;
      } else {
//ZOID
         client->anim_priority = ANIM_JUMP;
         if (ent->s.frame != FRAME_jump2)
            ent->s.frame = FRAME_jump1;
         client->anim_end = FRAME_jump2;
      }
   }
   else if (run)
   {   // running
      if (duck)
      {
         ent->s.frame = FRAME_crwalk1;
         client->anim_end = FRAME_crwalk6;
      }
      else
      {   // CDawg - add here!
         if (client->backpedaling)
         {
            client->anim_priority = ANIM_REVERSE;
            ent->s.frame = FRAME_run6;
            client->anim_end = FRAME_run1;
         }
         else
         {
            ent->s.frame = FRAME_run1;
            client->anim_end = FRAME_run6;
         } // CDawg end here!
      }
   }
   else
   {   // standing
      if (duck)
      {
         ent->s.frame = FRAME_crstnd01;
         client->anim_end = FRAME_crstnd19;
      }
      else
      {
         ent->s.frame = FRAME_stand01;
         client->anim_end = FRAME_stand40;
      }
   }
}

Add this to the gclient_s struct in g_local.h after machinegun_shots:
Code:
qboolean    backpedaling;  //<- CDawg added this

And add this to ClientThink in p_client.c after ent->light_level is set:
Code:
// CDawg - add here!
if (ucmd->forwardmove < -1)
   ent->client->backpedaling = true;
else
   ent->client->backpedaling = false;
// CDawg end here!


Mon Mar 10, 2003 5:12 pm
Post 
NeVo wrote:
What's the code for the fix? This seems to be something that should obviously be included in 3.22... lol go figure I thought I had the game dll's finalized months ago...


The original CDawg's post is at the Quake2 DLL section of qsrc.org forums. You don't need it now, anyway. 8)


Sat Mar 22, 2003 9:04 am
Post 
Pat, I've got the Lazarus DLL ready now. Email me if you want the source.


Sun Mar 23, 2003 8:48 pm
Post 
What's Lazarus?


Mon Mar 24, 2003 4:33 am
Post 
SeienAbunae wrote:
What's Lazarus?

Lazarus is a (famous) assortment of entity modifications made to Quake2
http://www.planetquake.com/lazarus/


Mon Mar 24, 2003 5:13 pm
Post 
/me looks, and...

:shock:
:D


Tue Mar 25, 2003 1:48 am
Post 
Sorry for the bad english

I think, I've done, what you are talking about.
If ready, my engine called 'techlevel0 - rotten world' uses a lot of features from lazarus - reworked in the q3.21 source.

I kicked the ai,fx (fmod etc.) and the misc actor.

Most Lazarus fearures are running well - my only problems in the moment are in the func_pushable(I can't bring that dammed crane to work!) and in the level transitions (sometimes they will spawn in walls in the new level). The rest is working fine (I hope!).

First early information can be found at http://www.schuppenhauer.de/techlevel0

I will release some newer pics later today!


Tue Mar 25, 2003 1:20 pm
Post 
Marco wrote:
my engine called 'techlevel0 - rotten world' uses a lot of features from lazarus - reworked in the q3.21 source.


Your project look very interesting !
* Pat add your website in his bookmark *

Inform us when you will release a demo ;)


Tue Mar 25, 2003 7:36 pm
Display posts from previous:  Sort by  
 [ 18 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: AhrefsBot [Bot 2021-12-30], claudebot [Bot 2024-04-20], Google [Bot]


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 post attachments in this forum

Jump to:  
Powered by phpBB © phpBB Group.
Initial forum style by Vjacheslav Trushkin.