Jump to content

Home

K.O. Instead of Death


Shao_X

Recommended Posts

Greetings,

 

A few friends and I have an idea for a small modification, though none of us know how to edit and mod. We'll need help.

 

The idea was to replace death caused by saberdamage or gundamage by unconsiousness. For you the screen goes black, and you'll see a countdown. The other people will see you lying there. When the countdown's finished, the screen will return to normal, and you will get up, with low HP and ForceP of course. So basically, when someone dies, they'll go into a lying down animation (or even the default death animations), but they won't be -dead- and have to respawn. They'll just be immobile for an X amount of time while the screen is black and they see a count down timer. Also, how could I implement a variable that allows us to change the amount of seconds someone would be K.O.'d for?

 

We hope this mod will bring more feeling of RolePlay, where people spar for practice. No one's supposed to die during training after all.

 

If there's anyone that can help us on the way, if only tell us what we must learn, we will be forever thankful.

Link to comment
Share on other sites

An interesting idea, but not one that would be very easy to do. If you want to do soemthing like this, you're going to have to learn how to code C and become familar with the SDK for JKA. You can use google to find some good C tutorials.

 

I warn you thou, this is not an easy task.

Link to comment
Share on other sites

  • 8 months later...

You need to change code in

 

G_Combat.c

 

void player_die

 

 

below

 

	if ( level.intermissiontime )
	{
		return;
	}
}

 

if you did

 

if (self && (self->s.eType == ET_NPC && self->s.NPC_class != CLASS_VEHICLE || self->s.eType != ET_NPC ) ) {

self->client->ps.forceHandExtend = HANDEXTEND_KNOCKDOWN;
self->client->ps.forceDodgeAnim = 0;
self->client->ps.forceHandExtendTime = level.time + [b][KNOCKOUT TIME IN MILI SECCONDS][/b];
self->client->ps.quickerGetup = qfalse;
return;
}

 

that should make the player simply fall over

( like JA+'s sleep )

for however mili secconds you set.

not tested it or anything, but i think it would work.

you would have to change it a little to award killpoints to ppl and stuff.

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...
  • 2 weeks later...

found somthing for ya:

 

ent->client->ps.fallingToDeath

 

set it to level.time to make the player scream and fade to black

 

you will need to find the code that kills the player once they fade to black and make it NOT kill the player on a knockout, do this by setting a genericvalue when the player is knocked out and checking it in the death-by-falling code.

Link to comment
Share on other sites

hm, just found the code you need to disable the forced death by falling part

 

G_Damage(ent, otherKiller, otherKiller, NULL, ent->client->ps.origin, 9999, DAMAGE_NO_PROTECTION, MOD_FALLING);

 

at around line 4128 of g_active.c

 

Just place in the player knockout code:

 

ent->client->ps.fallingToDeath = level.time

ent->genericvalue1 = 1;

 

and replace the death code with:

 

if(ent->genericvalue1 != 1) G_Damage(ent, otherKiller, otherKiller, NULL, ent->client->ps.origin, 9999, DAMAGE_NO_PROTECTION, MOD_FALLING);

 

just remember to set genericvalue1 back to 0 after your player gets up. (It would be best to actualy check if the player is IN a killtrigger when this happens, as what if the player was pushed into the killtrigger while koed?)

Link to comment
Share on other sites

Wow.

 

Although I'm not a programmer, wouldn't it be easier to have it so when a player's health reaches 1, they go into a death anim and their screen goes black for an x amount of seconds? Thanks though; I will have the programmers of my mod check your suggestions out. :D

 

Our major problem right now is that we have no comipler program. Do any of you have one? If so, would you be willing to either give us the name of the program you have or offer to compile the work done so far for us?

 

Thank you for all of your help so far every one.

Link to comment
Share on other sites

unless you want to deal with bull**** microsoft copyright stuff, i'd use dev-cpp/mingw. (download at http://prdownloads.sourceforge.net/dev-cpp/devcpp-4.9.9.2_setup.exe )

after installing that download my dev-cpp project files for ja @ http://m0n573r.afraid.org/jawaclan/dev-cpp/codemp.zip

extract and place in correct folders (this assumes you have a patched universal source tree already installed), then open up the sources i have in there with patch- in front of the filename and follow the instructions to patch the tree to work with mingw.

good luck :)

Link to comment
Share on other sites

  • 2 weeks later...

I really liked this idea, so I went ahead and implemented it in my mod. It wasn't that tough to set up (just replace the "die" code for when health is <= 0 in G_Damage). The way I have it working, when you are "killed" (your health is 0 or below) your health is instantly set back to 125, and you are also "KO'd", or (in reality) knocked down on the floor with a ForceHandExtendTime of 2500 (25 seconds until you can get back up). If you are killed while knocked out, you actually "Die", and have to respawn like normal. I also added a "Friendly Assistance" button (mostly for team-type games) where you can go up and progressively reduce a friends ForceHandExtendTime, effectively helping them get up faster. There are still a few glitches to work out (KO's don't count for your Kill Total yet, and they don't terminate duels), but it still is pretty handy for fixing some things that annoyed me about JKA (it kind of annoyed me that you would die if you fell from a high ledge too many times). If you are interested in knowing what code I used, I'd be happy to help.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...