Jump to content

Home

Newbie coding question


DeTRiTiC-iQ

Recommended Posts

I'm trying to get started with this modding lark, i've hard a browse through the source code. There's one thing I want to try implementing to get me started:

 

I want to increase the explosive "force" of the explosive projectiles, such as rockets, flechette and repeater alts etc. But I don't want to increase the damage caused by the explosions. How would I go about doing this? (which files to edit, which lines etc)

 

Thanks.

Link to comment
Share on other sites

in g_combat.c after.....

if (targ && targ->client && targ->client->ps.usingATST)
{
          knockback = 0;
}

add in...

if ( meansOfDeath == MOD_FLECHETTE_ALT_SPLASH 
      || meansOfDeath == MOD_FLECHETTE_ALT_SPLASH
      || meansOfDeath == MOD_ROCKET_SPLASH
      || meansOfDeath == MOD_ROCKET_HOMING_SPLASH )
{
          knockback *= KNOCKBACKFORSPLASHWEAPONS;
}

Just replace KNOCKBACKFORSPLASHWEAPONS with your desired increase of knockback ratio.

Link to comment
Share on other sites

now for my next question, probably slightly trickier to answer:

 

When a player kills another player, I want to have the following information for use in a logic calculation:

 

1) Was the attacker in mid-air when he/she fired the shot?

2) Was the enemy in mid-air when he/she was killed?

 

By mid air, I mean more than 2 map units above the ground.

 

I'm guessing that (2) will be easier to find out, since (1) would require a new value to be passed with every shot fired...

Link to comment
Share on other sites

Originally posted by DeTRiTiC-iQ

now for my next question, probably slightly trickier to answer:

 

When a player kills another player, I want to have the following information for use in a logic calculation:

 

1) Was the attacker in mid-air when he/she fired the shot?

2) Was the enemy in mid-air when he/she was killed?

 

By mid air, I mean more than 2 map units above the ground.

 

I'm guessing that (2) will be easier to find out, since (1) would require a new value to be passed with every shot fired...

 

I don't know what you want... but ground entity num is none

when not on the ground.... soo:

 

(XXXX...->client->ps.groundEntityNum == ENTITYNUM_NONE)

Link to comment
Share on other sites

anywho... there are a few things I now need to figure out...

 

 

1) Check if the player is more than 3 units off the ground when they fire the shot, and pass the result all the way to G_Damage in the event of actually hitting an enemy

 

2) Check if the target is more than 2 units off the ground when they are hit, with the exception of homing rockets, and return the value (this will be done inside G_Damage)

 

3) Check if the target is more than 2 units from both walls AND the ground, with the exception of homing rockets, and return the value.

Link to comment
Share on other sites

because its harder to snipe someone if you are in mid-air along with the enemy, and its also easy to kill someone even if they are in midair if they are against a wall.

 

- so I want a small bonus if they just shoot someone in mid-air close to a wall

 

- a bigger bonus if they shoot someone close to a wall whilst in mid-air themselves

 

- an even bigger bonus for shooting someone who is literally in open-space in all dimensions

 

- a huge bonus for winning air-to-air combat

 

- no bonus if its done with the homing missile

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...