Page 1 of 1

Shooting when scoping

Posted: Wed Jun 20, 2012 12:36 pm
by Hece
I have this script for scoping, but what should I add to make the scope be on after and when shooting?

Code: Select all

actor G36K : weapon 20003
{
   Weapon.AmmoUse 1
   Weapon.AmmoGive 60
   Weapon.AmmoType "7,62"
   Inventory.PickupMessage "Hi-tech weaponry"
   Obituary "%o met death by %k G36K."
   States
   {
   Ready:
     TKGN A 1 A_WeaponReady
     Loop
   Deselect:
     TKGN A 1 A_Lower
     Loop
   Select:
     TKGN A 1 A_Raise
     Loop
   Fire:
     TKGN A 0 Bright
	 TKGN A 0 A_PlaySound("weapons/minigun")
     TKGN B 1 A_FireBullets(2,2,1,20)
	 TKGN C 3
     TKGN A 3
	 TKGN A 0 A_ReFire
     Goto Ready
   Spawn:
     TKGN X -1
     Stop
	 AltFire: //BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
    G36K S 2 A_WeaponReady(WRF_NoBob)
    G36K S 0 A_JumpIfInventory("M4Zoom", 2, "ZoomOut")
    TNT1 A 0 A_JumpIfInventory("M4Zoom", 1, "Zoom2")
  Zoom2:
    G36K S 0 A_ZoomFactor(4.0)
    TNT1 A 0 A_GiveInventory ("M4Zoom", 1)
    Goto "ReadyScope"
  ZoomOut:
    G36K S 0 A_ZoomFactor(1.0)
    TNT1 A 0 A_TakeInventory ("M4Zoom", 2)
    Goto "Ready"
  AltFireDone:
    G36K S 1 A_ReFire
    Goto "Ready" 
	ReadyScope:
      G36K S 1 A_WeaponReady(WRF_NoBob)
      LOOP
   }
}

RE: Shooting when scoping

Posted: Wed Jun 20, 2012 2:13 pm
by Ænima
Hint: Put A_JumpIfInventory in the Fire state.

You wouldn't have to create all of these "HOW DO I" threads if you simply opened up other wads and looked at how something is done.

RE: Shooting when scoping

Posted: Wed Jun 20, 2012 2:22 pm
by Hece
Ænima wrote: You wouldn't have to create all of these "HOW DO I" threads if you simply opened up other wads and looked at how something is done.
I do seek answers from other wads first, and after that post it here.