Game Development Community

SetActionThread

by Berserk · in Torque Game Engine · 06/29/2005 (2:41 pm) · 24 replies

Hi everyone.
I'm proceeding with my project step by step, today I created two punch animations for adam.
Everything is OK, punch animations works and even my code used to switch from left and right punch works.
The onlt problem is, after I hit a punch, adam stills in the lastkeyframe of the punch animation until I call a new action, like moving or jumping.
I used the same trick used to play celwave and celsalute (using a commandtoserver) so I've only added code without touching anything else (ecept for mouse button 1's code, wich I changed to hit punches instead of firing).
When I play any cel sequence, adam come back to the root pose automatically, but not after a punch. Also, I noticed I can't make him hit punches while moving, and I need this feature.
In the TorqueScript chm help posted as resource I found two optional arguments wich I think can be useful for my problem, but I don't know what they mean nor what values could I use. These are: bool hold and bool fsp.

If you know something about this I may need, I'll be glad to receive input.
Thanks in advance for time and replyes.

Bye, Thc.
Page «Previous 1 2
#1
07/01/2005 (2:45 am)
Quote:Ma sbaglio o qualcuno sta facendo lo stronzettino? Ickidepiuttacavvrronesss, perche' ignorate i miei posts? Andate a scagazzare!!!
Please, translate this phrase from Italian to English with some sort of translator, because I really don't know how to write it in english...
However, stop ignoring me and my posts. What have I done wrong to get such a treatment? I always reply to help, whoever asks, if I know how to help. Why are you doing such the bastards with me? It's the second problem I get since I started my project, the first was relatively easy, but this I really can't solve alone.
Why CelWave and CelSalute returns in the root position when done, while my punch animations don't?

If you want replies to your posts, then dont be rude to the entire community.
#2
07/01/2005 (6:29 am)
A simple:
*bump* :) Anyone?

would have surficed. Not a hope in hell of getting help now
#3
07/01/2005 (7:22 am)
Check the celwave and the celsalute in show or showtool pro.
Maybe you can get a hint how they made them .
#4
07/01/2005 (7:36 am)
For starters, did Billy's thread just slip right under your radar?

Secondly, how much time have you spent researching this issue - trolling the documentation or just making experimental changes in your code and/or model to try and get an idea of what isn't working properly?

Animation is tricky in Torque, it's not the straight forward process it is in other engines because of the blending capabilities alone.

Had you considered the possibility that noone had responded to your post because noone that read it had a freaking answer?

You seriously need to chill out.
#5
07/01/2005 (9:06 am)
@Thc.03
I think everybody try to help as much as they can really!
Sometimes people need to think twice or more before they can answer the tricky questions.
I dont use setactionthreadanimation yet but it looks like the celwave is done from root and plays the wave and back to root again ,atleast what i can see in the show.
#6
07/01/2005 (10:15 am)
If you want to get the punch action while moving the player, perhaps you have to look at the setArmThread function, because setActionThread doesn't blend the animations. Also the animations must be created correctly, but here I can't help you. But sincerely to play correctly my throw animation I had to modify the engine adding a new arm thread like the one already presents in the engine.

P.S.
Non devi arrabbiarti se nessuno ti risponde, a volte la risposta non e' immediata e richiede studio da parte di chi legge il messaggio, una risposta immediata la puoi ottenere solo se qualcuno ha gia' affrontato e risolto il problema ;)
Ciao
#7
07/01/2005 (3:14 pm)
Yeah, I believe those animations[cel&death*] are coded as full body-play once to end-override all 'actions', then return to whatever was running on the Thread. ArmThreads are blended onto the current pose.
#8
07/01/2005 (4:19 pm)
Kirby, I spent 2 days (not full 24h/day) of experiments switching algorithms.
The original one (the one wich work better and also the actual one) is a clone of the servercmdplaycelanimation code and structure.
The serverCmdPlayCelAnimation structure is: default.bind.cs -> bind ctrl + w to commandtoserver(playcelanimation, wave) -> commands.cs -> if client.player exists, client.player.playcelanimation(wave) -> player.cs -> setactionthread(cel @ wave)
While mine is:
default.bind.cs -> bind mouse0 button0 to commandtoserver(playpunch, $left) -> commands.cs -> if client.player exists, client.player.playpunchlanimation($left) -> player.cs -> if($left), setactionthread(leftpunch), else, setactionthread(rightpunch)
I repeat, everything is fine except for the animation not returning to the root sequence. I'll check what the old Billy's thread is and if it helps me, if not I'll ask again, else I'll have to thank you. Maybe I need to chill out, but exiting from the "thorougly fed up with microsoft" (or something similar) and being between flames here and there has made me a bit nervous.

