Results 1 to 6 of 6
  1. #1
    ch40s's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    6

    [SOLVED] change damage handling (mod_melee)

    Hello again,
    so im still trying to disable knifing (and for gungame also setting the damage lower, so a knife is no instant) in a comfort, per user way. Since the knife is the only "weapon" i know of, that has no name to use in damage calculation (playerkilled_internals() in damage.gsc) i have to find another way.
    The "no-knife-instant" can be solved by simply increasing everyones health and then adjusting the iDamage for weapons.
    But the no-knife-damage is another thing. I read about the unused mw2-tank-killstreak, and found a line with if(damagetype == "mod_melee"). So the only way (i found until now) to modify knife damage is by using its damagetype. Now to the question:
    Where is the right place to add a method that uses "damagetype".
    In the tank-killstreak thing, it never gets mentioned where the code is located, and until now i didnt find any damagtype statements in the .gsc's int the patch_mp.ff . Could it be that this is handled in another .ff? And if so is it even possible to change anything, since (from my understanding) only the patch_mp.ff is modified on loading a mod?

    Sorry for the long thread, and thanks in advance

    greetz
    Last edited by Insane; 09-22-2010 at 08:25 PM.

  2. #2
    ch40s's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    6

    FOUND IT!

    Found a solution (pretty simple actually), so if anyone is interested:
    in damage.gsc at about line 1355 you''ll find the following:
    Code:
    prof_begin( "PlayerDamage world" );
              //add your code here
    prof_end( "PlayerDamage world" );
    You can simply add any damage modification here, for example for changing the knifes damage to 50 (2x knifing is a kill) you add
    Code:
    if ((sMeansOfDeath == "MOD_MELEE") && !(IsSubStr( sWeapon, "riotshield" )))
    				iDamage = 50;
    Using IsSubStr you should be able to change the damage of any weapon.
    Simple Solution, took me forever to find it

    greetz

    EDIT: can be marked as solved
    Last edited by ch40s; 09-20-2010 at 08:25 AM.

  3. #3
    kerocx's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    79
    Reputation
    10
    Thanks
    6
    U can do it much easier, but nice finding. I just added if idamage 135-139, cause thats the damage range the knife makes.

  4. #4
    AZUMIKKEL's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    My moms house... what's so funny about that?
    Posts
    790
    Reputation
    19
    Thanks
    462
    My Mood
    Sneaky
    www.YouTube.com/MpKiller100

  5. The Following User Says Thank You to AZUMIKKEL For This Useful Post:

    JustAndy (12-29-2011)

  6. #5
    ch40s's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    6
    thx a lot for the replies, figured the "Callback_PlayerDamage_internal()" part out already

    I went with "player_damage_world" though, 'cause i needed to check for "player is knifed", and that statement was already there. I know its just a check if the weapon is a riotshield, but hey, im keeping it compact :P

    greetz

  7. #6
    Insane's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    9,055
    Reputation
    1007
    Thanks
    1,997
    /Marked as Solved
    Insane
    Ex Middleman
    [
    PM|VM]
    |x|x|x|x|x|x|x|



    Quote Originally Posted by Boombox View Post
    Shut the fuck up insane you pussy bitch.
    Quote Originally Posted by arunforce View Post
    Shut the fuck up kid, everything that comes out of your mouth sounds retarded as fuck.

Similar Threads

  1. [SOLVED] change xuid
    By owens12 in forum Call of Duty Modern Warfare 2 Help
    Replies: 11
    Last Post: 09-10-2010, 10:16 AM
  2. [SOLVED] change iron sight?
    By cayongrayoo in forum Call of Duty Modern Warfare 2 Help
    Replies: 14
    Last Post: 08-01-2010, 11:55 AM
  3. Changing damage with .gsc modding?
    By Shucker in forum Call of Duty Modern Warfare 2 Help
    Replies: 4
    Last Post: 07-30-2010, 07:19 PM
  4. [SOLVED]Change Prestige and VAC Chaos
    By barski in forum Call of Duty Modern Warfare 2 Help
    Replies: 8
    Last Post: 07-06-2010, 07:27 AM
  5. [SOLVED] Change Weapon Damage?
    By schiz in forum Call of Duty Modern Warfare 2 Help
    Replies: 6
    Last Post: 06-30-2010, 08:40 PM