Here is a usable Flak88 with one problem...any ideas?

Post your scripting questions / solutions here

Moderator: Moderators

User avatar
IvanTheTerrible
Sergeant
Posts: 55
Joined: Thu Jun 26, 2003 7:35 pm
Location: Upland, CA

Syntax Clarification Please

Post by IvanTheTerrible »

Am I to assume that in my case I would replace <player ent> with local.player so that I get local.player ammo heavy 1. If that is indeed the case, I've tried it to no avail. I'm tearing my hair out...I thought I was so close.
M&M
General
Posts: 1427
Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:

Post by M&M »

i think there is a map already that has a working flak in it,u can find it at the map release section .the name is king tiger map(i think).its an objective map with 4 tanks and a flak 4 each team.the ammo is 5 and appears every 30 secs(i think).maybe u could dload it and take a look at the script
Image
User avatar
IvanTheTerrible
Sergeant
Posts: 55
Joined: Thu Jun 26, 2003 7:35 pm
Location: Upland, CA

Need to accomplish via scripting only

Post by IvanTheTerrible »

Thank's anyway M&M, but I need to accomplish this entirely by scripting. I want to add the Flak88 to a standard map--King Tiger is a custom map. There are shader files in it that cannot be transfered to a standard map. These files are what make the Flak work correctly in the custom map.
User avatar
IvanTheTerrible
Sergeant
Posts: 55
Joined: Thu Jun 26, 2003 7:35 pm
Location: Upland, CA

Latest flak88turret.tik with looping problem on server

Post by IvanTheTerrible »

This flak88turret.tik works fine on my local machine, but when I upload it to the server it seems as though the animation goes into a perpetual loop. The flash around the muzzle stays there because the animation is looping so fast...at least that's the way it appears. The sound is looping just as quickly.

Code: Select all

TIKI 
setup
{
   scale 0.52         // Set default scale to 16/30.5 since world
                  // is in 16 units per foot and model is in cm's
   //scale 1.55            // Seems to work better than 0.52
   path models/statweapons/88mmflak
   skelmodel 88turret.skd
   surface all shader flak88
}

init
{
      server
      {
      classname       TurretGun
      weapontype      cannon
      name         "88mm A.T. Gun"

      // turret settings
      idleCheckOffset      "-240 0 0"
      viewOffset      "-70 0 95"      // " -100 -10 115" ****
             
      pickupsound      snd_bazooka_pullout
      // noammosound      flak88_reload

      // Primary fire
      projectile      models/projectiles/bazookashell.tik
      firetype      projectile     
       
      // firingrate           3
      firedelay      5
       
      //reloadshots       1    // 1 shot before forcing a reload (this is not like normal ammo)
      //reloaddelay       1000    // ** 0.0  Force a reload delay -- spec'ed at 15-20 rounds / minute       
       
      ammotype      "heavy"
      //semiauto
      //clipsize      1
      meansofdeath      rocket
      bulletcount      1
      //usenoammo      1
      ammorequired       1

      bulletrange      8000
      bulletdamage      200
      bulletspread      -35 -35
       
      tracerfrequency    1   *****
       
       
      firedelay       3380    // Rate of fire
      turnspeed       0.03    // Rate the turret lags behind -- > 1000 means no lag
       
      pitchcaps       "-30 20 0"    // Pitch Min and Max in degrees ( -max, -min, ignored )
      maxyawoffset       180.0       // Degrees of yaw freedom on either side of 0 - 180 is no limits       
       

      // DM Attributes
      dmprojectile      models/projectiles/bazookashell.tik
      dmammorequired      1
       
      dmfiredelay      15.0
       
      //dmbulletcount      1
      dmbulletrange      8000
      dmbulletdamage      400
      dmbulletspread      15 15 75 75
      dmcrosshair      1

       
      SoundSet "tank_"
      }
   client
   {
      cache muzsprite.spr
      cache models/fx/muzflash.tik
      cache models/ammo/rifleshell.tik
      cache model vsssource.spr
      cache model smoke_ring.spr
   }
}


