razorace Posted October 9, 2002 Author Share Posted October 9, 2002 What's everyone's status on this? has anyone checked out the actual animation call function in depth? If not, I'll probably end up doing it. Link to comment Share on other sites More sharing options...
sleekdigital Posted November 16, 2002 Share Posted November 16, 2002 Ok, first of all, anyone trying to play an animation in the game should begin their studying in either cgame\animtable.h or game\anims.h I can't find a "cgame" directory or a "game" directory in the .pak files what am I missing here?? Please help Link to comment Share on other sites More sharing options...
Jaii der Herr Posted November 16, 2002 Share Posted November 16, 2002 hehe Those directories are from the mp source code... Link to comment Share on other sites More sharing options...
razorace Posted November 16, 2002 Author Share Posted November 16, 2002 Back to the animations thread, there's another way to call animations that is seen in the Jedi_DodgeEvasion function. I'm not really certain how it exactly works but it seems to run torso based (upper) animations. I'm still playing with it by it also seems to have a very low priorty with the certain setting. (I.E. It rarely activates unless you have your saber out and disactived.) Link to comment Share on other sites More sharing options...
razorace Posted December 15, 2002 Author Share Posted December 15, 2002 Ok, I've figured out a easier way to doing animations with the forceHandExtend stuff. I've gotten the basics down pat. However, I'm trying to do some more advanced animation merging (seperate torso and leg animation control) with the current system but I can't figure out where the heck the animations are directly controlled. The code SEEMS to be near the top of static void PM_Weapon( void ) inside the "else if (pm->ps->forceHandExtend != HANDEXTEND_NONE)" but I've discovered that it doesn't seem to do ANYTHING. It looks like it's suppose to do the actual animation control, but I can comment out the whole section and have it STILL work! It doesn't make any sense to me. Any help with this would be great. I just need a location and I can take it from there. Link to comment Share on other sites More sharing options...
razorace Posted December 15, 2002 Author Share Posted December 15, 2002 Man... I got my question piled under a bunch of answers to other people's questions, that I answered. BUMP! Link to comment Share on other sites More sharing options...
Wudan Posted December 15, 2002 Share Posted December 15, 2002 Torso and leg control is already separated. The section you are looking at returns desiredAnim, which is called after the fact in a couple of if/elsed PM_SetAnims so, if you chunked out all of the 'cased out desiredAnim's you should get an error when compiling. Are you using a weapon when you try to use those forcepowers? Oh, and because I love y'all, I wrote a little diddy that goes like http://users.sisna.com/tokyopop/jk2anim.html Well, it's less a diddy and more about PM_SetAnim, really ... Link to comment Share on other sites More sharing options...
razorace Posted December 16, 2002 Author Share Posted December 16, 2002 Thank you for the detailed PM_SetAnim analysis but you didn't answer my, but lucky I figured it out. I didn't know that some of the bg code have to be duplicated in the cgame component for them to visually work. See, I've altered the the PM_weapon to allow "quickdrawing" for after a dodge animation. This worked when I only altered it for the game side. However, my most recent attempts are trying to make attack animations play during the dodge animations (sort of like attacking during a wall walk or a side flip). It looks like it's possible since you can do it in many other situations and the fact that animations are animations. Link to comment Share on other sites More sharing options...
Wudan Posted December 16, 2002 Share Posted December 16, 2002 Well, I tried to answer your question, but that required asking you a question. So, in order for your bg_panimate changes, you had to change g_ or cg_ I'm very curious as to the nature of the solution, as we will all come across this problem eventually. I updated my page, because I know how razorace is about credit Link to comment Share on other sites More sharing options...
Jaii der Herr Posted December 16, 2002 Share Posted December 16, 2002 I think you'll have the following problem: The attack animation is a torso only animation. All normal walking animations are legs only. The doge anims and others are used as TORSO or BOTH animations that is why there is the posibility that playing atack anims during a doging animation cannot work. Link to comment Share on other sites More sharing options...
Wudan Posted December 16, 2002 Share Posted December 16, 2002 As long as he properly checks his animation states during dodge and counter attack, it'll be fine. I don't think he's attacking *during* the dodge, that's not really techinically feasable. Ever see Enter the Dragon? There's a lot of fluid dodge and attack in Kung Fu. Link to comment Share on other sites More sharing options...
razorace Posted December 16, 2002 Author Share Posted December 16, 2002 I was talking attacking WHILE dodging. Herr is correct that Dodge is a BOTH animation, but running attack animations on the torso and dodge animations on the legs actually looks pretty good. I got it working yesterday but I somehow totally screwed up my code and had to go back to a very recent code backup. The solution to makes bg_ changes work is to recompile both the game and cgame files. And, yes, that PM_weapon function does actually handle the forceHandExtend animations. It just doesn't change some stuff visually unless the client has the correct cgame files. What's this about me and credit? I just feel that everyone who works on a project deserves credit based on their involvement. For example, Sid Meier's Civ 3 should only have the Sid Meier tag IF he did MOST of the work. Which he didn't. In fact, if you check the Play the World credits, he's not in there at all. Link to comment Share on other sites More sharing options...
Code Posted December 16, 2002 Share Posted December 16, 2002 ive been reading this thread a few times , great one btw from the loveandpeace example i 'test' the anims i want like this else if (Q_stricmp ( cmd, "testanim" ) == 0){ StandardSetBodyAnim(ent, BOTH_HEADNOD, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD|SETANIM_FLAG_HOLDLESS); ent->client->ps.saberMove = LS_NONE; ent->client->ps.saberBlocked = 0; ent->client->ps.saberBlocking = 0; } here its the 'no' anim fooling around i tryed BOTH_SIT2 also oh prob its the one i want but how to i 'stick' it i mean not just run the anim then restart run the anim and stay in the final position any tips/pointer ? thx Link to comment Share on other sites More sharing options...
razorace Posted December 17, 2002 Author Share Posted December 17, 2002 You gotta use the SETANIM_FLAG_HOLD flag and set the legsTimer and the torsoTimer (it's in msecs) to the time you want the animation to last. Link to comment Share on other sites More sharing options...
Code Posted December 17, 2002 Share Posted December 17, 2002 can i set it infinite ? so that i could do something like else if (Q_stricmp ( cmd, "testanim" ) == 0) { if (?not on?) { StandardSetBodyAnim(ent, BOTH_SIT2, SETANIM_FLAG_HOLD); ent->client->ps.saberMove = LS_NONE; ent->client->ps.saberBlocked = 0; ent->client->ps.saberBlocking = 0; ent->client->ps.legsTimer = ???; ent->client->ps.torsoTimer = ???; } else { undo it } } im thinking of a way ...... but hummmm, safe this is ? else if (Q_stricmp ( cmd, "testanim" ) == 0) { if (ent->client->ps.legstimer > 0) { ent->client->ps.legsTimer = 0; ent->client->ps.torsoTimer = 0; } else { StandardSetBodyAnim(ent, BOTH_SIT2, SETANIM_FLAG_HOLD); ent->client->ps.saberMove = LS_NONE; ent->client->ps.saberBlocked = 0; ent->client->ps.saberBlocking = 0; ent->client->ps.legsTimer = 100000000; ent->client->ps.torsoTimer = 100000000; } Link to comment Share on other sites More sharing options...
Code Posted December 17, 2002 Share Posted December 17, 2002 since i wanted to test all the BOTH_SOMETHING anims i created a little perl script to generate the test cmd i though this might help a test package is hosted here this zip contain the perl script and a test mod from testanim0 to testanim1090 it might not b always hosted so here is the perl script i made #!perl -w ################################# # generate the C code for anims # # u should run this from dos # ################################# use strict; #################### # edit stuff below # #################### # path to your anims.h file we gonna read it u must esc the \ so replace them by \\ my $pathtoread = "D:\\jk2\\GameData\\code\\game\\anims.h"; #################### # dont touch below # #################### my @storer = (); my $newf = 0; if (-e $pathtoread) { open (F, "$pathtoread") || die "DEAD : $!"; while (my $line = <F>) { chomp($line); push(@storer,$line); } close (F) || die "DEAD : $!"; foreach (@storer) { if (/BOTH/) { my @junk = split(/ /,$_); $junk[0] =~ tr/\t/ /; $junk[0] =~ s/\s//g; if ($junk[0] =~ /^BOTH/) { my @final = split(/,/,$junk[0]); print "Generating C for $final[0] ... "; open (FF, ">>generated_cmds.c") || die "DEAD : $!"; print FF "\n\t// "; print FF $final[0]; print FF " test cmd\n"; print FF "\telse if (Q_stricmp ( cmd, \"testanim"; print FF $newf; print FF "\" ) == 0)\n\t{\n\t\tStandardSetBodyAnim(ent, "; print FF $final[0]; print FF ", SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD|SETANIM_FLAG_HOLDLESS);\n\t\tent->client->ps.saberMove = LS_NONE;\n\t\tent->client->ps.saberBlocked = 0;\n\t\tent->client->ps.saberBlocking = 0;\n\t}\n"; close (FF) || die "DEAD : $!"; print "done\n"; $newf++; } } } print "\ndone generating generated_cmds.c\nGenerating generated_traps.c ... "; my $i = 0; open (FFF, ">generated_traps.c") || die "DEAD : $!"; print FFF "// trap_AddCommands\n"; while ($i < $newf) { print FFF "\ttrap_AddCommand (\"testanim"; print FFF $i; print FFF "\");\n"; $i++; } close (FFF) || die "DEAD : $!"; print "done"; exit; } else { print "Cannot read Animations : $pathtoread not found"; exit; } Link to comment Share on other sites More sharing options...
razorace Posted December 17, 2002 Author Share Posted December 17, 2002 Your evil Perl is unwanted here! Seriously, why use Perl? Link to comment Share on other sites More sharing options...
Code Posted December 17, 2002 Share Posted December 17, 2002 i though this might help if not for u, pass on .... Seriously, why use Perl? y not ? i did this script in less then 5min was my fastest way it generate the c code i didnt wanted to copy paste 1090 times , u do ? Link to comment Share on other sites More sharing options...
razorace Posted December 18, 2002 Author Share Posted December 18, 2002 Well, a lot of us, including me, haven't learned Perl yet. Link to comment Share on other sites More sharing options...
Jaii der Herr Posted December 18, 2002 Share Posted December 18, 2002 If i want to copy and change something I use the regular replace from MS VC++ Link to comment Share on other sites More sharing options...
razorace Posted December 18, 2002 Author Share Posted December 18, 2002 What is he trying to do anyway? Visually play each animation? You can do that in Modview to a limited degree (there's no seperatation between the animations or any animation labeling). If you want a better view, you could just whip up a command that does whatever animation you want. As for the first question about making an animation hold perminately, it's very possible. What you gotta do is make the leg/torso timers refresh as long as you still want the animation to hold (wait for a command, a time limit, a certain situation, etc) For a good example, I suggest you check out the forceHandExtend animation controls in PM_Weapon in the bg_pmove (they are near the top of the function). You'll notice that the leg/torso timers are only ever set to 1. This is due to PM_Weapon being run at or above (I'm not sure which) the speed of the leg/torso timer. Basically, the timer is being constently updated faster than the timer can run out. Otherwise, the animations would be reseting faster than they could play. Anyway, the thing you want to examine is the overall structure of the function with its concept of reupkeeping the leg/torso timers until the your exit state is reached (in this case, the forceHandExtendTime. This is actually controlled inside of WP_ForcePowersUpdate in w_force.c) I hope this helps. Razor Ace P.S. Boy, when did I become one of the knowledgable ones around here? Link to comment Share on other sites More sharing options...
Wudan Posted December 18, 2002 Share Posted December 18, 2002 What MODView are you using? Mine shows all the animation sequences with the names I need! Link to comment Share on other sites More sharing options...
razorace Posted December 18, 2002 Author Share Posted December 18, 2002 really? How? Link to comment Share on other sites More sharing options...
Wudan Posted December 19, 2002 Share Posted December 19, 2002 Well, on the left, when you open up a GLM it'll show a tree that has bones tags and sequences, and what not. If I expand sequences, it'll show me the names of all the animations. Or, if I have my window very very large (fullscreen), (and I'm in 1024x768), when the anims are playing, I can see the names all the way on the right. Hmmmm... I'll post a screenie or add this to my tutorial, if'n you think it'd help. Link to comment Share on other sites More sharing options...
razorace Posted December 19, 2002 Author Share Posted December 19, 2002 interesting. I guess I should check it out. Is there a way to hunt/search and then play only a particular animation over and over? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.