Server Side Melee System
by Josh Moore · 03/19/2004 (7:56 pm) · 357 comments
Download Code File
This tutorial will show you how to add a sever side melee system. The code is from Realm Wars, but it may be hard for some poeple to find everything thats needed. The tutorail is in the download. For the RW orc and sword
Enjoy.
I uplaoded the RW orc and sword to my website. Don't use the tut in the download, use the one at the top of the page.
Edit:Link doesn't work right, just post in your browser.
Sword and Player models:
http://www.freewebs.com/t2theforce/meleeTutorial.zip
The movie shows a shielded attack, an attack that hit, and a sword rebound.
Movie:
http://www.freewebs.com/t2theforce/meleeCombat.zip
The screenshot shows me blocking two attacks from some orcs with my shield.
For shields and sword rebounding, add this to your weapons.cs file.
After:
To shield a player, just set %shieldObject.shielded = 1;
This tutorial will show you how to add a sever side melee system. The code is from Realm Wars, but it may be hard for some poeple to find everything thats needed. The tutorail is in the download. For the RW orc and sword
Enjoy.
I uplaoded the RW orc and sword to my website. Don't use the tut in the download, use the one at the top of the page.
Edit:Link doesn't work right, just post in your browser.
Sword and Player models:
http://www.freewebs.com/t2theforce/meleeTutorial.zip
The movie shows a shielded attack, an attack that hit, and a sword rebound.
Movie:
http://www.freewebs.com/t2theforce/meleeCombat.zip
The screenshot shows me blocking two attacks from some orcs with my shield.
For shields and sword rebounding, add this to your weapons.cs file.
After:
if (%target.getState() !$= "Dead" && %target.getId() !$= %player.getId())
{Add:// shields and sword rebounding - JM The_Force
if(%target.shielded || %target.hthDamageSeqPlaying)
{
if(%target.hthDamageSeqPlaying)
%swordBlock = 1;
%block = 1;
// Now we see if we hit from behind...
%forwardVec = %target.getEyeVector();
%objDir2D = getWord(%forwardVec, 0) @ " " @ getWord(%forwardVec,1) @ " " @ "0";
%objPos = %target.getPosition();
%dif = VectorSub(%objPos, %player.getPosition());
%dif = getWord(%dif, 0) @ " " @ getWord(%dif, 1) @ " 0";
%dif = VectorNormalize(%dif);
%dot = VectorDot(%dif, %objDir2D);
// 120 Deg angle test...
// 1.05 == 60 degrees in radians
if (%dot >= mCos(1.05))
%block = 0;
}
if(%block == 1)
{
//error("attack blocked!!");
//%player.playAudio(0,ShieldImpactSound);
//makeSparks(%pos);
stunPlayer(%player,%attack);
pushPlayerBack(%player,%pos,%target,%attack);
if(%swordBlock == 1)
{
stunPlayer(%target,%attack);
pushPlayerBack(%target,%pos,%player,%attack);
}
return;
}To shield a player, just set %shieldObject.shielded = 1;
About the author
#2
Edit: Heres a bigger screen of an attack being blocked.
www.illumina-game.com/forum/download.php?id=83
03/19/2004 (8:51 pm)
I uploaded it, but its not there. I think it takes a few days. I was going to update with the shield code and sword rebounding, but I'll have to wait.Edit: Heres a bigger screen of an attack being blocked.
www.illumina-game.com/forum/download.php?id=83
#3
03/20/2004 (12:54 am)
Err, it doesnt even show a link, looks like you forgot something... could you plz edit the resource again or maybe upload the file to another server?
#4
03/20/2004 (5:52 am)
Please do so, I'm interested in this resource too :)
#5
03/20/2004 (8:58 am)
I reuploaded it last night, but its still not up.
#6
03/20/2004 (11:12 am)
Screenshot looks cool but like the other people have said.. theres no link or anything to download anything..
#7
I hope that works because I am looking forward to this too.
03/20/2004 (1:02 pm)
Tim Newell said in another resource that had the same problem there there is (or was) a bug regarding file uploads. His suggestion was to re-edit the resource and re-upload the file. The key might be the re-editing of the resource.I hope that works because I am looking forward to this too.
#8
Edit: Please give me some feedback on how you guys like it. I've only been able to battle bots, but the bots are good and its fun. If anyone can test this online, tell me how it goes.
03/20/2004 (4:18 pm)
Ok, I've uploaded the file to my site(I didn't even know it was still there). I've added the shield and sword rebounding as an optional addition.Edit: Please give me some feedback on how you guys like it. I've only been able to battle bots, but the bots are good and its fun. If anyone can test this online, tell me how it goes.
#9
03/20/2004 (6:50 pm)
*removed*
#10
03/21/2004 (4:25 pm)
which release are you using for the tut ? doesnt seem to work with 1.2
#11
This sounds pretty cool, but I'm unable to get at the resource. Do you need an alternate location to post this? I have space and bandwidth if you need to put this somewhere else?
[HOW]-Ed
03/21/2004 (8:55 pm)
Josh,This sounds pretty cool, but I'm unable to get at the resource. Do you need an alternate location to post this? I have space and bandwidth if you need to put this somewhere else?
[HOW]-Ed
#12
03/22/2004 (7:10 am)
Does this work with AI controlled players?
#13
Here the download loactions:
Tutorial:
http://www.freewebz.com/t2theforce/meleeTutorial.zip
Movie:
http://www.freewebz.com/t2theforce/meleeCombat.zip
@ Eric:Yes it works for AI players. Check out the movie, I'm battling a bot.
03/22/2004 (10:22 am)
@ Ed: I hosted it on my website, but you need to paste it in your browser to get to the download(freewebz doesn't like direct linking).Here the download loactions:
Tutorial:
http://www.freewebz.com/t2theforce/meleeTutorial.zip
Movie:
http://www.freewebz.com/t2theforce/meleeCombat.zip
@ Eric:Yes it works for AI players. Check out the movie, I'm battling a bot.
#14
03/22/2004 (6:15 pm)
sounds very cool, but im getting 1.14kb a sec speeds Ack! need abetter place to put it?
#15
@ Ed if you would like to host this tut on Hall Of Worlds, I can e-mail the file to you.
03/22/2004 (7:01 pm)
The free webz don't give you alot of bandwith, its the only site I have to host it.@ Ed if you would like to host this tut on Hall Of Worlds, I can e-mail the file to you.
#16
03/23/2004 (7:43 am)
Thanks, unfortunately I don't have the correct codec for the movie :(
#17
03/23/2004 (9:25 am)
I think its the Divix codec. Anyone tried this yet? I would like some feedback.
#18
03/23/2004 (3:04 pm)
i have the divx codec and it doesnt work for me either, the mele code also does not appear to work with tge 1.2
#19
03/23/2004 (3:17 pm)
I have it working on 1.2. What kind of errors are you getting?
#20
Are you using 1.2.1 for your code base?
03/23/2004 (4:29 pm)
I have divx and it the movie doesn't work.Are you using 1.2.1 for your code base?

Torque Owner John Connell