Announcement

Collapse
No announcement yet.

Adding frames for Player.QC (reaper bot)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Adding frames for Player.QC (reaper bot)

    Whenever the player (enforcer) animates it play's all the wrong frames.

    void () player_shot1 = [ 113.000, player_shot2 ] {

    self.weaponframe = TRUE;
    self.effects = (self.effects | EF_MUZZLEFLASH);

    };

    void () player_shot2 = [ 114.000, player_shot3 ] {

    self.weaponframe = FL_SWIM;

    };

    void () player_shot3 = [ 115.000, player_shot4 ] {

    self.weaponframe = MOVETYPE_WALK;

    };

    void () player_shot4 = [ 116.000, player_shot5 ] {

    self.weaponframe = MOVETYPE_STEP;

    };

    void () player_shot5 = [ 117.000, player_shot6 ] {

    self.weaponframe = MOVETYPE_FLY;

    };

    void () player_shot6 = [ 118.000, player_run ] {

    self.weaponframe = MOVETYPE_TOSS;

    };

    void () player_axe1 = [ 119.000, player_axe2 ] {

    self.weaponframe = TRUE;

    };

    void () player_axe2 = [ 120.000, player_axe3 ] {

    self.weaponframe = FL_SWIM;

    };

    void () player_axe3 = [ 121.000, player_axe4 ] {

    self.weaponframe = MOVETYPE_WALK;
    W_FireAxe ();

    };

    void () player_axe4 = [ 122.000, player_run ] {

    self.weaponframe = MOVETYPE_STEP;

    };

    void () player_axeb1 = [ 125.000, player_axeb2 ] {

    self.weaponframe = MOVETYPE_FLY;

    };

    void () player_axeb2 = [ 126.000, player_axeb3 ] {

    self.weaponframe = MOVETYPE_TOSS;

    };

    void () player_axeb3 = [ 127.000, player_axeb4 ] {

    self.weaponframe = MOVETYPE_PUSH;
    W_FireAxe ();

    };

    void () player_axeb4 = [ 128.000, player_run ] {

    self.weaponframe = FL_CLIENT;

    };

    void () player_axec1 = [ 131.000, player_axec2 ] {

    self.weaponframe = TRUE;

    };

    void () player_axec2 = [ 132.000, player_axec3 ] {

    self.weaponframe = FL_SWIM;

    };

    void () player_axec3 = [ 133.000, player_axec4 ] {

    self.weaponframe = MOVETYPE_WALK;
    W_FireAxe ();

    };

    void () player_axec4 = [ 134.000, player_run ] {

    self.weaponframe = MOVETYPE_STEP;

    };

    void () player_axed1 = [ 137.000, player_axed2 ] {

    self.weaponframe = MOVETYPE_FLY;

    };

    void () player_axed2 = [ 138.000, player_axed3 ] {

    self.weaponframe = MOVETYPE_TOSS;

    };

    void () player_axed3 = [ 139.000, player_axed4 ] {

    self.weaponframe = MOVETYPE_PUSH;
    W_FireAxe ();

    };

    void () player_axed4 = [ 140.000, player_run ] {

    self.weaponframe = FL_CLIENT;

    };

    void () player_nail1 = [ 103.000, player_nail2 ] {

    self.effects = (self.effects | EF_MUZZLEFLASH);
    if ( !self.button0 ) {

    player_run ();
    return ;

    }
    self.weaponframe = (self.weaponframe + TRUE);
    if ( (self.weaponframe == MOVETYPE_FLYMISSILE) ) {

    self.weaponframe = TRUE;

    }
    SuperDamageSound ();
    W_FireSpikes (MOVETYPE_STEP);
    self.attack_finished = (time + 0.200);

    };

    void () player_nail2 = [ 104.000, player_nail1 ] {

    self.effects = (self.effects | EF_MUZZLEFLASH);
    if ( !self.button0 ) {

    player_run ();
    return ;

    }
    self.weaponframe = (self.weaponframe + TRUE);
    if ( (self.weaponframe == MOVETYPE_FLYMISSILE) ) {

    self.weaponframe = TRUE;

    }
    SuperDamageSound ();
    W_FireSpikes (CONTENT_SLIME);
    self.attack_finished = (time + 0.200);

    };

    void () player_light1 = [ 105.000, player_light2 ] {

    self.effects = (self.effects | EF_MUZZLEFLASH);
    if ( !self.button0 ) {

    player_run ();
    return ;

    }
    self.weaponframe = (self.weaponframe + TRUE);
    if ( (self.weaponframe == MOVETYPE_FLY) ) {

    self.weaponframe = TRUE;

    }
    SuperDamageSound ();
    W_FireLightning ();
    self.attack_finished = (time + 0.200);

    };

    void () player_light2 = [ 106.000, player_light1 ] {

    self.effects = (self.effects | EF_MUZZLEFLASH);
    if ( !self.button0 ) {

    player_run ();
    return ;

    }
    self.weaponframe = (self.weaponframe + TRUE);
    if ( (self.weaponframe == MOVETYPE_FLY) ) {

    self.weaponframe = TRUE;

    }
    SuperDamageSound ();
    W_FireLightning ();
    self.attack_finished = (time + 0.200);

    };

    void () player_rocket1 = [ 107.000, player_rocket2 ] {

    self.weaponframe = TRUE;
    self.effects = (self.effects | EF_MUZZLEFLASH);

    };

    void () player_rocket2 = [ 108.000, player_rocket3 ] {

    self.weaponframe = FL_SWIM;

    };

    void () player_rocket3 = [ 109.000, player_rocket4 ] {

    self.weaponframe = MOVETYPE_WALK;

    };

    void () player_rocket4 = [ 110.000, player_rocket5 ] {

    self.weaponframe = MOVETYPE_STEP;

    };

    void () player_rocket5 = [ 111.000, player_rocket6 ] {

    self.weaponframe = MOVETYPE_FLY;

    };

    void () player_rocket6 = [ 112.000, player_run ] {

    self.weaponframe = MOVETYPE_TOSS;

    };
    Can anyone help me out here.
    I am like a stray dog, lost in between what I do and what I should do.
    But sometimes, all you need is Imagination.


  • #2
    is there a special enforcer for the reaper bot that you need to replace the original with? There is only 101 frames in the original enforcer, so those numbers are already off the charts. I'm surprised it works at all.

    Edit: I counted them in the original QC and I may have miscounted by one, cause if you notice the lowest number in your code is 103. There has to be a special model that is used.
    http://www.nextgenquake.com

    Comment


    • #3
      There has to be a special model that is used.
      Like the original player model ranger, which will work fine.
      I am like a stray dog, lost in between what I do and what I should do.
      But sometimes, all you need is Imagination.

      Comment


      • #4
        I might need to reanimate it, which is going to be a tad bit hard.
        Maybe that's what i need to do.
        I am like a stray dog, lost in between what I do and what I should do.
        But sometimes, all you need is Imagination.

        Comment


        • #5
          I'm just going off your info, bro. You wrote:
          Whenever the player (enforcer) animates it play's all the wrong frames.

          The enforcer and the ranger are not the same thing.

          If you are trying to mod this to work with the enforcer, just open the original enforcer code and adjust the floats in reaper bot to match the proper frames.

          I don't know how much you know, so I'm going to pretend that you know nothing so I don't leave out anything.

          Code:
          void () player_shot1 = [ 113.000, player_shot2 ] {
          
          self.weaponframe = TRUE;
          self.effects = (self.effects | EF_MUZZLEFLASH);
          
          };
          that is saying to play frame 113, then it sets weaponframe and add an effect followed by going to the function named player_shot2, where it will follow the same format of operations but on a different frame (114)

          so go look at original enforcer and change to the right frame number. You are going to have to do some counting though. In the original QC they use $frame instead of a number. So for instance

          Code:
          $frame stand1 stand2 stand3 stand4 stand5 stand6 stand7
          are frames 1 through 7. But the next line:

          Code:
          $frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10
          are frames 8 through 17

          if the animation functions are too many/few in the reaperbot code just add/delete them as needed in the reaper bot code.

          Code:
          void () player_shot1 = [ [COLOR="DarkOrange"]first step: play this frame number[/COLOR], [COLOR="DarkOrange"]last step: go to this function[/COLOR] ] {
          
          [COLOR="DarkOrange"]second step: do these operations. sometimes there are none.[/COLOR]
          
          };
          Last edited by MadGypsy; 09-02-2013, 10:04 PM.
          http://www.nextgenquake.com

          Comment


          • #6
            to clarify, the magic '113' number is a frame number. change it to match your new (enforcer) animation frames, instead of leaving it with values that match only the player.

            void () functionname = [ FRAME, NEXTFUNCTION ] { foo(); };
            is shorthand for:
            void() functionname =
            {
            self.frame = FRAME;
            self.think = NEXTFUNCTION;
            self.nextthink = time + 0.1;
            foo();
            };

            $foo is automatically expanded by the qcc to an immediate float. the values come from the ordering given by the $frame directive.
            note that your 113 will have originally come from such a constant, but no such named consants will still exist in decompiled code as they were expanded by the qcc and no longer exist in the progs.dat that you decompiled.

            Also, when dealing with decompiled code you might want to replace constants with immediates (ie: MOVETYPE_FLY -> 5).
            Decompilers are definitely not perfect and can result in extra bugs that were not originally there.
            Some Game Thing

            Comment


            • #7
              Huh, i guess i could use original Quake 1 progs, all i wanted is to add frames.

              http://quakeone.com/forums/quake-hel...oter-mode.html
              I am like a stray dog, lost in between what I do and what I should do.
              But sometimes, all you need is Imagination.

              Comment


              • #8
                Did u get this fixed? I think the numbers for the sets of frames are not the same for the player model and the enforcer....so thats why the animation is wrong.

                Comment


                • #9
                  About frames in QC

                  I know it is a old post, but just for clarify the things about frames:

                  In a mdl file (Quake one models) the frames are one each other in sequence, without nothing special except a name (that is just informational and not necessary match the namig in the QC code, but conveniently if you don't want to get lost).

                  So, consider it as a sequence of frames one next the other in ascending order.

                  The animations are composed of various frames, and you don't have a special manner to make QC know it, except that you must specify exactly the frame numbers that compose the animation, for example:

                  Code:
                  $frame alert1 alert2 alert3 alert4 alert5 alert6 alert7 alert8 alert9 alert10
                  With that code you are telling QC that there are a list of frames that carry the animation of "alert". But it don't make sense if it is not ordered in the correct sequence of total frames.

                  For example, if the first frame (frame number 0) is the begining of the stand animation, and the frame number 9 is the end of that animation, you will need to declare 10 frames for it:

                  Code:
                  $frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 stand10
                  But if the alert animation begins in the frame 10, you must declare it exactly next to the stand definition, so the numbers of frames can correctly continue matching.
                  (If you comment some $frame definition, you will lost the order and the next frames after the commented one will not be matching the animation).
                  That explains the fact that the frame names are not related with the names inside the mdl file. QuakeC don't do that work for you (it don't will match the code of definition of frames with the names inside the mdl and put the correct number accordly; that is your work).

                  Other confusion comes with the begining and the end of an animation. The animation need a number of frames, but it have a begin and a end. You need to put exactly the numbers of each frame to complete the animation.

                  If you have some code that take care of intermediate numbers, you anyway must specify the first and the last frame of that animation. It must have a begin and an end. That can be the numbers only.


                  The easy way:

                  Open the model with some model viewer that supports play of animation (almost all, q2mdl is a good one), and play step by step frame by frame, see the resulting animation, and take note of the frame number for the desired animation.

                  Next we need to match the number of each frame in the QC code.


                  Other confusion is that you can use only numbers instead of $frame definition.
                  That can give you a some far idea of what animation correspond to what frame, but you can anyway declare some constant with the proper name and change only the number of the constant if you want to change the animation.
                  Remember you need a begin and a end if you use numbers.

                  Example (play the alert animation):

                  Code:
                  // Wake up
                  void()	robot_alert1	=[	$alert1 ,	robot_alert2	] {
                  sound (self, CHAN_VOICE, "robot/alert.wav", 1, ATTN_IDLE);};
                  void()	robot_alert2	=[	$alert2 ,	robot_alert3	] {};
                  void()	robot_alert3	=[	$alert3 ,	robot_alert4	] {};
                  void()	robot_alert4	=[	$alert4 ,	robot_alert5	] {};
                  void()	robot_alert5	=[	$alert5 ,	robot_alert6	] {};
                  void()	robot_alert6	=[	$alert6 ,	robot_alert7	] {};
                  void()	robot_alert7	=[	$alert7 ,	robot_alert8	] {};
                  void()	robot_alert8	=[	$alert8 ,	robot_alert9	] {};
                  void()	robot_alert9	=[	$alert9,	robot_alert10	] {};
                  void()	robot_alert10	=[	$alert10,	robot_walk1	] {};
                  Can be reeplaced by (something like):
                  Code:
                  // Wake up
                  void() robot_alert2;
                  void() robot_alert1 =
                  {
                  	self.frame = FRAMEBEG_ROBOT_ALERT;
                  	self.think = robot_alert2;
                  	self.nextthink = time + 0.1;
                   
                  	sound (self, CHAN_VOICE, "robot/alert.wav", 1, ATTN_IDLE);	
                  };
                  
                  void() robot_alert2 =
                  {
                  	self.frame = self.frame+1;
                  	
                  	if (self.frame >= FRAMEEND_ROBOT_ALERT)
                  		self.think = robot_walk1;
                  	else
                  		self.think = robot_alert2;
                  		
                  	self.nextthink = time + 0.1;
                  };

                  That is all, and you will get the correct animation played.

                  Comment

                  Working...
                  X