More animations and keys
by Krane · in Artist Corner · 09/17/2007 (5:02 pm) · 10 replies
I trying to add a key control ("F", for example) that, everytime I press "F", the player "salutes" or any other animation.
I'm kinda lost in this issue, any help is apreciate.
Thanks
I'm kinda lost in this issue, any help is apreciate.
Thanks
About the author
#2
09/18/2007 (7:07 pm)
I think he is. Try looking editing the player script and change the key binding to "f".
#3
09/19/2007 (9:06 am)
Yes, I am. I think to add a key function I need to add something to the default.bind.cs file. Then I need to create a function somewhere to associate w/ the dsq animation.....Just don't know where to change all this...
#4
function movefoward(%val)
{
$mvFowardAction(%val) = %val * $movementSpeed;
}
this is the function that the "w" key is calling. $mvFowardAction is probably somewhere....Where? What is $mvFowardAction? Can I create a new "$mvFowardAction"? Like $mvSaluteAction?
Thanks for the help, I'm not sure this is the right forum...
09/19/2007 (5:15 pm)
Ok, I've found this function in client/scripts/default.bind.csfunction movefoward(%val)
{
$mvFowardAction(%val) = %val * $movementSpeed;
}
this is the function that the "w" key is calling. $mvFowardAction is probably somewhere....Where? What is $mvFowardAction? Can I create a new "$mvFowardAction"? Like $mvSaluteAction?
Thanks for the help, I'm not sure this is the right forum...
#5
09/19/2007 (7:30 pm)
Ok so if your asking if you can create a binding for an action, im not so sure how yet because im having problems binding my weapons and such to keys too but i think you can go to client and then config and copy and paste the most appropriate binding for your issue anywhere and then rename the datablock or whatever to whatever your dsq is called, and then you can also change the keys to whatever you want. i guess you also need to go into client> scripts> and into default.bind and paste the same thing u just put into the config into the appropriate section of the default.bind and change the datablock name to what your dsq is and your key, make sure they are the same as the one you put in the config. im pretty sure you have to do one last thing took make the animations be part of the whatever your animating, but im not sure. im having problems doing this myself, even though i havent tried animations, but this is all i know, sorry i couldn't help much.
#6
The function I've found on default.bind.cs (line 50) is called by line 118:
moveMap.bind( keyboard, w, moveforward );
So line 118 calls the function on line 50. This function "grabs" a variable/function (not sure) called "mvFowardAction". I'd love to know where this variable/function is been declare and how it reffers to the animation (in this case "sequence1 = "./player_forward.dsq run", located in the player/player.cs)".
Any help/direction is needed. Thanks.
09/19/2007 (8:27 pm)
Thanks steely for your help, I know how to create another function. Thing is the config file you mentioned is generated at compile, i.e., it changes all the time, don't think is the right place....The function I've found on default.bind.cs (line 50) is called by line 118:
moveMap.bind( keyboard, w, moveforward );
So line 118 calls the function on line 50. This function "grabs" a variable/function (not sure) called "mvFowardAction". I'd love to know where this variable/function is been declare and how it reffers to the animation (in this case "sequence1 = "./player_forward.dsq run", located in the player/player.cs)".
Any help/direction is needed. Thanks.
#7
For example, if you want to map a key for a dance sequence, you would type something like this:
I hope this helps!
09/19/2007 (11:27 pm)
If you're looking for a way to bind an animation like a salute, scroll down to near the bottom of the default.bind.cs file to the "Misc. Player Stuff" section. This is where the key binds are for animations like waving or dancing.For example, if you want to map a key for a dance sequence, you would type something like this:
moveMap.bindCmd(keyboard, "ctrl s", "commandToServer('playCel',\"dance_animation\");", "");I hope this helps!
#8
http://tdn.garagegames.com/wiki/TorqueScript/Input/Movemap/Player
I'm using the Adam pack, which is different from this one, but very similar. I'm deleting default.bind.cs.dso and still nada. I'm using "ctrl f", as ctrl s is already in use...
09/20/2007 (11:02 am)
Thanks Ryan, but it's not working for some reason... I checked your code and seems fine. Actually, even without adding this line to the default.bind.cs, the "ctrl s" works! That makes me think that there's another place where this is being called. I've found this:http://tdn.garagegames.com/wiki/TorqueScript/Input/Movemap/Player
I'm using the Adam pack, which is different from this one, but very similar. I'm deleting default.bind.cs.dso and still nada. I'm using "ctrl f", as ctrl s is already in use...
#9
09/20/2007 (11:09 am)
You also need to delete the auto-generated config.cs and config.cs.dso any time you make changed to input event bindings.
#10
Now, another question: Why "wave"? Where is this being set? On player/player.cs I see all the animations as sequence1, etc...and there's a name at the end....none is "wave" or "salute". Where these are being set?
Thanks again guys for the help.
09/20/2007 (2:06 pm)
Thanks Stephen, that did the trick! Despite the fact that the config.cs.dso never came back...Now, another question: Why "wave"? Where is this being set? On player/player.cs I see all the animations as sequence1, etc...and there's a name at the end....none is "wave" or "salute". Where these are being set?
Thanks again guys for the help.
Torque Owner elainekb