Wudan Posted December 19, 2002 Share Posted December 19, 2002 I think there is, yeah, you can even slow them down and what-not. Link to comment Share on other sites More sharing options...
razorace Posted December 20, 2002 Author Share Posted December 20, 2002 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 More sharing options...
Wudan Posted December 20, 2002 Share Posted December 20, 2002 This is true. If you doubt master razorace, check out g_cmds.c - you could alternatively just remove those pesky #ifndef things, then compile. Link to comment Share on other sites More sharing options...
XSeth2kX Posted January 6, 2003 Share Posted January 6, 2003 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 More sharing options...
Code Posted January 6, 2003 Share Posted January 6, 2003 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 More sharing options...
XSeth2kX Posted January 6, 2003 Share Posted January 6, 2003 i got my sit animation to stay but i still can move forward when in it Link to comment Share on other sites More sharing options...
razorace Posted January 6, 2003 Author Share Posted January 6, 2003 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 More sharing options...
razorace Posted January 6, 2003 Author Share Posted January 6, 2003 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 More sharing options...
XSeth2kX Posted January 6, 2003 Share Posted January 6, 2003 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 More sharing options...
razorace Posted January 6, 2003 Author Share Posted January 6, 2003 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 More sharing options...
XSeth2kX Posted January 6, 2003 Share Posted January 6, 2003 when im done with it how do i set it back to normal? Link to comment Share on other sites More sharing options...
razorace Posted January 6, 2003 Author Share Posted January 6, 2003 That's not a problem. This command is reset for every cycle (both client and server frame, I think). Link to comment Share on other sites More sharing options...
Code Posted January 6, 2003 Share Posted January 6, 2003 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 More sharing options...
Wudan Posted January 6, 2003 Share Posted January 6, 2003 For those of you at home, PM_FREEZE is already in the stock Jk2MP code, so the above code just uses it. PM_FREEZE, in case you didn't know, stops a player from moving or being hit. Link to comment Share on other sites More sharing options...
razorace Posted January 6, 2003 Author Share Posted January 6, 2003 Thanks Wudan. I hadn't seen that yet. Anyway, that means that you probably don't want to use that for your kiss animation unless you want people spamming it to avoid damage. Link to comment Share on other sites More sharing options...
Code Posted January 6, 2003 Share Posted January 6, 2003 stops a player from moving or being hit. by the saber yes, but the player can be force kicked & some weapons ALT fire work also Link to comment Share on other sites More sharing options...
razorace Posted January 6, 2003 Author Share Posted January 6, 2003 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 More sharing options...
Wudan Posted January 6, 2003 Share Posted January 6, 2003 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 Link to comment Share on other sites More sharing options...
razorace Posted January 6, 2003 Author Share Posted January 6, 2003 Yep, it's overkill. Like replacing the engine on your car when you need to change the oil. Link to comment Share on other sites More sharing options...
XSeth2kX Posted January 7, 2003 Share Posted January 7, 2003 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 More sharing options...
Wudan Posted January 7, 2003 Share Posted January 7, 2003 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 More sharing options...
razorace Posted January 7, 2003 Author Share Posted January 7, 2003 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 More sharing options...
Wudan Posted January 8, 2003 Share Posted January 8, 2003 What he has there is a sleep command, and it toggles on and off. The server won't change anything until he gives the command again to turn it off, so he'll be 'sleeping/frozen'. Link to comment Share on other sites More sharing options...
razorace Posted January 8, 2003 Author Share Posted January 8, 2003 Well, duh! That wasn't related to the question I asked. Link to comment Share on other sites More sharing options...
Wudan Posted January 8, 2003 Share Posted January 8, 2003 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.