09-26-2011, 01:47 AM 
(This post was last modified: 09-26-2011, 02:08 AM by XonoxSeven.)
	
	
	
	
		I would like to hack the explosive weapons abit. They are very reliable: every pressure trigger always works 100 percent of the time.
I would like to add a: x = rand(int(99)); if (x > 3) { (Normal explode stuff) } else { prints"oops nade/rocket didn't go off!). But i don't know the exact syntax and good practices for this in quakeC.
Another idea I had, a more difficult one, is to add fragmentaries to the grenade launcher projectile(s), that means spawing new projectiles (I guess low velocity ballistics bullets) in random directions. So this means I need rand, and I guess a foreach (untill x amount of bullets have been shot in all directions), and set how hard the bullets will hurt, plus a toggle to turn this feature on/off.
Hmm, maybe I should look at the shotgun code and use that with a mega huge spread (what is 360 degree spread in all directions?).
Didn't work, messed with the initial nade firing instead, trying without the W_SetupShot call now.
	
	
I would like to add a: x = rand(int(99)); if (x > 3) { (Normal explode stuff) } else { prints"oops nade/rocket didn't go off!). But i don't know the exact syntax and good practices for this in quakeC.
Another idea I had, a more difficult one, is to add fragmentaries to the grenade launcher projectile(s), that means spawing new projectiles (I guess low velocity ballistics bullets) in random directions. So this means I need rand, and I guess a foreach (untill x amount of bullets have been shot in all directions), and set how hard the bullets will hurt, plus a toggle to turn this feature on/off.
Hmm, maybe I should look at the shotgun code and use that with a mega huge spread (what is 360 degree spread in all directions?).
Code:
    RadiusDamage (self, self.realowner, autocvar_g_balance_grenadelauncher_primary_damage, autocvar_g_balance_grenadelauncher_primary_edgedamage, autocvar_g_balance_grenadelauncher_primary_radius, world, autocvar_g_balance_grenadelauncher_primary_force, self.projectiledeathtype, other);
    //Frags
    if (autocvar_g_balance_grenadelauncher_primary_frag_bullets > 0) {
    float    sc;
    float    ammoamount;
    float    bullets;
    float    d;
    float    f;
    float    spread;
    float    bulletspeed;
    float    bulletconstant;
    
    bullets = autocvar_g_balance_grenadelauncher_primary_frag_bullets;
    d = autocvar_g_balance_grenadelauncher_primary_frag_damage;
    f = autocvar_g_balance_grenadelauncher_primary_frag_force;
    spread = autocvar_g_balance_grenadelauncher_primary_frag_spread;
    bulletspeed = autocvar_g_balance_grenadelauncher_primary_frag_speed;
    bulletconstant = autocvar_g_balance_grenadelauncher_primary_frag_bulletconstant;
    
    W_SetupShot (self, autocvar_g_antilag_bullets && bulletspeed >= autocvar_g_antilag_bullets, 5, "weapons/shotgun_fire.wav", CH_WEAPON_A, d * bullets);
    for (sc = 0;sc < bullets;sc = sc + 1)
        fireBallisticBullet(w_shotorg, w_shotdir, spread, bulletspeed, 5, d, 0, f, WEP_GRENADE_LAUNCHER, 0, 1, bulletconstant);
    endFireBallisticBullet();
    }
    //
    
    remove (self);
}Didn't work, messed with the initial nade firing instead, trying without the W_SetupShot call now.



![[Image: 4XODR.png]](http://i.imgur.com/4XODR.png)
	