Jump to content

I can't control Head and Look animations


noemen

Recommended Posts

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

@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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

@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.


PastHugeJunebug-size_restricted.gif


I'm unequipping my Trollslayer+2 Greatsword now...

Link to comment
Share on other sites

@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.

Link to comment
Share on other sites

Estagio.png


The game starts with the dummy in stage 1, but if I call the Fire button, the dummy will go to stage 2 and then shoot the shooter (When you shoot or shoot, you will go back to stage 1). And I open the Iron Singht button or doll will go to stage 2 and will be waiting for the firing command (although I am still pressing the aim button).




In GTA5 you don't have to look at how the camera is positioned, but rather an animation. See what the doll starts with empty hands (not in inventory slot 1) ...

When you have a weapon it is not in stage 1 (previous drawing), but when you shoot or you aim it goes to stage 2.

Another nice thing is that when you ride a vehicle you can also change the "hands on vehicle" stage to the "gun aimed and ready to shoot" stage. Try to imagine that we are in the Old West,

where there are no vehicles are horses and cars ... Now imagine that I am sailing a horse; there will come an opportunity that I tried to shoot at the enemy (I'm still on the horse, galloping ...),

I'd draw a gun and shoot the bad guy.


In short, this is a very important step ... My game will be a time when vehicles are cars and horses. If you put this in view, when I put the same system in a vehicle it will be much easier.

Edited by noemen
Link to comment
Share on other sites

Yes that should be easy, most of it is already in the engine as I said, the difference with my Iron Sight implementation is just, that I don't have a proper third person iron sight animation, since I was too lazy to make one and that you can shoot without aiming in my game, so all you need to do is to make a third person iron sight animation and make it so you cannot shoot when not in iron sight aim mode and finally that if you attempt to shoot, then it will automatically switch to iron sight mode.

Link to comment
Share on other sites

Yes that should be easy, most of it is already in the engine as I said, the difference with my Iron Sight implementation is just, that I don't have a proper third person iron sight animation, since I was too lazy to make one and that you can shoot without aiming in my game, so all you need to do is to make a third person iron sight animation and make it so you cannot shoot when not in iron sight aim mode and finally that if you attempt to shoot, then it will automatically switch to iron sight mode.

 

I will use the Look animation in iron sights. Since Torque3D is already started in Look mode ... I'm trying to put Look as an animation that needs to be called to start (as you see in GTA5, I need to shoot (or aim) for Look and Head be enabled). I can't implement this using TS, so I'm asking for help.

Link to comment
Share on other sites

You are thinking too complicated, what you start with is creating a playermodel and animations where he is not holding any weapons.


Then you mount a weapon and when holding a weapon you can give the player a different set of animations or just leave the animations like in the stage without weapons and just mount the gun to the hand.


Then when pressing aim mode you will mount a different weapon image that will have aim animatoins.


Just look at this:

https://github.com/GarageGames/Torque3D/blob/development/Templates/Full/game/art/shapes/actors/Soldier/soldier_rigged.cs#L36


You can see that each weapon has its own set of animations and if you test it out ingame, you will see that the player will have different animations depending what weapon you are holding.


The only difference to what you want is that there is no set of animations where the player is not holding a weapon, this is what you need to add.

Link to comment
Share on other sites

Looks like Duion has got you set in the right direction here, @noemen


The problem is that when a newcomer is looking at all of this it can be a tad bit overwhelming trying to decipher how the imageStateAnimations work. In the case of noemen, I do believe he might benefit from a step by step guide on this precise topic. I've got some things going on with my family right now(it is the weekend after all), but when I get back on here later I intend to do exactly that for him. It's been done in the past for me around other topics and I empathize with him. Sometimes pointing someone at the relevant information just isn't quite enough.


Although from the outside looking in it might appear to be 'too much investment of your personal time' to help that person...when it's all said and done, the easier we can all make it for any person to meet their full potential using Torque the more approachable our engine becomes. Not to mention we can reference this topic again later if it comes up again. Cheers, I'll be on here later to check on progress and offer what assistance I can!

Link to comment
Share on other sites

Well this is just a combination of language barrier and difficult to understand state machine system.


He is probably working with or looking at the default soldier, but this is not a good thing to start with, it is too high quality visually and regarding animations etc. This leads to people not understanding the basics. In a normal shooter you are always holding a weapon, so there is no animation for not holding a weapon.


I'm still suggesting to remove the default soldier and force people to build their character from the ground up, since then people would start with what noemen wanted, a character not holding or aiming a weapon, then they would have to add a weapon and add an aim animation and they would already be almost there what he wants as final result.

Link to comment
Share on other sites

Well this is just a combination of language barrier and difficult to understand state machine system.


He is probably working with or looking at the default soldier, but this is not a good thing to start with, it is too high quality visually and regarding animations etc. This leads to people not understanding the basics. In a normal shooter you are always holding a weapon, so there is no animation for not holding a weapon.


I'm still suggesting to remove the default soldier and force people to build their character from the ground up, since then people would start with what noemen wanted, a character not holding or aiming a weapon, then they would have to add a weapon and add an aim animation and they would already be almost there what he wants as final result.

 

I think that you're onto something here, Duion. I don't agree that we should force people to build a new character from the ground up, because some sort of example should be included for newcomers. Also, depending on someone's level of experience it is highly likely they might be able to follow the code but not the animation process or vice versa. What I DO think that we should do is replace that default soldier with something more approachable. Let's just squash that so it's not an issue any longer.


I am going to take the initiative here and provide a replacement soldier and tutorial for all of this. I am going to encourage any community member to help out if they have input. This is in no way an attempt to hijack your thread @noemen , but what I think we'll end up with here is an alternative to the existing messy introduction to player objects currently in Torque.


Forum Etiquette

Speaking of threads, this thread is in the wrong subforum here on the boards to begin with and when I piece together this information(hopefully all this weekend) I am going to start a new thread in the appropriate subforum and link to it here. For future questions, noemen, please be aware that forum etiquette(behavior) goes a long way to helping your issues be seen and dealt with in the correct manner. For example, this issue I've noticed you've posted up in a few different places here on the boards trying to get it looked at. In the future I'd encourage you to put up your thread(in the correct section of the boards) and use just that thread for help. Eventually someone should be able to help.


With that, I'm off to get ahold of the relevant links and information so that I can start up that 'New Community Soldier' idea here for us all to share.

Link to comment
Share on other sites

I will follow your advice. And I also believe that many people (in the future) will be able to look at this topic and be able to understand a little how things work. I'm learning a lot from both of you ... I just have to thank you!

I analyzed how the other companies make their games and saw that they start first with character building and their settings (animation, gameplay and so on), then make the terrain and world. I already have my work scenario ... now I will take your advice and model a new character.


Meu_trabalho2.png


Meu_trabalho.png

Link to comment
Share on other sites

I planned to supply a new default character as well, but then realized that we would have to decide on a standard first how to do the character, since there are many ways you can do things and of course making a proper character is a lot of work.


However I found that Makehuman works just fine, most of the work is doing the implementation and optimization from there.


@noemen

I suggest you throwing that default soldier overboard and download makehuman and make your own character.


http://www.makehumancommunity.org/


Then you try to export it to Torque3D and replace the default Soldier with it. This is very complicated and frustrating, so you need to do it step by step. Maybe make a new thread then I can give advice in case you get stuck. I wanted to make a tutorial long time ago, but I never finished my character so I never got to it.

Link to comment
Share on other sites

Keep trying what Duion is suggesting, noemen. It's definitely not going to be bad for you to get a grip on that process. Be sure you're having fun with it! In the meantime I am behind the scenes trying to get a completely new workflow idea and tutorial ready, one that won't require any sort of initial creation just a way to use what's out there and hook it into Torque.

Link to comment
Share on other sites

That's wonderful news, noemen! I feel very strongly about this topic of helping newcomers because I have clawed my way up through the lack of information around some of this stuff myself. Not that it's not all out there, but there is such a different viewpoint from those who have been working with the engine for a number of years and those who are just stumbling in trying to get it all working.


My goal is to help present this information in a new light. That's a bold statement, but somebody's gonna have to sit down and perform these mundane tasks in order to prevent this sort of frustration from occurring for others in the future. I'm going to be proactive on this front and do that.


It is widely unknown to the community here, but I have been working for a long while towards this end. I have a lot of really exciting things I want to share for everyone here, but I really was planning to drop it all when 4.0 full hit. This way I'm not introducing things that will become irrelevant with its release. I feel 4.0 is at a good place, and it is Christmas time after all, so I'm going to take a more prominent stance trying to share some materials I've been silently constructing in the background. Anyways, have fun man, it's only gonna get better!

Link to comment
Share on other sites

Hey @noemen ! We hadn't forgotten about you, quite the contrary! Duion has started a topic here about all this, where we're discussing this new tutorial presently:


https://forums.torque3d.org/viewtopic.php?f=18&t=1739


edited to add: I've sent a PM to @noemen apologizing for him having to see all that on the boards and inviting him to engage with me there while I am working on this new tutorial. Cheers!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...