Jump to content

Home

JK2 Animation Thread


razorace

Recommended Posts

  • Replies 117
  • Created
  • Last Reply

sweet, I haven't really needed that yet, but it's good to know.

 

BTW, there's also a way to test BOTH animations while inside the game. You have to #define _DEBUG in your compile to toggle it on and then use the command "debugsetbodyanim animation name". Note: This command isn't listed and gives a "command not found" error if you don't include arguements.

Link to comment
Share on other sites

  • 3 weeks later...

im having a probe with the Kiss animation it jsut kisses anywhere when it plays it appers as if hes......well.......kissing nobody

 

 

And with the sit animation he just sit for not longer thna a second and stands i saw the

pm->ps->legsTimer = 7000;

pm->ps->torsoTimer = 7000;

but he said you have to set it back to 0, how?

 

 

 

 

//=============================================================

////MOD

//// Animations

else if (Q_stricmp (cmd, "sit") == 0)

{

StandardSetBodyAnim(ent, BOTH_SIT3, SETANIM_FLAG_HOLD|SETANIM_FLAG_OVERRIDE);

}

else if (Q_stricmp (cmd, "kiss") == 0)

{

StandardSetBodyAnim(ent, BOTH_KISSER1LOOP, SETANIM_FLAG_HOLD|SETANIM_FLAG_OVERRIDE);

}

//=============================================================

Link to comment
Share on other sites

NickR

 

"Check the loveandpeace command at the bottom of the g_cmds.c file."

 

Jman3ooo

 

"Ok the in g_cmds.c there is this under loveandpeace:"

 

 

else if (Q_stricmp(cmd, "loveandpeace") == 0 && CheatsOk( ent ))
{
	trace_t tr;
	vec3_t fPos;

	AngleVectors(ent->client->ps.viewangles, fPos, 0, 0);

	fPos[0] = ent->client->ps.origin[0] + fPos[0]*40;
	fPos[1] = ent->client->ps.origin[1] + fPos[1]*40;
	fPos[2] = ent->client->ps.origin[2] + fPos[2]*40;

	trap_Trace(&tr, ent->client->ps.origin, 0, 0, fPos, ent->s.number, ent->clipmask);

	if (tr.entityNum < MAX_CLIENTS && tr.entityNum != ent->s.number)
	{
		gentity_t *other = &g_entities[tr.entityNum];

		if (other && other->inuse && other->client)
		{
			vec3_t entDir;
			vec3_t otherDir;
			vec3_t entAngles;
			vec3_t otherAngles;

			if (ent->client->ps.weapon == WP_SABER && !ent->client->ps.saberHolstered)
			{
				Cmd_ToggleSaber_f(ent);
			}

			if (other->client->ps.weapon == WP_SABER && !other->client->ps.saberHolstered)
			{
				Cmd_ToggleSaber_f(other);
			}

			if ((ent->client->ps.weapon != WP_SABER || ent->client->ps.saberHolstered) &&
				(other->client->ps.weapon != WP_SABER || other->client->ps.saberHolstered))
			{
				VectorSubtract( other->client->ps.origin, ent->client->ps.origin, otherDir );
				VectorCopy( ent->client->ps.viewangles, entAngles );
				entAngles[YAW] = vectoyaw( otherDir );
				SetClientViewAngle( ent, entAngles );

				StandardSetBodyAnim(ent, BOTH_KISSER1LOOP,  SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD|SETANIM_FL
AG_HOLDLESS);
				ent->client->ps.saberMove = LS_NONE;
				ent->client->ps.saberBlocked = 0;
				ent->client->ps.saberBlocking = 0;

				VectorSubtract( ent->client->ps.origin, other->client->ps.origin, entDir );
				VectorCopy( other->client->ps.viewangles, otherAngles );
				otherAngles[YAW] = vectoyaw( entDir );
				SetClientViewAngle( other, otherAngles );

				StandardSetBodyAnim(other, BOTH_KISSEE1LOOP,  SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD|SETANIM_FL
AG_HOLDLESS);
				other->client->ps.saberMove = LS_NONE;
				other->client->ps.saberBlocked = 0;
				other->client->ps.saberBlocking = 0;
			}
		}
	}
}

 

so to have your function work with 'kiss'

change

else if (Q_stricmp(cmd, "loveandpeace") == 0 && CheatsOk( ent ))

to

else if (Q_stricmp(cmd, "kiss") == 0)

 

(be sure its not excluded by a ifdef)

Link to comment
Share on other sites

Originally posted by XSeth2kX

im having a probe with the Kiss animation it jsut kisses anywhere when it plays it appers as if hes......well.......kissing nobody

 

 

And with the sit animation he just sit for not longer thna a second and stands i saw the

 

but he said you have to set it back to 0, how?

Just type in...

pm->ps->legsTimer = 0;
pm->ps->torsoTimer = 0;

...before you make the animation call.

Link to comment
Share on other sites

Originally posted by XSeth2kX

i got my sit animation to stay but i still can move forward when in it

 

Ok, that means you gotta add an movement lock for that animation. I believe the "loveandpeace" command already has this feature. Search for "loveandpeace" in the files, I think it's in bg_move (I think that's the name).

Link to comment
Share on other sites

i found a command called freeze

ent->client->freeze=0;//Freeze Off?

