Game Development Community

Melee port

by Skylar Kelty · in Torque Game Engine Advanced · 06/15/2008 (11:11 am) · 101 replies

This is a tgea 1.7.0 port of this

It compiles.... I havnt the time to test it though, please let me know

click me

Hope it works!

1.7.1 comin when i have the time to download it
#21
10/20/2008 (9:00 pm)
Hi I'm not a programmer but I really wana try this. I've been trying to recomplie TGEA 1.7 with the simple melee system into the solution, but I'm not sure were the

modified: player.cpp
shapeBase.cpp
shapeImage.cpp
player.h
shapeBase.h

were they should go. i tryed added all 5 of these using "existing file" &/or "new file" to import them in & i expected a prompt to pop up saying "are you sure you want to overwrite exisiting file" or something. I have had no success recomplieing TGEA. what am i doing wrong?

I'm using the TGEA 1.7.1, C++ IDE & compiler - MS Visual Studio 2008 Express Edition
#22
11/06/2008 (6:45 pm)
Just an FYI - the RAR file from Timothy Castagna is missing the shapeimage.cpp file that contains the UpdateImageRaycastDamage() function - just get it from the James Thompson's file at the very top.
#23
11/07/2008 (2:56 pm)
I had a problem after integrating this into TGEA + AFX - once the attack animation started, it would get locked in the middle, and then the player would sit and vibrate while trying to update to the next position. I'm not sure if there is something special in my codebase that causes this, but in case anyone else runs into the issue, it is an easy fix. At the top of the updateLookAnimation function, check to see if you are playing the attack thread, and exit:


void Player::updateLookAnimation(F32 dT)
{
if (mArmThreadPlayOnce) return; // Don't update the look animation if we are playing an attack animation
#24
12/16/2008 (11:55 am)
Hey everybody.
sry to ask such a noob question but i didnt see an answer to this question. I wana keep a very detailed list of the changes to code & i was wondering what are the numbers for the lines of the code that were changed for this resource. that way i can comment them in the file itself from start to end with a keyword so i can just search the keyword. In case I need to look through the code for errors & such. dose someone know?
#25
12/16/2008 (2:06 pm)
Windiff is your best friend
#26
12/16/2008 (5:51 pm)
Uhh.... what is "Windiff"?

do you mean the WinDiff comparision program?
#27
12/16/2008 (6:18 pm)
Quote:Windiff is your best friend
It's a great tool if you want to find the differences between any two codebases. From there it would be a simple matter to add in your "hey I made a change here" comments to your working code. It's far better than a list of line numbers, which isn't really all that helpful because over time some lines will be removed and some others added thus messing up the line count. Another problem is from where do you count successive line numbers from - from the beginning before any additions or incremented with each addition.
#28
12/16/2008 (6:27 pm)
Sweet thankyou I downloaded it just now. this will be very helpful thankyou again :)
#29
12/17/2008 (9:27 pm)
Thanks, i just downloaded it too :D trying it out now
#30
01/02/2009 (9:14 am)
Greets all...

Trying to port this to TGEA 1.8 this morning, I received this compile error, which xCode has pointed to line 404 - 409 of player.h

../../../../engine/source/T3D/player.h:404: error: expected identifier before string constant
../../../../engine/source/T3D/player.h:404: error: expected ',' or '...' before string constant
../../../../engine/source/T3D/player.h:404: error: 'static bool Player::cPlayersetArmPlayOnce(Player*, S32, const char**)' and 'static bool Player::cPlayersetArmPlayOnce(Player*, S32, const char**)' cannot be overloaded
../../../../engine/source/T3D/player.h:409: error: expected identifier before string constant
../../../../engine/source/T3D/player.h:409: error: expected ',' or '...' before string constant
../../../../engine/source/T3D/player.h:409: error: 'static bool Player::cPlayersetArmTransitionOnce(Player*, S32, const char**)' and 'static bool Player::cPlayersetArmTransitionOnce(Player*, S32, const char**)' cannot be overloaded
../../../../engine/source/T3D/player.h:406: error: 'class Player' has no member named 'setArmThreadPlayOnce'
../../../../engine/source/T3D/player.h:411: error: 'class Player' has no member named 'setArmThreadTransitionOnce'
/Users/GilMorales/Desktop/TorqueGameEngineAdvancedSDK-Mac-1-8-0/GameExamples/Stronghold/buildFiles/Xcode/../../../../engine/source/T3D/player.cpp:897: error: 'mArmThreadPlayOnce' was not declared in this scope
/Users/GilMorales/Desktop/TorqueGameEngineAdvancedSDK-Mac-1-8-0/GameExamples/Stronghold/buildFiles/Xcode/../../../../engine/source/T3D/player.cpp:1509: error: 'mArmThreadPlayOnce' was not declared in this scope
/Users/GilMorales/Desktop/TorqueGameEngineAdvancedSDK-Mac-1-8-0/GameExamples/Stronghold/buildFiles/Xcode/../../../../engine/source/T3D/player.cpp:2009: error: 'mArmThreadPlayOnce' was not declared in this scope


