by date
HBW new demo, now we're getting somewhere
HBW new demo, now we're getting somewhere
| Name: | David Horn | |
|---|---|---|
| Date Posted: | Mar 10, 2008 | |
| Rating: | 5.0 out of 5 | |
| Public: | YES | |
| Comments: | YES | |
| RSS Feed: | or Subscribe with . | |
| Profile Page: | View profile page for David Horn |
Blog post
Well things are starting to shape up a little.

I've had a couple issues, but thanks to the great members of this community, I was able to tweak the code enough to get a lot of wins this past month.
One major one was the fact that Torque does not have any kind of animation-based movement. In other words when someone animates, it actually affects the position and rotation.
Enter getNodeTransform. The savior for HBW.
www.garagegames.com/mg/forums/result.thread.php?qt=24275
What Ramen-sama has done is given the ability to get the transform of a particular node within a DTS. When I call my animate function, I pass a parameter called abm (animation-based movement). If that's set to 1, then when AniDone gets called (after any animation concludes), I get the transform of that node and then set the Transform of the AIPlayer to that and bingo, animation-based movement.

Now that's only done for position. Rotation is a little different. Rotation is set per move. I ran into some issues trying to set rotation due to the fact that the editor is in degrees and Torque is in radians.
So I created a function in script to rotate an object. Hopefully it's useful to some people.
%wrestid is the id of the object to be rotated.
%deg is the rotation in degrees that you want to rotate the object.
I also was able to use the getNodeTransform to keep the wrestler within the ropes during a grapple move. I check the node and slide the wrestlers over. I still have to implement that on the "fallback" animation.
So here is the tech demo of the project thus far. We definitely have the start of a fighting engine.
http://www.homebrewwrestling.com/HBWTech_3_9.zip
"arrows" move you around, "a" performs a strike, holding "a" down performs a kick, "s" performs a grapple. Grappling normally allows you to use light moves. Grappling a dizzy opponent performs heavy grapple moves. I only have 2 moves so far.
So to perform a bodyslam...
Grapple an opponent by moving towards him and hitting "s" on the keyboard. Move the player around if you want. Then hit "s" again to bodyslam him.

To perform a suplex...
Get the player dizzy by kicking him 1 time or striking him 3 times. Grapple him opponent by moving towards him and hitting "s" on the keyboard. Move the player around if you want. Then hit "s" again to suplex him.

Please have fun and any comments are appreciated.
God bless
...til next time

I've had a couple issues, but thanks to the great members of this community, I was able to tweak the code enough to get a lot of wins this past month.
One major one was the fact that Torque does not have any kind of animation-based movement. In other words when someone animates, it actually affects the position and rotation.
Enter getNodeTransform. The savior for HBW.
www.garagegames.com/mg/forums/result.thread.php?qt=24275
What Ramen-sama has done is given the ability to get the transform of a particular node within a DTS. When I call my animate function, I pass a parameter called abm (animation-based movement). If that's set to 1, then when AniDone gets called (after any animation concludes), I get the transform of that node and then set the Transform of the AIPlayer to that and bingo, animation-based movement.

Now that's only done for position. Rotation is a little different. Rotation is set per move. I ran into some issues trying to set rotation due to the fact that the editor is in degrees and Torque is in radians.
So I created a function in script to rotate an object. Hopefully it's useful to some people.
function rotateMe(%wrestid, %deg){
%xfrm = %wrestid.getTransform();
%lx = getword(%xfrm,0); // first, get the current transform values
%ly = getword(%xfrm,1);
%lz = getword(%xfrm,2);
%rx = getword(%xfrm,3);
%ry = getword(%xfrm,4);
%rz = getword(%xfrm,5);
%rd = getword(%xfrm,6);
echo(%rz @ " " @ %rd);
//convert to degrees
%rd = mRadToDeg(%rd);
if (%rz < 0){%rd = 360 - %rd;}
//apply rotation
%rd += %deg;
if (%rd > 360){%rd -= 360;}
%rz = 1;
//convert to torque
//echo("here: " @ %rd);
if (%rd > 239){
%rz = -1;
%rd = 360 - %rd;
}
%rd = mDegToRad(%rd);
%wrestid.setTransform(%lx SPC %ly SPC %lz SPC %rx SPC %ry SPC %rz SPC %rd);
schedule(10,0,scaleme, %wrestid);
}%wrestid is the id of the object to be rotated.
%deg is the rotation in degrees that you want to rotate the object.
I also was able to use the getNodeTransform to keep the wrestler within the ropes during a grapple move. I check the node and slide the wrestlers over. I still have to implement that on the "fallback" animation.
So here is the tech demo of the project thus far. We definitely have the start of a fighting engine.
http://www.homebrewwrestling.com/HBWTech_3_9.zip
"arrows" move you around, "a" performs a strike, holding "a" down performs a kick, "s" performs a grapple. Grappling normally allows you to use light moves. Grappling a dizzy opponent performs heavy grapple moves. I only have 2 moves so far.
So to perform a bodyslam...
Grapple an opponent by moving towards him and hitting "s" on the keyboard. Move the player around if you want. Then hit "s" again to bodyslam him.