ent->client->freeze=1;//Freeze On?

 

error C2039: 'freeze' : is not a member of 'gclient_s'

C:\Program Files\LucasArts\Star Wars JK II Jedi Outcast\GameData\code\game\g_local.h(339) : see declaration of 'gclient_s'

Link to comment
Share on other sites

That's not what you're looking for. "Freeze" is probably a left over off the Q3 code.

 

Ok, found it. It's under PmoveSingle in bg_pmove.c. This should automatically block the player from moving when in a kiss. What does it do now? What animations are you using for the kiss?

if ((pm->ps->legsAnim&~ANIM_TOGGLEBIT) == BOTH_KISSER1LOOP ||
	(pm->ps->legsAnim&~ANIM_TOGGLEBIT) == BOTH_KISSEE1LOOP)
{
	pm->cmd.forwardmove = 0;
	pm->cmd.rightmove = 0;
	pm->cmd.upmove = 0;
}

Link to comment
Share on other sites

i found a command called freeze

ent->client->freeze=0;//Freeze Off?

ent->client->freeze=1;//Freeze On?

 

that from DEST JediMod 1.2 source right ?

 

that a new feature added to freeze the player using PM_FREEZE

i also use this (thanks DEST btw)

 

to make it work 1st in g_active.c

find

} else {
if (client->ps.forceGripChangeMovetype)
{
	client->ps.pm_type = client->ps.forceGripChangeMovetype;
}
else
{
	client->ps.pm_type = PM_NORMAL;
}
}

change it to

} else {
if (client->ps.forceGripChangeMovetype)
{
	client->ps.pm_type = client->ps.forceGripChangeMovetype;
}
else
{
	// frozen ? 
	if (client->freeze==1)
	{
		client->ps.pm_type = PM_FREEZE;
	} else {
		client->ps.pm_type = PM_NORMAL;
	}
}
}

 

then 2nd in g_local.h

edit the struct gclient_s

to add a member

int freeze;

Link to comment
Share on other sites

So, it's probably easier to just add a movement lock to PmoveSingle (if it's needed) than using PM_FREEZE. It should already work, as is, if you're using BOTH_KISSER1LOOP or BOTH_KISSEE1LOOP.

 

However, this would make it nessicary to have a client side to your mod.

Link to comment
Share on other sites

Yes, movement lock is prefered, changing a client's pmtype isn't a good way to go, because for most things to work, their pmtype needs to be set to PM_NORMAL. the pmtype_t enum is in bg_public.h, fyi.

 

For instance, in g_cmds.c, noclip sets client->noclip, and this is translated to pmtype PM_NOCLIP in g_active.c.

 

Animations don't seem to update correctly when pmtype is changed from PM_NORMAL, but I haven't screwed around with this enough to know exactly what I'm talking about, ie, I dont know why PM_NORMAL gets special animation treatment ;P

Link to comment
Share on other sites

how do i turn off the saber and kock it so it cant be turned on also my model still cant move ive added the lock code.

 

this is what i have so far:

 

		else if (Q_stricmp (cmd, "sleep") == 0 && g_taunts.integer > 0)//Sleep
{
	      //If in use turn it off
		if ((ent->client->ps.legsAnim&~ANIM_TOGGLEBIT) == BOTH_SLEEP1)
		{
			StandardSetBodyAnim(ent, BOTH_SLEEP1GETUP, SETANIM_FLAG_HOLD|SETANIM_FLAG_OVERRIDE);

			ent->client->ps.saberCanThrow = qtrue;


		}
		    else
			{

			if (ent->client->ps.weapon == WP_SABER && !ent->client->ps.saberHolstered)
			{
				Cmd_ToggleSaber_f(ent);
			}
                   //Set Animation
			   StandardSetBodyAnim(ent, BOTH_SLEEP1, SETANIM_FLAG_HOLD|SETANIM_FLAG_OVERRIDE);
		        //Lock Pos.
			    pm->ps->legsTimer = 999999999;
                   pm->ps->torsoTimer = 999999999;
			    pm->cmd.forwardmove = 0;
             	pm->cmd.rightmove = 0;
            	pm->cmd.upmove = 0;

                  //Turn of Saber
			   ent->client->ps.saberCanThrow = qfalse;
			   ent->client->ps.saberMove = LS_NONE;
		       ent->client->ps.saberBlocked = 0;
			   ent->client->ps.saberBlocking = 0;
			}
}

Link to comment
Share on other sites

Try adding a line to that code to see if it makes it so the player can't ignite his saber:

 

//Turn of Saber
ent->client->ps.saberActive = qfalse;
ent->client->ps.saberCanThrow = qfalse;
ent->client->ps.saberMove = LS_NONE;
ent->client->ps.saberBlocked = 0;
ent->client->ps.saberBlocking = 0;
Link to comment
Share on other sites

Does your current movement lock placement actually work? I thought it had to be refreshed on the frame basis. It seems to me that your current movement lock would only prevent movement during the frame that the command is given. Maybe I'm wrong, I couldn't find the movement command refreshing code on a quick search.

Link to comment
Share on other sites

Well, I thought it was. You asked if it worked. It does. It'll work, essentially, until he tells it not to. His anims are checked everyframe, and he sets the timers to a really really long time. As long as he's "sleeping" he's locked.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...