What am I missing to get this working in 1.8?

Thanks in advance, gibby
#31
01/02/2009 (9:32 am)
Have you made modifications to player.h?
#32
01/02/2009 (9:53 am)
Yes, I did a diff and added the // SphyxGames -> Melee code to the stock player.h

Thanks...
#33
01/02/2009 (2:53 pm)
Lots of changes for 18 it seems that mac stuff is a big pain
#34
01/27/2009 (1:00 pm)
Im getting errors adding this resource to tgea afx 1.7.1. Im using WinDff and trying to merge the //SphyxGames sections of shapeImage.cc into shapeimage.cpp.
Here is my compile error code:

Error 1 error C2665: 'Con::executef' : none of the 21 overloads could convert all the argument types d:\AFX_TGEA171\engine\source\T3D\shapeImage.cpp 1000

Error 2 error C2665: 'Con::executef' : none of the 21 overloads could convert all the argument types d:\AFX_TGEA171\engine\source\T3D\shapeImage.cpp 1980


which is this code:

void ShapeBase::scriptCallback(U32 imageSlot,const char* function)
{
MountedImage& image = mMountedImageList[imageSlot];
char buff1[32];
dSprintf(buff1,sizeof(buff1),"%d",imageSlot);
Con::executef(image.dataBlock,3,function,scriptThis(),buff1);// error
}

and here:

// call the script function!
Con::executef(image.dataBlock,5,"onImageIntersect",scriptThis //error(),buff1,buff2,buff3);

}
// SphyxGames <- Melee//

#35
01/27/2009 (1:22 pm)
Con::executef(image.dataBlock,3,function,scriptThis(),buff1);// error
Change to...
Con::executef(image.dataBlock,function,scriptThis(),buff1);// error
Notice the 3 is gone. Remove the 5 in your other problem line...

#36
01/27/2009 (2:20 pm)
Erik, thanks for the quick reply that seems to have done the trick.
#37
01/28/2009 (5:26 pm)
How do you get the sword in game? Are you supposed to copy the cs files from the TGE version and the sword dts model and texture? I tried copying the files over but that messed up the game to where it would stop at loading objects and then stays that way.
#38
03/04/2009 (2:51 am)
I'm trying to add the melee to my project (Fresh install TGEA 1.8.1) but I have got 2 errors when doing a rebuild solution.

12>..........enginesourceT3Dplayer.cpp(1512) : warning C4305: '-=' : truncation from 'double' to 'F32'
12>..........enginesourceT3Dplayer.cpp(1517) : warning C4305: '-=' : truncation from 'double' to 'F32'
12>..........enginesourceT3Dplayer.cpp(2259) : error C2039: 'shape' : is not a member of 'PlayerData'
12>        d:TorqueTGEA_1_8_1enginesourceT3D/player.h(25) : see declaration of 'PlayerData'
12>..........enginesourceT3Dplayer.cpp(2259) : error C2227: left of '->findSequence' must point to class/struct/union/generic type

I used a file compare program to make sure I was only adding the melee resource and nothing else. It seems to have something to do with this code.

player.cpp
// SphyxGames Melee
      //F32 y = move->yaw;
      //if (y > M_PI_F)
      //   y -= M_2PI_F;

	  F32 y;
      if (mArmThreadPlayOnce)
      {
         //The divisor will increase or decrease the turning rate...
         y = move->yaw/6.28f;
         if (y > M_PI) y -= M_2PI;
      }
      else
      {
         y = move->yaw;
         if (y > M_PI) y -= M_2PI;
      }

// Melee

S32 seq = mDataBlock->shape->findSequence("h1stun");
#39
03/04/2009 (6:32 am)
You can get the shape this way:

S32 seq = mShapeInstance->getShape()->findSequence("h1stun");
#40
03/04/2009 (2:53 pm)
12>..\..\..\..\..\engine\source\T3D\player.cpp(2265) : error C2065: 'seq' : undeclared identifier

mShapeInstance->transitionToSequence(mArmAnimation.thread, seq, pos, time, true);

And there is still something wrong with this code

12>..\..\..\..\..\engine\source\T3D\player.cpp(1512) : warning C4305: '-=' : truncation from 'double' to 'F32'
12>..\..\..\..\..\engine\source\T3D\player.cpp(1517) : warning C4305: '-=' : truncation from 'double' to 'F32'

F32 y;
      if (mArmThreadPlayOnce)
      {
         //The divisor will increase or decrease the turning rate...
         y = move->yaw/6.28f;
         if (y > M_PI) y -= M_2PI;
      }
      else
      {
         y = move->yaw;
         if (y > M_PI) y -= M_2PI;
      }