Inside3D tutorials.
Created By: | James Layman |
eMail: | drywall@telefragged.com |
Difficulty Scale: | Easy |
/* ================ OgreFireSpike ================ */ void() OgreFireSpike = { local vector dir; local entity old; sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM); self.attack_finished = time + 0.2; dir = normalize (self.enemy.origin - self.origin); launch_spike (self.origin + '0 0 16', dir); newmis.touch = superspike_touch; setmodel (newmis, "progs/s_spike.mdl"); setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); };Well, what that was was basically a modified version of the player's firespike void. The direction was changed, and a few things were removed, like the ammo reduction.
/* ================ =Spikes or Grenades?= ================ */ void() ChoozAtak = { local float SoG; // creates a variable number, SoG SoG = random (); // randomizes SoG if (SoG > 0.3) // 70% chance for spike { OgreFireSpike(); } else { OgreFireGrenade(); } };
void() ogre_nail4 =[ $shoot3, ogre_nail5 ] {ai_face();OgreFireGrenade();}; And change it to: void() ogre_nail4 =[ $shoot3, ogre_nail5 ] {ai_face();ChoozAtak();};