Game Development Community

Swapping animation sequences

by Nathaniel Plane · in Artist Corner · 08/17/2007 (10:41 pm) · 12 replies

Silly question, say i want to swap the animation sequences for run and back, how would i accomplish this? At first glance it seems that just changing the sequence in the player.cs file would work?

sequence1 = "./player_forward.dsq run";
sequence2 = "./player_back.dsq back";

to

sequence1 = "./player_back.dsq back";
sequence2 = "./player_forward.dsq run";

Nada. Also tried changing the alias on the sequence, which works in showtool but not the game (game uses hard coded sequences right, so this would be useless, tried anyway heh).. Thanks!

#1
08/18/2007 (2:11 am)
Have you tried both? Changing the sequence and the alias?
#2
08/18/2007 (8:23 am)
Yeah, i've tried that also. the best i can get (best is relative here) is for one animation sequence to just not play, basically when i break it =)
#3
08/18/2007 (8:36 am)
I dont have any clue about .dsq or anything, since I havent dont much programming, but should the words back and run be after .dsq in both those?
#4
08/18/2007 (9:54 am)
Well, im a total loss now, the only thing i can think of is that the dts or the dsq actually contain some key that is prohibiting me from doing this.. my theory really comes after i test the following 2 scenarios..


1. I changed the player.cs to look like below

datablock TSShapeConstructor(PlayerDts)
{
baseShape = "./player.dts";
sequence0 = "./player_root.dsq root";
sequence1 = "./player_side.dsq run";
sequence2 = "./player_back.dsq back";
};

basically this is just saying that, hey use the player_side.dsq for the run animation...

result: forward/run animation, nothing, backpedal fine, side animation fine (Wtf i thought!).


2. Okay, a little confused by the last scenario i try something a little more hacky... i rename the forward animation to a temp name and rename player_side.dsq to player_forward.dsq, then i change the player.cs to look like the following..

datablock TSShapeConstructor(PlayerDts)
{
baseShape = "./player.dts";
sequence0 = "./player_root.dsq root";
sequence1 = "./player_forward.dsq run";
sequence2 = "./player_back.dsq back";
};

basically as it ships minus all the stuff i dont wanna test (throws warnings and stuff yes i know, not the point)..

result: forward/run animation, nothing, backpedal fine, side animation fine (DOUBLE WTF!)


conclusion... there has to be something embedded in the actual dsq file that is identifying the animation sequence. thats fine and all (although sucks when using already compiled resources).. but then why have the animation sequences laid out in a seperate file that has no effect whatsoever? Maybe the root animations have to be like that for some reason, but still.. why the special cases, why hide it and duplicate its presence in the player.cs? Just seems dirty.

I could be wrong, i hope i am =)
#5
08/18/2007 (10:48 am)
Nathaniel,

I tried this for the heck of it, because what you described seemed like it should work. It did for me... here's what I did:

I left the 2 sequences exactly where they were on the list. I only changed the name after the dsq. So I left run where it was (seq 4):

sequence4 = "./Animations/player_run.dsq run";

but changed it to:

sequence4 = "./Animations/player_run.dsq crouchforward";

Then I changed crouchforward, but left it where it was (seq 39):

sequence39 = "./Animations/player_crouchforward.dsq crouchforward";

changed to:

sequence39 = "./Animations/player_crouchforward.dsq run";

The only other thing I did that you didn't mention was delete the DSO.

Hope this helps,

Jondo
#6
08/18/2007 (2:46 pm)
Jondo,

Thanks for the reply.... i took your approach, instead of working w/ the run/back inclusively i swapped them with sequences like the death frames you mentioned.. that worked (yay!). for some reason swapping the forward and back doesnt work well.. perhaps this is because of how the animations are handled in pickActionAnimation. More research necessary on my end!

Thanks very much for helping out, i was going absolutely bananas.
#7
08/18/2007 (4:56 pm)
Well I was bored....so I checked out swapping the alias for forward and back. I left the sequence order the same... this worked no prob.

Forward and back can be hard to tell apart, since back is often just a reverse of the forward cycle.

Anyways it worked fine, so I think just leave your seq order alone but change the alias' as needed. Probably want to make sure if you swap something for run that its also cyclical...
#8
08/18/2007 (5:06 pm)
Hmm, what version are you running? Im running an unmodified version of 1.5.2 (only change is what ive been doing to player.cs).. below is my full file.. player is definetly running forward and skipping back still (forward he drops shoulders, pretty easy to tell)...