To perform a suplex...
Get the player dizzy by kicking him 1 time or striking him 3 times. Grapple him opponent by moving towards him and hitting "s" on the keyboard. Move the player around if you want. Then hit "s" again to suplex him.

Please have fun and any comments are appreciated.
God bless
...til next time
Recent Blog Posts
| List: | 11/03/08 - Homebrew Wrestling Official Demo 07/31/08 - Homebrew Wrestling - gameplay video and pics 05/19/08 - Homebrew Wrestling - first gameplay video 03/10/08 - HBW new demo, now we're getting somewhere 02/08/08 - Homebrew Wrestling - 1 step forward, 5 back 01/08/08 - Homebrew Wrestling Tech Demo 12/06/07 - The start of the Arena 12/02/07 - Homebrew Wrestling intro |
|---|
Submit your own resources!| J.C. Smith (Mar 10, 2008 at 14:45 GMT) |
| Scott Burns (Mar 10, 2008 at 15:02 GMT) Resource Rating: 5 |
I found this in the console log:
Quote:
Object 'PlayerBody' is not a member of the 'GameBaseData' data block class
game/server/game.cs (126): Register object failed for object (null) of class Player.
Set::add: Object "0" doesn't exist
game/server/game.cs (130): Unable to find object: '0' attempting to call function 'setTransform'
game/server/game.cs (131): Unable to find object: '0' attempting to call function 'setShapeName'
game/server/game.cs (134): Unable to find object: '0' attempting to call function 'getEyeTransform'
--------- woooooooooooooooooooooo game stuff started ---------
Object 'PlayerBody' is not a member of the 'GameBaseData' data block class
game/server/game.cs (152): Register object failed for object ctarget of class AIPlayer.
I dug around in the scripts and it seems like the player customization isn't loading a default player, so a null player is trying to be created.
I also saw references to ctarget having problems in the log. I noticed in the scripts that you've named a camera and the AIPlayer both ctarget. I don't know if this was by design or accident, but that will probably cause problems down the line, if it isn't already.
| David Horn (Mar 10, 2008 at 15:10 GMT) |
*edit - ha... deleted a file. Never good.
The link to the tech demo has been updated.
Edited on Mar 10, 2008 15:22 GMT
| Scott Burns (Mar 10, 2008 at 17:18 GMT) Resource Rating: 5 |
I just played with it and it's working for me now. Looks excellent!
| Jondo (Mar 10, 2008 at 19:37 GMT) |
DL'ing the demo now, looking forward to checking this out.
Jondo
| Ross Pawley (Mar 10, 2008 at 20:33 GMT) |
| Daniel Eden (Mar 10, 2008 at 21:36 GMT) |
| DreamPharaoh (Mar 11, 2008 at 01:31 GMT) |
| Robert Gascow (Mar 12, 2008 at 09:37 GMT) Resource Rating: 5 |
P.S. Let's make M.Dickie step his game up, and help bring him over to torque. NO Mercy Killer.
| David Horn (Mar 12, 2008 at 12:17 GMT) |
@Dream, Scott - thanks!
@Daniel - I did look into modifying the Death sequences so that all sequences would act as such. It's just that this solution worked quicker than that one.
@Ross - Thanks man... hopefully I haven't been a pain in the forums. :) I really try to do the research as much as i can before i post.
| Robert Gascow (Mar 17, 2008 at 04:42 GMT) Resource Rating: 5 |
You must be a member and be logged in to either append comments or rate this resource.


5.0 out of 5


