I can't control Head and Look animations

Expanding and utilizing the engine via C++.
26 posts Page 1 of 3
noemen
Posts: 100
Joined: Tue May 29, 2018 3:46 pm
 
by noemen » Thu Dec 12, 2019 6:33 am
I can't find ways in TS to start character in the way the Head and Look animations will start if they are called (when you press a button). Would I have to make changes to the source code of the engine or is there another way? Show me a way... I'm sleepless days, reading and reviewing the papers and books, but I can't find anything. An example of this implementation would be the game Mount and Blade Warband, where when selecting a weapon the character is in relaxed mode and only enters LookandHead if they are called (when tightening fire for example. Since I wish I could have the freedom to choose how these animations would be called.

I looked at the player.cpp and saw that it would be the actionLook... I also saw that there is a list of animations.
TorqueFan
Posts: 130
Joined: Thu Apr 30, 2015 5:35 am
by TorqueFan » Thu Dec 12, 2019 7:24 am
Hi @
User avatar
noemen


I apologize up front because there is a language barrier between us that makes it more difficult for me to follow what you are wanting. Based on this post and a few others I've seen on the forums here from you, I think I might understand what you want. Correct me if I'm wrong.

Are you wanting to have your player stand in idle/relaxed mode and then start aiming the weapon when you press a key? Like the player is relaxed and then you hold right-click to aim? Then left click to shoot while aiming?
Duion
Posts: 1603
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Thu Dec 12, 2019 10:58 am
You have to use what animation states there already are, otherwise if you manually set an animation it will be overridden by other animations like walk, look etc. That is why the animations are separate, like walk animation is separate from look animation and what the arms are doing is also separate and defined by the weapon you are holding.

If you look at the default soldier animations you will notice that a lot of animations are duplicated for every weapon and when holding that other weapon the walk, run, strafe etc animations are different, this is something you can use. If you then want different states of the weapon, you have to use the state machine in the weapon scripts, where you can assign an animation for each state.

Additionally for Uebergame I implemented a resource that allows you to set an animation through script, which is not possible in Torque3D by default, I use it to set the reload animation.

It is all kind of super complex so you need to specify what you really want and then find a solution through the things I mentioned.
noemen
Posts: 100
Joined: Tue May 29, 2018 3:46 pm
 
by noemen » Fri Dec 13, 2019 7:49 am
Hi @ noemen

I apologize up front because there is a language barrier between us that makes it more difficult for me to follow what you are wanting. Based on this post and a few others I've seen on the forums here from you, I think I might understand what you want. Correct me if I'm wrong.

Are you wanting to have your player stand in idle/relaxed mode and then start aiming the weapon when you press a key? Like the player is relaxed and then you hold right-click to aim? Then left click to shoot while aiming?
That's right, you understood my thinking. I see in many games has look and head as a call animation (gta, Mount&Blade...). When started the doll is with the gun relaxed (or hands) and when shaking Fire it goes to Look mode and... and shoots, but by pressing mouse 1 (aiming) he only points the gun and waits for a Fire command. I just wish I could bore this for my players. You could direct me a path... I'm just an amateur, I'm still in alpha phase. I'm learning a lot from mistakes and hits. I know the basis of c++ and I'm studying TS.
Duion
Posts: 1603
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Fri Dec 13, 2019 12:12 pm
I don't really know what you are trying to achieve here, when firing a weapon the player looks forward by default and if you look up the look animation follows where you are looking and shooting at, so to me everything is just fine here.

You probably would have to show what you have and what you are trying to achieve, since I cannot really imagine it.
TorqueFan
Posts: 130
Joined: Thu Apr 30, 2015 5:35 am
by TorqueFan » Fri Dec 13, 2019 9:28 pm
@ Duion : I believe what he's after is an 'over the shoulder' 3rd person camera that will zoom in when you hit right click to aim. Due to the language barrier, additional confusion is introduced since (I believe) he is assuming the 'look' animations will help him with this, which they won't.

@ noemen : Reminds me of myself stumbling all over the place trying to learn Torque :lol: Don't worry, it gets better, but you are going to have to be persistent and continue on your current path of self-learning awhile in order to realize your goals. You are on the right track if you continue to further your understanding of c++ and TorqueScript. One thing that's key is to be sure you still are enjoying the learning process. If it gets heavy, that's your brain's way of telling you to go out for a jog or to hang out with your friends a bit and come back to it all with a fresh mindset.

