Results 1 to 5 of 5

Thread: C4

  1. #1
    Private
    Join Date
    Jul 2015
    Posts
    44
    Thanks
    7
    Thanked 2 Times in 2 Posts

    C4

    I'm not sure many people will understand this (if you don't, tell me, i'll try write it out with less confusion)

    In my mod, C4 and Claymore are both Smoke grenade offhandClass (so people can just throw it immediately with their tactical grenade key and if it's a c4, they can detonate it with the frag key), I have no issues with claymore but here's the deal, the Smoke grenade offhandclass doesn't allow the player to (frag key)detonate the c4 while the it's still in the air, it has to actually be attached to a surface/land for the detonate key to work, and if a player presses the detonate key before it does land(while the c4 is still in the air), the c4 won't detonate and this makes it so when it does land, it won't be able to be detonated by the frag key anymore.

    Now here's the weird bit, this stupid bug, that doesn't allow the c4 to explode in the air, is completely negated when I change the offhandClass of it to Flash Grenade in the weaponfile, the Flash Grenade offhandClass allows the c4 to be detonated both while still in the air and when attached to a surface, and I saw no issues with it, so I just used it, then came the reason for me posting this...

    In the infected gametype, the player's class is given to them by the gametype, c4 is meant to be and used to be given, but it isn't anymore, when I change it's offhandClass to Smoke Grenade, the gametype will give the player the C4, but once the offhandClass is changed to Flash Grenade, it doesn't give the player the c4 anymore, I wanted to know if there's anywhere in cod4's code that disables specific offhandClasses from being given to a player by a gametype, or anywhere in cod4's code that has all the offhandClasses defined?
    Because atm, the gametype is giving the C4 to the player based on if it's offhand Class is Smoke Grenade, and not on the fact I write it to give the player the c4_mp no matter what...

    Code:
    	 if ( self.getsSurvivorAmmo == true ) {
    
    	 // Give secondary weapon and start ammo
                   self giveWeapon( level.secondaryWeapon );
    
    	       if( self.getsSurvivorAmmo == true ) {
    	               self giveMaxAmmo( level.secondaryWeapon );
                   } else {
                           self setWeaponAmmoClip( level.secondaryWeapon, 0 );
                           self setWeaponAmmoStock( level.secondaryWeapon, 0 );
    					  
                  }
    Last edited by akuma2099; 30th September 2015 at 18:50.

  2. #2
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    No idea what you are saying. You remind me of this guy:

    https://www.youtube.com/watch?v=yFB_FS9rV0c

  3. #3
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    All that i can think of is that multiple offhandclasses cant be given in the same slot
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  4. #4
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by IzNoGoD View Post
    All that i can think of is that multiple offhandclasses cant be given in the same slot
    Right, you have to switch the offhand class each time you do it:

    Code:
    self setOffhandSecondaryClass( "smoke" );
    Code:
    self setOffhandSecondaryClass( "flash" );
    That switches the offhand class each time. Each one corresponds to what offhandtype is in the grenade weapon file.
    Last edited by Tally; 1st October 2015 at 09:20.

  5. #5
    Private
    Join Date
    Jul 2015
    Posts
    44
    Thanks
    7
    Thanked 2 Times in 2 Posts
    ahahah, I found that out by using notepad++ to find the word offhand in every file in maps, and trial and error, I found the part of code that actually affected the c4, then after modifying it, everything worked as it should. I actually haven't come back to this thread since your first reply because I knew no one was going to help, but thanks anyways Tally and IzNo. :P
    Last edited by akuma2099; 1st October 2015 at 13:05.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •