Game Development Community

Simple Melee help

by Chris Castillo · in Game Design and Creative Issues · 02/24/2009 (6:06 am) · 3 replies

Hey guys! I just need a little help. I downloaded the code file from the Server Side Melee System by Josh Moore. I replaced my player folder with his player animations and such, but then I decided not to do it. Well earlier today I discovered that the wave function was a melee move. :D I was just wondering where the wave function is, so I can edit it. :)

#1
02/24/2009 (10:36 am)
@Chris ok well I don't know everything in fact I've only been working on learning this engine for 3 years now. I've read almost all the books hoping that one would help me better understand this stuff. I do not know the best answer to anything. I'm hoping that this will help you. It might just confuse you more. Perhaps someone else from the community can help you more if this doesn't. Anyways here is my shot at it.

Your question looks like your confused about how the system itself is designed to work.

I don't know if this is the correct answer but lets break it down first:

We have C and C++ engine code: it has its own independent functions that depending on if they are coded to be called in console can be called in script.

We have torqueScript: this has its own independent functions that can be called in script. There are tiers of this.
Server side only functions (Only called on the server)
Client side only functions (Only called on the client)
Global functions (called on either server or client)
Script Objects \w functions (created and destroyed on your whim I use these so I can create and cleanup when I do Gamecycle counters and weather changes etc.)

We have models(*.dts) and animations (either built into the model or seperate for multi model use called *.dsq files).

The wave function as you put it is simply a *.dsq file (this 'can' be used for multiple models) that creates an animation called wave based off of the models naming convention and scripted response I guess. A little emphasis on "can" because it was made for just the torque orc model using a different model could make it look very strange or not work at all.

So thats how your going to go about changing your wave function. You will create a model then you will learn model animation export those animations into *.dsq files and then load them into your game.
#2
02/25/2009 (5:20 am)
Well that's the thing. It's already different. But in the default.bind file I changed it to "f" instead of "ctrl w". I was looking for the script that called the wave animation. But thanks for all the information! :)
#3
02/26/2009 (6:52 pm)
Well First all the animations are defined in player.cs(data/shapes/player) or equiv.

sequence27 = "./player_celwave.dsq celwave"; defines the animation.

default.bind.cs contains the default keybind.

//------------------------------------------------------------------------------
// Misc. Player stuff
//------------------------------------------------------------------------------

moveMap.bindCmd(keyboard, "ctrl w", "commandToServer('playCel',\"wave\");", "");
moveMap.bindCmd(keyboard, "ctrl s", "commandToServer('playCel',\"salute\");", "");
moveMap.bindCmd(keyboard, "ctrl k", "commandToServer('suicide');", "");

When the key is pressed the server executes this command.

scriptsAndAssets\server\scripts\commands.cs

function serverCmdPlayCel(%client,%anim)
{
if (isObject(%client.player))
%client.player.playCelAnimation(%anim);
}

That fires this function
scriptsAndAssets\server\scripts\player.cs

function Player::playCelAnimation(%this,%anim)
{
if (%this.getState() !$= "Dead")
%this.setActionThread("cel"@%anim);
}


follow the trail until you see where it is changed.