Thanks Billy for the suggestion, I'll also check this. In fact, I just tryed with code (realizing I could be a sucker now).

Davide, I'll check also setArmThread, thanks. (wow, there are now a bit of things to check)
Non e' che me la prendo per il fatto che non mi venga data subito risposta, me la prendo perche' nonostante io sia alquanto attivo nella comunita' sembra che io sia in secondo piano. Seriamente, hai notato quante risposte ho ricevuto dopo aver mandato affanculo qualcuno? A quanto pare qui funziona cosi, o hanno simpatia per chi chiede o li devi fare incazzare cosi ti rispondono per non essere piu' infastiditi.

Rex, I'll check, as I said to Billy. Thanks to both for the suggestion.

Again, thanks for demonstrating I'm wrong, I'm not receiving kicks in the ass but I probably asked for something too tricky. But now, at least, I have a starting point. Such a mess wasn't fully useful (but mostly)... ;-)

Bye, Thc.
#9
07/02/2005 (1:20 am)
I tryed in the showtoolPRO, but both celwave and celsalute stops at the end.
Also, I can't check between cel and root, because in AdamPack all sequences are named sequence0 (in the .max files) and theyr names are set in the player.cs that stays with the .dsq.
I tryed also in showtool-"normal", with the same result.
Now I'll try with setArmThread.

Bye, Thc.
#10
07/02/2005 (1:41 am)
If this not working checkout the melee resource that comes from rw it uses armthread to play the animations when you swing a sword or simular.
Maybe you get some clues there.
#11
07/02/2005 (1:51 am)
I've just tryed with setarmthread right now. It makes engine crash.
Thanks Billy, now I'll try if using setarmthread with melee resource can be useful (perhaps I actually need a melee fight support, so I'll cut my way doing so and if it works I'll capture 2 peasons with a pea).

I'll keep you informed.

Bye, Thc.
#12
07/04/2005 (4:13 pm)
Allright, after a couple days I figured out it. I'm really a 3D Studio MAX sucker/wannabee, because the answer was so simple.....
Unfortunately, I'm developing this demo indeed to attract team members, to have something quite good to show them that allows me to say: "saw? That's a fraction of Torque's power, we can do almost anything if we are a real team".
The members I wish to attract are 2 university students(one of wich is also a 3D graphician) , a server programmer and a DJ (my friend).
Now, the problem is: I haven't unchecked "cyclic" in a panel wich name I don't remeber.
I feel like a sad, poor dum***s.....
However, now the problem is solved: time for other problems!
I know I don't deserve any help, because I always behave as a sucker, but if somebody would help me I'll greatly appreciate, because my next problems are even stranger:
1) The punch animation works, the code in player::playpunchanimation is just:
if(%val) // The %val value is passed as playpunchanimation argument, and belongs to $left (true or false)
   %this.setactionthread("leftpunch");
else
   %this.setactionthread("rightpunch");

$left = !$left;
When I click the mouse button, the punch plays, but as soon as $left changes value, the condition is re-evaluated, resulting in an arm-change in the middle of the animation. Even using schedule the problem persists.
I tought about an isthreadplaying function or something similar, but Ireally don't know how to obtain this.
Is the getstate function documented in TorqueScript doxygen documentation suitable for this?
I tryed also to call the function binded to mouse button from console, it works perfectly. So I assume it will work if I use the keyboard, but I need the player to use the less keys possible, in order to not have him dancing on keyboard with fingers (as most games instead actually do).

2) I've also tryed to create 9 collision boxes for my player, but I can't find where in the shape hierarchy I have to place them. I named them Col-# (# = 1 up to 9). Since I was unsure (as I still am) if I need Col-# or Collision-#, I have made 9 of both.
I placed the collision meshes as follows:
1 - head and torso
2 and 3 - left and right upper arm
6 and 7 - left and right forearm
4 and 5 - left and right calf
8 and 9 - left and right tight (maybe I'm confusing tight and calf, but 4 and 5 are on the upper part of the leg)
and the hierarchy is:
1
  2 + 3
6   |    7
   4+5
  8     9
Then cloned Col-# and renamed to Collision-#, same hierarchy.
Then parented both to the Adam64 shape in adampack.max (wich has only the shape and it's parented someway with an external biped).
I need this to work because my player will have to use arms and legs, but with only the bounds shape his hands/foots are passing through interiors and probably they will do also through other shapes.
The problem is, my colission meshes aren't exported, neither col or collision. What to do?

Thanks in advance for your time and eventual replyes. Any help is greatly appreciated.

Bye, Thc.
#13
07/05/2005 (6:33 am)
Are you creating marker objects for each collision mesh?

I hang my collision meshes off the start01 sub tree. Markers for them should be higher in the hierarchy of the entire shape, in the base01 level. I have never created them for the player, though...

I thought 'player' block collisions were calculated from the bounding box data in the script??? and to get multiple 'hitboxes'/collisions?[the same] you need to change Source code?? If not, I'd love to try it out. Will certain animation s be played on a per location basis?? Is there a hardcoded naming convention to trigger code?

I've seen within the Player datablock some global variables with specific locations and wondered how those fit in.
#14
07/05/2005 (6:57 am)
There is another thread that indicates that you can only have 8 collisions.
If you have the show tool pro, it will let you see more collisions but it will not do anything with them.
#15
07/05/2005 (6:00 pm)
@ Rex:
No, I'm not. How do I name them? And with wich hierarchy?
1)
marker1
|_collision1

2)
root
|_what belongs here
.....|_marker1 -> marker 2, 3, 4 and 5 -> etc
.....|_collision1 -> collision 2, 3, 4 and 5 -> etc