//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------

datablock TSShapeConstructor(PlayerDts)
{
baseShape = "./player.dts";
sequence0 = "./player_root.dsq root";
sequence1 = "./player_forward.dsq back";
sequence2 = "./player_back.dsq run";
sequence3 = "./player_side.dsq side";
sequence4 = "./player_lookde.dsq look";
sequence5 = "./player_head.dsq head";
sequence6 = "./player_fall.dsq fall";
sequence7 = "./player_land.dsq land";
sequence8 = "./player_jump.dsq jump";
sequence9 = "./player_diehead.dsq death1";
sequence10 = "./player_diechest.dsq death2";
sequence11 = "./player_dieback.dsq death3";
sequence12 = "./player_diesidelf.dsq death4";
sequence13 = "./player_diesidert.dsq death5";
sequence14 = "./player_dieleglf.dsq death6";
sequence15 = "./player_dielegrt.dsq death7";
sequence16 = "./player_dieslump.dsq death8";
sequence17 = "./player_dieknees.dsq death9";
sequence18 = "./player_dieforward.dsq death10";
sequence19 = "./player_diespin.dsq death11";
sequence20 = "./player_looksn.dsq looksn";
sequence21 = "./player_lookms.dsq lookms";
sequence22 = "./player_scoutroot.dsq scoutroot";
sequence23 = "./player_headside.dsq headside";
sequence24 = "./player_recoilde.dsq light_recoil";
sequence25 = "./player_sitting.dsq sitting";
sequence26 = "./player_celsalute.dsq celsalute";
sequence27 = "./player_celwave.dsq celwave";
sequence28 = "./player_standjump.dsq standjump";
sequence29 = "./player_looknw.dsq looknw";
};
#9
08/18/2007 (7:07 pm)
I was testing it in ruin which is tge 1.5.1/1.5.2 somewhere in between... but we call the anims in a stock way. I just went to a tge 1.5.1 demo I had handy and did the following, used player_side.dsq as the main run so this was easy to test:

before:

datablock TSShapeConstructor(PlayerDts)
{
baseShape = "./player.dts";
sequence0 = "./player_root.dsq root";
sequence1 = "./player_look.dsq look";
sequence2 = "./player_head.dsq head";
sequence3 = "./player_headside.dsq headside";
sequence4 = "./player_run.dsq run";
sequence5 = "./player_back.dsq back";
sequence6 = "./player_side.dsq side";

test:

datablock TSShapeConstructor(PlayerDts)
{
baseShape = "./player.dts";
sequence0 = "./player_root.dsq root";
sequence1 = "./player_look.dsq look";
sequence2 = "./player_head.dsq head";
sequence3 = "./player_headside.dsq headside";
sequence4 = "./player_run.dsq side";****
sequence5 = "./player_back.dsq back";
sequence6 = "./player_side.dsq run"; ****

It worked fine. Try it with side as your run for a test maybe? You using stock torque orc? (I'm using the genesis char pack but they are so stock-based they drag and drop into the demo).
#10
08/18/2007 (7:19 pm)
Based on your last post, it should be working. Now I want to find a stock demo and try with kork to be sure... You definitely deleted your DSO? lol

Edit: Meh, that didn't go well in stock torque 1.5.1 demo with Kork. I got mixed results, none of which were good, and yeah the forward really seemed hard coded no matter what I did (tried just swappin alias's, then renamed the dsq file names but kept in mind the actual internal name, made sure that it matched the alias, also kept the run as seq 2 that way... still no go - no luck with Kork)... Gonna look into it further.
#11
08/29/2007 (6:40 am)
I think it's the index position of the sequences that is hardcoded...ie, that the first 10 sequences in the Constructor script MUST follow the SDK default code's order, I believe[seq0=root,seq1=look...etc]. This may have changed with new codeBase. After those first 10, then you can change the order as you wish...I'm about 90% sure, but codeBase has changed a bit since I last purchased my license[past v1.4] to drive....:)
#12
11/28/2007 (1:31 pm)
Sequence1 = "./player_forward.dsq run";
sequence2 = "./player_back.dsq back";

The actual name of the sequences...

"run" & "back" are actually inside the specific files, thats why the run works best with the "./player_forward.dsq run" and vice versa.

Looking at a file in eg. notepad -shows the actual animation name in the end of the file...