animations
{
   idle           88turret.skc
   wheel_left      88turret_wheel_left.skc   
   wheel_right      88turret_wheel_right.skc
   fire         88turret_fire.skc
   {

      server
      {
         first shoot
      }
       
      client
      {
         entry stopaliaschannel tank_snd_fire
         first sound tank_snd_fire weapon 1.0 -1 0.95 0.1

         first tagspawn tag_barrel
         (
            model vsssource.spr
            count 6
            alpha 0.30
            color 1.00 1.00 1.00
            life 0.70
            scalerate 15.00
            cone 20.00 20.00
            velocity 700.00
            accel -2000.00 0.00 0.00
            friction 4.00
            fade
            circle
            randomroll
         )

         // muzzle flash
         first tagdlight tag_barrel 0.25 0.2 0.05 110 0.11
         first tagspawn tag_barrel
         (
            spawnrate 1.00
            model muzsprite.spr
            alpha 0.50
            color 1.00 1.00 1.00
            varycolor
            scale 1.70
            life 0.05
            scalerate 1.00
            velocity 4.00
            friction 3.00
            fade
            alignstretch 1.00
         )

         first tagspawn tag_barrel
         (
            spawnrate 1.00
            model muzsprite.spr
            alpha 0.50
            color 1.00 1.00 1.00
            scale 1.60
            life 0.05
            scalerate 0.70
            velocity 17.00
            offsetalongaxis 9 0 0
            fade
            alignstretch 0.40
         )

         first tagspawn tag_barrel
         (
            spawnrate 1.00
            model muzsprite.spr
            alpha 0.50
            color 1.00 1.00 1.00
            scale 1.60
            life 0.05
            velocity 18.00
            fade
         )

         first tagspawn tag_barrel
         (
            spawnrate 1.00
            model models/fx/muzflash.tik
            color 1.00 1.00 1.00
            scale 1.09
            life 0.01
            velocity 2009.00
            accel 0.00 20.00 30.00
            friction 2.00
            offsetalongaxis range -10 4 0 0
            fade
            alignstretch 0.02
         )

         first tagspawn tag_barrel
         (
            spawnrate 1.00
            model models/fx/snipesmoke.tik
            color 1.00 1.00 1.00
            scale 3.00
            life 1.00
            velocity 220.00
            friction 10.00
            angles 0 0 random 270
            avelocity 0 0 10
            align
         )
         
      }
       
   }
}

/*QUAKED turretweapon_stolen_88mmflakturret (0.5 0.25 0.25) (-32 -32 0) (32 32 128)
Allied Flak 88 Turret
*/
[D.o.G]FaDe2BlAcK
Sergeant
Posts: 55
Joined: Fri Dec 17, 2004 9:48 pm
Location: St. Cloud, MN
Contact:

Post by [D.o.G]FaDe2BlAcK »

So could I use this script to function a Flak 88 on my custom??
neillomax
Lieutenant General
Posts: 880
Joined: Thu Jun 23, 2005 6:57 am

Post by neillomax »

local.mg421 = spawn models/statweapons/P_flak88.tik
local.mg421.origin = ( 0.0 0.0 0.0 )
local.mg421.angle = 165
local.mg421 yawCenter 165
local.mg421 maxyawoffset 40

put in your own origin............. OR


// ARCHITECTURE: Bjarne Gr?nnevik
// SCRIPTING: Bjarne Gr?nnevik
spawn_a_flak88:
// Spawn a script model and give it a targetname
local.flak = spawn script_model "targetname" "flak88"
// Set the model to be drawn/used
local.flak model "statweapons/flak88turret.tik"
// Set where it should be
local.flak.origin = ( -100.0 .0 0.0 )
// Set where it should point at
local.flak.angles = ( 0.0 0.0 0.0 )
// Set how big it should be
local.flak.scale = 1.0
// Create the trigger and give it a targetname
local.trigger = spawn trigger_use "setthread" "fire_flak88"
// Set where it should be
local.trigger.origin = ( 0.0 100.0 0.0 )
// Set the size of it
local.trigger setsize ( -50 -50 -50 ) ( 50 50 50 )
end

--------------------------------------------------------------------------------


And to initiate the spawning of the Flak88, write this in the main method ( after level waittill prespawn )



--------------------------------------------------------------------------------

thread spawn_a_flak88
[D.o.G]FaDe2BlAcK
Sergeant
Posts: 55
Joined: Fri Dec 17, 2004 9:48 pm
Location: St. Cloud, MN
Contact:

Post by [D.o.G]FaDe2BlAcK »

Thank you very much!
Post Reply