As far as I know (or better, as far as I read in docs) to do precise collision detection you have to model a collision shape or more. What are you meaning talking about a "per location basis"? And about trigger code? Do you mean the triggers with definable area or triggers like $mvforwardaction and so?
If you're meaning the 2nd, there are some hard-coded conventions (such as firing/moving triggers), while other non-common actions have to be programmed, either in C++ source or in TorqueScript (TS).

@ David:
At this point, I can't figure out who's wrong. The 3S Studio MAX DTS exporter docs (wrote by a GG user) or the thread poster (wich is a GG user also). In fact, in the docs is written you can have up to 9 collision meshes (by the way, to do a good job I need at least 11 of them, one more for the head and one more for the pelvis).

Bye, Thc.

P.S.: Hope to trouble-shoot soon ;-)
P.P.S.: Hope this can be useful to others too.
#16
07/06/2005 (6:29 am)
Images are worth more than a 1000 words...:). Here's an example[albeit in gS], that shows a hierarchy that works and is fairly 'standard' for a DTS shape...naming convention is a per modeling application basis.

Per location refers to each 'collision' mesh you are intending on the player shape.

pages.sbcglobal.net/rexpiscator/_uimages/WaterTrough.jpg

...from this you can see the marker[higher up in the chain] and the actual mesh lower on the shape/mesh portion of the shape...hope this helps.

However; no bones in this shape, but I would image for a player type shape, parent the collision meshes to a Bone/Node...?? With no code change; I don't think you'll get a collision mesh animating...unless there's some special 'voodoo' with the playerDatablock that's secret.
#17
07/06/2005 (8:57 am)
So I need to manually move the collision meshes along with animations?
If so, I can create them on the biped instead of the base mesh. But you're saying that moving collision meshes can't be obtained without modifyng the source, while I believe collision detection has to be relative to my model's vertexes.
In other words, I think static collision detection would be useless and I don't think game developers would be happy with such a solution. Instead, I think there's a method to obtain CD on animated shapes, what is the multiple-collision-mesh feature use to otherwise?
By the way, I'll experiment various strategyes later and I'll let know.

Bye, Thc.
#18
07/06/2005 (10:51 am)
This may help more than trial/error...and this may also...
#19
07/06/2005 (5:28 pm)
Rex, thanks.
But hitboxes aren't what I need now, mainly because those resources (even if script-only based - wich is good) often suggests to have arms and legs mounted to the torso.
No problem by me, but if I do this way I'll need to mod the source with the weel shadow resource and I really prefer to use just script, brain and fantasy.
The problem, right now, is to make collision meshes available as in the docs. I believe TorqueScript has enough logic capabilityes, let's mod the source for graphics/physics/AI/other-strictly-technical-topics only.

By the way, my main goal now is to get collision meshes exported, I'll think about the arm-switching later.
Thanks again for your try, I really appreciated your attempt to help me, as well as all attempts.

Bye, Thc.
#20
07/10/2005 (3:22 pm)
Update:
Figuring out that with my experience level is almost impossible to hack out AdamPack, I'm using another pre-made model to solve this problem, wich has a clearer hierarchy to use and I hope to have collision meshes easyer.
So, I'm in trouble with multires and adjustlods script (comes with 3d studio max dts exporter documentation), just because when I try to export that model, the exporter says "no detail to export".
I tryed different ways to get LOD on my model, from generatemultires and adjustlod scripts, through manually applying the multires modifyer and using the adjustlod script, to trying exporting my model with fake lods.
Even if the model is very low-poly (about 900 polys in full detail) I wish to learn how to create lods for future using.

Thanks in advance everybody for eventual help.

Bye, Thc.
Page «Previous 1 2