So, about getting that view you want. I believe the easiest way to achieve this is getting your hands on a build with the AAK(Action Adventure Kit) integrated. In this way, the default view is already 3rd person and by default it's right-click to zoom(over the shoulder). If we can get you to that point, it shouldn't be overly difficult to fire off an 'aim' animation when that zooming in occurs. Somewhat recently(in the last year or so I think) the AAK was released under MIT so that's good. I'm a bit busy to find the links to all of that right at the moment, but maybe by tonight I can track down some download links for AAK to get you pointed in the right direction. Cheers!
Duion
Posts: 1603
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Fri Dec 13, 2019 11:39 pm
Well the look animation is hardcoded and controls the movement of the head of the player, it is usually a few frames and just makes the head look up and down and has nothing to do with your actual view, it is just the head animation.

If he really wants third person view, this can be controlled by moving the camera, it is even enabled by default in Torque, by pressing tab you go into third person mode and the position of the camera can even be adjusted.

You can also attach the eye node in a modeling program to a bone and animate that and the eye node including where you view through will follow the animation. I have a death animation where the player falls on his back and the first person camera follows the fall, so in first person you can see yourself falling to the ground.

So there is not even much you need to do as the eye point will automatically follow your animations, so all you need to do is animate properly.
noemen
Posts: 100
Joined: Tue May 29, 2018 3:46 pm
 
by noemen » Sat Dec 14, 2019 12:00 am
An example of this is the game GTA and Mount&Blade Warband. The GTA: Third person the doll starts with the gun downloaded (here the hands does not accompany the movement of the camera) and when predicted Fire the animation changes (here the hands accompanies the camera).

Mount&Blade: The doll starts the same way as the GTA, only when switching to the first person, these animations don't change.

Another example is the game DayZ, where in which the doll starts with his hands lowered and can only shoot if you press a button (only then the hands accompany the camera in the movement of the mouse).

I'm sorry, I'm learning English. I'm studying alone and a few words I look for in the dictionary lol.

I appreciate any help and when I succeed, I won't forget.

When I have a demo of the game, I'm going to need people to work with me.
TorqueFan
Posts: 130
Joined: Thu Apr 30, 2015 5:35 am
by TorqueFan » Sat Dec 14, 2019 12:43 am
@ Duion : Man, I already said the look animations wouldn't help him. Is it your solitary goal in life to post on here and try to prove that you know 'more' than anyone else?...because you don't. I have a default Soldier model here in my studio hooked into a full set of all animations, including climb, cover, prone, you name it. All new animations. Just because you managed to paste together all existing tutorials and code examples and call it a 'game' doesn't make you some sort of alpha or omega. Hey man, I'm not discrediting that you have a somewhat well-rounded understanding of the engine. But I am encouraging you to try and provide people with relevant information without presenting it in such a way that it comes across as you being an elitist. Your post reads more like, "Let me see if I can demonstrate my knowledge of the engine in a way that makes me look the most knowledgeable." All of what you've said I am full aware of, but noemen is not. Why speak to me then as if he isn't in the room seeking the advice?

I am attempting to help a newcomer to the engine, and you are re-stating what I already advised: look animations won't help him. Why elaborate further on this point? I see no reason to discourage him from using tools that already exist, i.e. AAK.

Here you've managed to derail this thread and discourage a healthy exchange...again. I really feel like moderation should be stricter for you, because you cast a shadow on the community.

All of what you have said is true about the nodes, but I don't appreciate being talked to as if I am unaware. Here I am, closing in on an alpha stage of a game I've been developing with Torque and just about any exchange I see occur on this forum has your name all over it...thus discouraging me from engaging here on this board with my peers.

Image

I'm unequipping my Trollslayer+2 Greatsword now...
Duion
Posts: 1603
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Sat Dec 14, 2019 1:41 am
@
User avatar
noemen

Why don't you just show a video of what you want? I played a lot of games and I still have no idea what you want, in GTA for example you have just normal third person view which can be switched to first person.

I think what you want is that when running the player holds the weapon down and only when pressing fire, he will ready the gun and point the gun into the direction he is shooting correct?

That already exists by default in Torque, but only for the sprint animation, when you are sprinting the player is not aiming the weapon, but running and you need to stop running to aim and shoot the weapon. So you need to take that code and adjust it to your needs.

If you want the aiming of the gun only available after pressing a button, you need to install a resource that allows the change of the state machine through a command like a keybind, I integrated that to trigger the reload animation in my game for example.

Or you can just use my cheap workaround by having two weaponimages, where one is held down and cannot shoot and on pressing aim button it will mount the second weapon image which looks identic but will be able to aim and shoot.
26 posts Page 1 of 3

Who is online

Users browsing this forum: No registered users and 2 guests