ive ported the ballistic knife from black ops (its about half way complete) but i have no idea how or if its even possible to create the ballistic knife projectile blade pickupable from walls, ground zombies ect if that makes sense i can shoot it but i dont know how i could do that and also how could i make it so when i buy the bowie knife it appears in my hand with the ballistic knife like it does in black ops when i buy the bowie knife and "knife" it completely ignores the ballistic knife and knifes with the bowie knife like it would if it were a gun, any help would be appreciated thankyou
Last Edit: August 12, 2012, 06:44:07 am by P0rkRoyalz
First off, this is possible. You can change the projectile model in the weapon file for the knife. As for sticking where shot and such, this is much like the crossbow. You're going to have to do a fair amount of scripting. Here's an excerpt from the crossbow gsc:
Code Snippet
Plaintext
self.bolt_stuck = false; //init for (;;) { self waittill("projectile_impact", weapon, point, radius); switch(weapon) { case "crossbow_exp": wait 0.1; //give the sticky func a chance to set the var before checking it if(self.bolt_stuck != true) { time = 2.1; bolt = spawn("script_model", point); bolt.angles = self getplayerangles(); bolt setModel("t5_weapon_crossbow_bolt_world_exp1"); bolt thread crossbow_sound(time); bolt thread crossbow_fx(bolt, time); wait time; thread crossbow_explosion_sound(bolt); PlayFXonTag(level._effect["crossbow_explode"], bolt, "tag_fx"); earthquake(0.4, 1, bolt.origin, 400); bolt radiusDamage( bolt.origin, int(level.zombie_health * 0.8), int(level.zombie_health * 1.5), 350, self, "MOD_GRENADE"); bolt hide(); bolt notify("death"); } break; } }
We can fairly easily modify this for purposes of the ballistic knife:
Code Snippet
Plaintext
for (;;) { self waittill("projectile_impact", weapon, point, radius); switch(weapon) { case "ballistic_knife": wait 0.1; knife = spawn("script_model", point); knife.angles = self getplayerangles(); knife setModel( **knife model name here** ); trig = spawn("trigger_radius", point, 0, 40, 40); trig waittill("trigger", player); current_ammo = getWeaponAmmoStock("ballistic_knife"); max_ammo = 5 // (for the sake of argument, the max ammo is 5) if(current_ammo < max_ammo){ ammo_to_add = current_ammo + 1; player setWeaponAmmoStock("ballistic_knife", ammo_to_add); knife hide(); knife delete(); }else{ // keep the pickup available for another time } break; } }
You can just thread that somewhere and it should be okay.
As for the Bowie knife showing up when you acquire it, that's simply a matter of detecting if you have the knife and changing the model, which could just be a whole other weapon. Like so:
First off, this is possible. You can change the projectile model in the weapon file for the knife. As for sticking where shot and such, this is much like the crossbow. You're going to have to do a fair amount of scripting. Here's an excerpt from the crossbow gsc:
Code Snippet
Plaintext
self.bolt_stuck = false; //init for (;;) { self waittill("projectile_impact", weapon, point, radius); switch(weapon) { case "crossbow_exp": wait 0.1; //give the sticky func a chance to set the var before checking it if(self.bolt_stuck != true) { time = 2.1; bolt = spawn("script_model", point); bolt.angles = self getplayerangles(); bolt setModel("t5_weapon_crossbow_bolt_world_exp1"); bolt thread crossbow_sound(time); bolt thread crossbow_fx(bolt, time); wait time; thread crossbow_explosion_sound(bolt); PlayFXonTag(level._effect["crossbow_explode"], bolt, "tag_fx"); earthquake(0.4, 1, bolt.origin, 400); bolt radiusDamage( bolt.origin, int(level.zombie_health * 0.8), int(level.zombie_health * 1.5), 350, self, "MOD_GRENADE"); bolt hide(); bolt notify("death"); } break; } }
We can fairly easily modify this for purposes of the ballistic knife:
Code Snippet
Plaintext
for (;;) { self waittill("projectile_impact", weapon, point, radius); switch(weapon) { case "ballistic_knife": wait 0.1; knife = spawn("script_model", point); knife.angles = self getplayerangles(); knife setModel( **knife model name here** ); trig = spawn("trigger_radius", point, 0, 40, 40); trig waittill("trigger", player); current_ammo = getWeaponAmmoStock("ballistic_knife"); max_ammo = 5 // (for the sake of argument, the max ammo is 5) if(current_ammo < max_ammo){ ammo_to_add = current_ammo + 1; player setWeaponAmmoStock("ballistic_knife", ammo_to_add); knife hide(); knife delete(); }else{ // keep the pickup available for another time } break; } }
You can just thread that somewhere and it should be okay.
As for the Bowie knife showing up when you acquire it, that's simply a matter of detecting if you have the knife and changing the model, which could just be a whole other weapon. Like so: